Commit Graph

6155 Commits

Author SHA1 Message Date
Kenneth Moreland
f7cc03107d Fix deprecated warnings
Supress the deprecated class warnings for the implementation of
deprecated features.
2020-09-09 06:13:07 -06:00
nadavi
843307bcf7 fix floating point casting warning in worklet test 2020-09-08 17:47:53 +00:00
nadavi
18263a37ac update float casting to not have warnings on iris 2020-09-08 17:47:53 +00:00
nadavi
89cf93a66b fix OpenMP PRAGMA warnings for auto-associated looping variable types 2020-09-08 17:47:53 +00:00
Kenneth Moreland
63ef84ed78 Optionally remove all use of ArrayHandleVirtual
As we remove more and more virtual methods from VTK-m, I expect several
users will be interested in completely removing them from the build for
several reasons.

1. They may be compiling for hardware that does not support virtual
methods.
2. They may need to compile for CUDA but need shared libraries.
3. It should go a bit faster.

To enable this, a CMake option named `VTKm_NO_DEPRECATED_VIRTUAL` is
added. It defaults to `OFF`. But when it is `ON`, none of the code that
both uses virtuals and is deprecated will be built.

Currently, only `ArrayHandleVirtual` is deprecated, so the rest of the
virtual classes will still be built. As we move forward, more will be
removed until all virtual method functionality is removed.
2020-09-04 22:52:45 -06:00
Kenneth Moreland
e11f612add Deprecate ArrayHandleVirtual
Virtual methods in the execution environment are going away the next
major release of VTK-m, so deprecate their use in preparation for that.
2020-09-04 22:52:45 -06:00
Kenneth Moreland
06579aac8c Merge topic 'replace-variantarrayhandle-impl'
386301719 Test UnknownArrayHandle behavior on special arrays
872da1f8e Suppress unnecessary deprecation warnings on VS
bb443bbc2 Replace the implementation of VariantArrayHandle

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2255
2020-09-05 00:32:16 -04:00
Vicente Adolfo Bolea Sanchez
fb919e048e vtkm::Vec: added unrolled arithmetic operators overload
Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2020-09-03 16:10:15 -04:00
Kenneth Moreland
3863017190 Test UnknownArrayHandle behavior on special arrays
`UnknownArrayHandle` has special behavior when putting in or getting out
an `ArrayHandleMultiplexer` or an `ArrayHandleCast`. When putting in
either of these, `UnknownArrayHandle` gets the actual array stored in
the multiplexer and cast so that you can later retrieve the base array.
Likewise, when you get the array out with `AsArrayHandle`, you can give
it an `ArrayHandleCast` or `ArrayHandleMultiplexer`, and you will get
the base array placed inside of it.
2020-09-03 09:13:01 -06:00
Kenneth Moreland
872da1f8e6 Suppress unnecessary deprecation warnings on VS
The Visual Studio compiler has an annoying habit where if you use a
templated class or method with a deprecated class as a template
parameter, you will get a deprecation warning where that class is used
in the templated thing. Thus, if you want to suppress the warning, you
have to supress every instance of the template, not just where the
template is declared.

This is annoying behavior that is thankfully not replicated in other
compilers.
2020-09-02 16:48:11 -06:00
Kenneth Moreland
bb443bbc24 Replace the implementation of VariantArrayHandle
The implementation of `VariantArrayHandle` has been changed to be a
relatively trivial subclass of `UnknownArrayHandle`.

The advantage of this change is twofold. First, it removes
`VariantArrayHandle`'s dependence on `ArrayHandleVirtual`, which gets us
much closer to deprecating that class. Second, it ensures that
`UnknownArrayHandle` is a reasonable replacement for
`VariantArrayHandle`, so we can move forward with replacing that.
2020-09-02 15:02:44 -06:00
Kenneth Moreland
66a4a23ebf Fix issue of getting pointer from std::vector of size 0
C++11 introduced the `std::vector::data()` method. In addition to being
more syntatically pleasing, it should correctly handle the condition
when the `std::vector` is size 0 and therefore has no real pointer.
(Expressions like `&v[0]` are undefined when the `vector` is empty.)
2020-09-02 12:04:34 -06:00
Kenneth Moreland
3f8da6e7e1 Fix some debugging code that should not have been there 2020-09-01 14:21:09 -06:00
Kenneth Moreland
52cecefba0 Fix crash when loading poly data with no cells 2020-09-01 14:20:11 -06:00
Kenneth Moreland
5250c28ff2 Swap call pattern of ArrayHandle::DeepCopy
The new method `ArrayHandle::DeepCopy` had the pattern such that the
data in the `this` array was pushed to the provided destination array.
However, this is the opposite pattern used in the equivalent method in
VTK, which takes the data from the provided array and copies it to
`this` array.

So, swap the pattern to match that of VTK. Also, make the method name
more descriptive by renaming it to `DeepCopyFrom`. Hopefully, users will
read that to mean given the `ArrayHandle`, you copy data from the other
provided `ArrayHandle`.
2020-09-01 10:08:06 -06:00
Ben Boeckel
aa6eb01dfe ComputeMoments: use FilterField instead of FilterCell 2020-08-31 16:51:12 -04:00
Li-Ta Lo
e17345a81f Merge branch 'master' into concurrent_union_find 2020-08-31 14:34:29 -06:00
Kenneth Moreland
c79daa5c2f Suggested changes to comments 2020-08-31 09:51:53 -06:00
Kenneth Moreland
fca25fa3c7 Enable serialization of UnknownArrayHandle and UncertainArrayHandle
Because UnknownArrayHandle is not typed, we can compile into vtkm_cont
the ability to serialize many types.
2020-08-31 09:46:57 -06:00
Kenneth Moreland
94aa6449b9 Add UncertainArrayHandle 2020-08-31 09:46:57 -06:00
Kenneth Moreland
e47cedd972 Add UnknownArrayHandle 2020-08-31 09:46:56 -06:00
Li-Ta Lo
945e9cf328 some more comments 2020-08-31 09:23:03 -06:00
Ben Boeckel
ede0c179b7 Merge topic 'vtkmdiy-install-destination'
f4df3fe00 vtkmdiy: forward the bin install directory to diy
a4b4b1a2c Merge branch 'upstream-diy' into HEAD
db483b3e2 diy 2020-08-26 (c9efaac9)
acde82a36 diy: update for install destination fix

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2244
2020-08-28 14:29:11 -04:00
Li-Ta Lo
7533538e17 restore CI config files, minor clean up for UnionFind 2020-08-28 10:48:14 -06:00
Li-Ta Lo
31322cd2e1 use CompareAndSwap for setting root 2020-08-28 10:33:24 -06:00
Li-Ta Lo
4cd320c284 put finding and setting root in a loop 2020-08-28 08:53:56 -06:00
Li-Ta Lo
f91fb35d7f added more data race analysis, change GraphGraft to use AtomicArray 2020-08-28 00:04:50 -06:00
Li-Ta Lo
e5f8219477 try fixing CUDA compiler error 2020-08-27 22:35:27 -06:00
Li-Ta Lo
fc754b329f deduplicate UnionFind 2020-08-27 20:07:32 -06:00
Li-Ta Lo
af53fb736f Add unit test for graph connectivity with data from the ECL_CC paper 2020-08-27 17:37:08 -06:00
Kenneth Moreland
2877aab21a Fix problem with ArrayCopy of two of the same arrays
A recent modification to `ArrayCopy` created a fast path for when
copying arrays of the same type. This fast path just deep copies the
buffers. The issue was that the buffer copy was creating new buffers
instead of updating the existing buffers. The passed in `ArrayHandle`
would get updated to the new buffers, but any other `ArrayHandle`s
sharing those buffers would still have the old versions. That would lead
to unexpected errors in code like this.

```cpp
vtkm::cont::ArrayHandle<T> outArray1;
vtkm::cont::ArrayHandle<T> outArray2 = outArray1;

vtkm::cont::ArrayCopy(inArray, outArray2);
```

If `inArray` was a different type than `outArray2`, then the data for
both `outArray1` and `outArray2` would be updated (which is the expected
behavior for something considered a "pointer"). However, if `inArray`
was the same type as `outArray2`, then the fast path would change
`outArray2` but leave `outArray1` the same.

This behavior has been corrected so that, in this case, the data of
`outArray1` always follows that of `outArray2`.
2020-08-27 17:28:54 -06:00
Kenneth Moreland
d938226cd3 Fix tests that relied on stable sort
The parallel sorts in the device adapter are documented to not be
stable. Up until recently, the sorts for all the supported devices
happened to be stable (or at least provided a stable sort where needed).
However, the recent Kokkos adapter provides a sort that is no stable.
This broke some tests that relied on stable sorts when they should not
have.

Fix the tests that relied on stable sort to check the results.
2020-08-27 14:50:51 -06:00
Li-Ta Lo
17047f456d more comments on things to do 2020-08-27 11:46:31 -06:00
Li-Ta Lo
727e0cb268 single pass algorithm for both Image and Graph connectivity 2020-08-27 11:22:48 -06:00
Li-Ta Lo
19be36ee7a implemented single pass algorithm for image connectivity 2020-08-27 11:03:45 -06:00
Li-Ta Lo
0902cbbad3 save before change to single pass algorithm 2020-08-27 10:17:02 -06:00
Kenneth Moreland
80cf0b3658 Fix more signed/unsigned vtkm::Id/std::size_t warnings in kokkos adapter 2020-08-27 07:59:03 -06:00
Robert Maynard
faa845d56e Merge topic 'reenable_tests_mistakenly_disabled'
769d6468f Correct a mistake where the kokkos MR merged disabled worklet tests

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2243
2020-08-27 07:56:37 -04:00
Kenneth Moreland
d9b8a620a1 Merge topic 'array-copy-overloads'
3143c7105 Add tests for Buffer::DeepCopy
8298d33f5 Fix issues with ArrayCopy

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2241
2020-08-26 16:06:11 -04:00
Kenneth Moreland
ef236dc1e5 Merge topic 'stateless-storage'
0cc0f3f96 Make Storage class completely stateless

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2238
2020-08-26 15:58:31 -04:00
Dave Pugmire
ca57b05264 Merge topic 'renameParticleTypes'
d64deb00f rename vtkm::Massless to Particle
596ec20e9 Change particle type in examples
855e973a2 Rename the Particle classes.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !2239
2020-08-26 15:16:58 -04:00
Kenneth Moreland
3143c71058 Add tests for Buffer::DeepCopy
Tests for regression of deadlock found with copying an empty `Buffer` as
well as testing other `DeepCopy` behavior.
2020-08-26 12:45:19 -06:00
Ben Boeckel
f4df3fe007 vtkmdiy: forward the bin install directory to diy 2020-08-26 14:18:33 -04:00
Ben Boeckel
a4b4b1a2c9 Merge branch 'upstream-diy' into HEAD
# By Diy Upstream
* upstream-diy:
  diy 2020-08-26 (c9efaac9)
2020-08-26 14:18:31 -04:00
Ben Boeckel
acde82a366 diy: update for install destination fix 2020-08-26 14:17:59 -04:00
Robert Maynard
769d6468fd Correct a mistake where the kokkos MR merged disabled worklet tests 2020-08-26 13:19:49 -04:00
Robert Maynard
9aa3b9df01 DeviceAdapterAlgorithmKokkos correct signed/unsigned warnings 2020-08-26 13:10:23 -04:00
Kenneth Moreland
8298d33f52 Fix issues with ArrayCopy
C++ was not resolving the overloads of `ArrayCopyImpl` as expected,
which was causing  `ArrayCopy` to sometimes use a less efficient method
for copying.

Also fix an issue with `Buffer::DeepCopy` that caused a deadlock when
copying a buffer that was not actually allocated anywhere (as well as
failing to copy the metadata, which was probably the whole point).
2020-08-26 08:03:47 -06:00
Dave Pugmire
855e973a20 Rename the Particle classes. 2020-08-26 08:59:51 -04:00
Kenneth Moreland
0cc0f3f961 Make Storage class completely stateless
The old style `ArrayHandle` stored most of its state, including the
data, in the `vtkm::cont::internal::Storage` object (templated to the
type of array). The new style of `ArrayHandle` stores the data itself in
`Buffer` objects, and recent changes to `Buffer` allow metadata to be
stored there, too.

These changes make it pretty unnecessary to hold any state at all in the
`Storage` object. This is good since the sharing of state from one type
of `ArrayHandle` to another (such as by transforming the data), can be
done by just sharing the `Buffer` objects.

To reinforce this behavior, the `Storage` object has been changed to
make it completely stateless. All the methods of `Storage` must be
marked as `static`.
2020-08-25 20:00:54 -06:00
Li-Ta Lo
69de6afa2a add more comments on data race 2020-08-25 13:30:37 -06:00
Kenneth Moreland
b526c4c914 Make VTKM_ARRAY_HANDLE_NEW_STYLE macro
While in the transition between two types of `ArrayHandle`
implementations, we need to declare when an `ArrayHandle` is implemented
with the new style. To consolidate, create a
`VTKM_ARRAY_HANDLE_NEW_STYLE` to override the default `ArrayHandle`
implementation with the `ArrayHandleNewStyle` implementation.
2020-08-25 13:02:19 -06:00
Dave Pugmire
2351e4775d Add particle messenger test. 2020-08-25 11:49:59 -04:00
Dave Pugmire
c9041ec41a Add unit test for particle messenger. 2020-08-25 11:39:14 -04:00
Dave Pugmire
63b31ffb24 Replace MemStream with the diy serialization code. 2020-08-25 11:38:01 -04:00
Kenneth Moreland
cdc41cc987 Merge topic 'vtk-test-files-in-repo'
a8fa14335 Move UnitTestVTKDataSetReader files to git-lfs
571aa9f3d Simplify getting test file names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Sujin Philip <sujin.philip@kitware.com>
Merge-request: !2234
2020-08-25 11:27:07 -04:00
Kenneth Moreland
b5ed6e7257 Fix some conversion warnings
Fixes some compiler warnings that were missed on recent dashboards.
2020-08-25 08:30:44 -06:00
Kenneth Moreland
a8fa143351 Move UnitTestVTKDataSetReader files to git-lfs
The `UnitTestVTKDataSetReader` test reads in .vtk files of multiple
formats. The origins of this test predate the use of git-lfs and a data
directory, so the test defined in the source code several strings
containing the contents of the files.

That is no longer necessary. This change removes those strings from the
file and creates actual files in the data directory. This is easier to
manage as well as more convenient if you want to use the same data in a
different test or just take a look at the data in a different program
(such as VisIt or ParaView).
2020-08-25 07:23:13 -06:00
Kenneth Moreland
571aa9f3d7 Simplify getting test file names
The testing helper class provided a method named `GetTestDataBasePath`
that returned the base path to all the data files stored in the VTK-m
repo. This is fine, but it was a little cumbersome to build filenames.

To make things easier, there is now a new method named `DataPath` that
takes a string of the filename (or, rather, subpath) to the file in that
directory and automatically builds the path to it.
2020-08-25 06:17:59 -06:00
Kenneth Moreland
17b81f54a2 Merge topic 'arrayhandlebitfield-use-buffer'
4345fe26b Store the number of bits of a BitField in the Buffer's metadata
da0403be7 Add metadata to Buffer object.
a84891cd3 Update ArrayHandleBitField to new array style with Buffer

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2218
2020-08-25 07:53:37 -04:00
Kenneth Moreland
4345fe26b0 Store the number of bits of a BitField in the Buffer's metadata
The number of bits in a `BitField` cannot be directly implied from the
size of the buffer (because the buffer gets padded to the nearest sized
word). Thus, the `BitField stored the number of bits in its own
internals.

Unfortunately, that caused issues when passing the `BitField` data
between it and an `ArrayHandleBitField`. If the `ArrayHandleBitField`
resized itself, the `BitField` would not see the new size because it
ignored the new buffer size.

To get around this problem, `BitField` now declares its own
`BufferMetaData` that stores the number of bits. Now, since the number
of bits is stored in the `Buffer` object, it is sufficient to just share
the `Buffer` to synchronize all of the state.
2020-08-24 17:09:30 -06:00
Kenneth Moreland
9941db6df5 Convert ArrayHandleSOA to use Buffer
Make `ArrayHandleSOA` use the new `ArrayHandle` style that uses `Buffer`
objects to manage and transfer data.
2020-08-24 16:03:17 -06:00
Kenneth Moreland
da0403be76 Add metadata to Buffer object.
One of the goals of the `Buffer` object is to allow sharing of data
among objects that will interpret the data differently or give a
different interface over the data. However, when sharing only the array,
important metadata can become lost.

Provide a field that can store some custom metadata in the buffer object
so that the rest of the state can follow the buffer object around.
2020-08-24 15:57:15 -06:00
Kenneth Moreland
a84891cd32 Update ArrayHandleBitField to new array style with Buffer 2020-08-24 15:57:13 -06:00
Kitware Robot
cf0cdcf7d1 clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
Robert Maynard
b48c19f251 Correct warnings found by using clang as the host compiler for cuda 2020-08-24 08:57:38 -04:00
Li-Ta Lo
ea2dad5154 extract Unite 2020-08-22 06:15:11 -06:00
Kenneth Moreland
0370029f92 Merge topic 'free-atomic-functions'
6cbcb9f5d Fix behavior of Cuda AtomicLoad with SequentiallyConsistent
7573d4ed5 Fix compiler warnings
147dd24d0 Remove ARM intrinsics in MSVC
2229c22f4 Avoid invalid Kokkos atomic calls
3b147878f Always use our implementation of Cuda atomics
9e6fe8fb6 Add memory order semantics to atomic functions
d2ac4b860 Be more careful in casting with Atomic functions
13056b3af Deprecate AtomicInterfaceControl and AtomicInterfaceExecution
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2223
2020-08-22 00:21:01 -04:00
Vicente Adolfo Bolea Sanchez
e3d7347080 IBM XL: disable unused-template pragma for xl
Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2020-08-21 15:40:05 -04:00
Li-Ta Lo
ac6fe7a295 remove unnecessary joining my friend operation 2020-08-21 07:17:13 -06:00
Li-Ta Lo
45fed319ac add more comments on data race during union 2020-08-21 07:15:43 -06:00
Kenneth Moreland
6cbcb9f5d7 Fix behavior of Cuda AtomicLoad with SequentiallyConsistent
According to Allie Vacanti, a sequentially consistent load requires a
full fence on Cuda hardware to be conforming.

Also improved the documentation of `MemoryOrder` based on Allie's
suggestion.

Also removed the `Consume` memory order based on Allie's suggestion. It
is tricky to use correctly, and most implementations just regress to the
safer `Acquired` behavior anyway.
2020-08-20 17:53:47 -06:00
Kenneth Moreland
7573d4ed57 Fix compiler warnings 2020-08-20 17:08:36 -06:00
Kenneth Moreland
147dd24d01 Remove ARM intrinsics in MSVC 2020-08-20 17:08:36 -06:00
Kenneth Moreland
2229c22f40 Avoid invalid Kokkos atomic calls 2020-08-20 17:08:21 -06:00
Li-Ta Lo
2492d7d1d1 add test case from Valentine, more comments in ImageGraft 2020-08-20 15:08:55 -06:00
Kenneth Moreland
3b147878f5 Always use our implementation of Cuda atomics
Previously, if Kokkos was enabled we always used Kokkos atomics.
However, if a user, for some reason, compiled with a version of Kokkos
that was _not_ compiled for Cuda and we turned on our own Cuda device
adapter, that would cause a problem. The old code assumed Kokkos would
create the Cuda version of the atomics, but it would not. Thus, there
would be no atomics for Cuda.

Resolved this problem by switching the order in which we try to define
atomics. Use our version of atomics whenever compiling for a Cuda
device. Otherwise, try to compile the Kokkos version (and if that is not
available, use ours as before.
2020-08-20 14:20:32 -06:00
Kenneth Moreland
9e6fe8fb66 Add memory order semantics to atomic functions
To ensure correctness of an atomic function, it is often necessary to
force a compiler to order operations correctly. However, doing so may
slow things down, so it is helpful to relax these constraints if they
are not necessary. Add the ability to select the correct memory order
constraints in the atomic functions.
2020-08-20 13:40:44 -06:00
Kenneth Moreland
d2ac4b860c Be more careful in casting with Atomic functions
Previously, the atomic functions accepted any type as its operand and
then cast that to the storage type. That could cause some rather
unexpected behavior. For example, casting a floating point number to an
integer might not give you the behavior as expected. So that behavior as
been removed and now the operand has to match the pointer.

However, all the currently supported atomics are unsigned, and there are
many reasons that it might be easier to use signed as operands. (For
example, C literals are signed.) Thus, a second condition that allows
the sign to be swapped has been added so that you don't get annoying
signed/unsigned conversion warnings.
2020-08-20 13:40:44 -06:00
Kenneth Moreland
13056b3af5 Deprecate AtomicInterfaceControl and AtomicInterfaceExecution
Now that we have the functions in `vtkm/Atomic.h`, we can deprecate (and
eventually remove) the more cumbersome classes `AtomicInterfaceControl`
and `AtomicInterfaceExecution`.

Also reversed the order of the `expected` and `desired` parameters of
`vtkm::AtomicCompareAndSwap`. I think the former order makes more sense
and matches more other implementations (such as `std::atomic` and the
GCC `__atomic` built ins). However, there are still some non-deprecated
classes with similar methods that cannot easily be switched. Thus, it's
better to be inconsistent with most other libraries and consistent with
ourself than to be inconsitent with ourself.
2020-08-20 13:40:44 -06:00
Kenneth Moreland
82d6ca9854 Allow Kokkos atomic functions to work without cuda device compiler
If the Kokkos device is enabled, we use the Kokkos atomic functions for
implementation since Kokkos has already ported all of these to each
device.

If Kokkos is compiled with CUDA, then the functions are marked with
`__device__` and `__host__`. Makes sense right?

Unless we are trying to use the atomic functions on host code compiled
only for the host. In that case, modifiers like `__device__` will cause
compiler errors.

So we want to disable Kokkos from using `__device__`, but only if CUDA
is enabled and we are not using the CUDA compiler. Had to hack things up
to get that to work.
2020-08-20 13:40:44 -06:00
Kenneth Moreland
d3503bfaba Implement AtomicInterfaceControl/Execution with free functions
Now that we have atomic free functions (e.g. `vtkm::AtomicAdd()`), we no
longer need special implementations for control and each execution
device. (Well, technically we do have special implementations for each,
but they are handled with compiler directives in the free functions.)

Convert the old atomic interface classes (`AtomicInterfaceControl` and
`AtomicInterfaceExecution`) to use the new atomic free functions. This
will allow us to test the new atomic functions everywhere that atomics
are used in VTK-m.

Once verified, we can deprecate the old atomic interface classes.
2020-08-20 13:40:44 -06:00
Kenneth Moreland
ebbebd7369 Add atomic free functions
Previously, all atomic functions were stored in classes named
`AtomicInterfaceControl` and `AtomicInterfaceExecution`, which required
you to know at compile time which device was using the methods. That in
turn means that anything using an atomic needed to be templated on the
device it is running on.

That can be a big hassle (and is problematic for some code structure).
Instead, these methods are moved to free functions in the `vtkm`
namespace. These functions operate like those in `Math.h`. Using
compiler directives, an appropriate version of the function is compiled
for the current device the compiler is using.
2020-08-20 13:40:43 -06:00
Li-Ta Lo
83b90f9fce time to test on GPU 2020-08-20 10:49:00 -06:00
Vicente Adolfo Bolea Sanchez
afd394377e cmake: split vtkm_filter into common|extra|contour|gradient
There is a limitation in Windows builds using VS2019 where libraries cannot be
bigger than 4GiB. This is normally not an issue but in `VTKm` due to its strong
template usage libraries can reach that size.

The `VTKm` filter library is can easily reach that size and it will halt the
build

This MR tries to avoid reaching those sizes for now by splitting the filter
library into four smaller libraries.

The proposal scheme is:

It splits vtkm-filter into:

  - vtkm-common, Classes that are dependencies of other filter libs.
  - vtkm-contour, Contour class and its instantiations.
  - vtkm-contour, Gradient class and its instantiations.
  - vtkm-extra, Classes other than Contour or Gradient that are
    not dependencies.

Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2020-08-19 19:20:43 -04:00
Kenneth Moreland
a709f63e72 Merge topic 'base-device-tests'
ed41874cc Consolidate tests for base vtkm code that is device-specific

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2219
2020-08-18 18:53:04 -04:00
Kenneth Moreland
ed41874cc8 Consolidate tests for base vtkm code that is device-specific
Some of the code in the base `vtkm` namespace is device specific. For
example, the functions in `Math.h` are customized for specific devices.
Thus, we want this code to be specially compiled and run on these
devices.

Previously, we made a header file and then added separate tests to each
device package. That was created before we had ways of running on any
device. Now, it is much easier to compile the test a single time for all
devices and use the `ALL_BACKENDS` feature of `vtkm_unit_tests` CMake
function to automatically create the test for all devices.
2020-08-18 14:30:25 -06:00
dpugmire
d13a08b6ae Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into mpiStreamlines2 2020-08-18 16:06:41 -04:00
Nick Thompson
88a0cff7cb Merge topic 'refactor_integrators'
8124fe81f Add missing #include.
6ea07cc1e Missing #include.
024ab1cff Put each ODE integrator in it's own file.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Dave Pugmire <dpugmire@gmail.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !2213
2020-08-18 15:36:54 -04:00
Nick
8124fe81fd Add missing #include. 2020-08-18 15:32:39 -04:00
NAThompson
6ea07cc1e8 Missing #include. 2020-08-18 15:32:39 -04:00
Nick
024ab1cff8 Put each ODE integrator in it's own file. 2020-08-18 15:32:39 -04:00
dpugmire
6bfb91aac5 try to fix/debug the windows builds. 2020-08-18 09:38:32 -04:00
dpugmire
8b1520fdb7 address link errors in windows and gcc4.8 dashboard compile errors 2020-08-18 08:55:49 -04:00
dpugmire
5fa93a64ff fix build errors 2020-08-17 22:32:56 -04:00
dpugmire
ec796445cc Remove some print statements. 2020-08-17 16:57:09 -04:00
dpugmire
9bf49101ca Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into mpiStreamlines2 2020-08-17 16:35:40 -04:00
dpugmire
4722dc67b7 Code review cleanup. 2020-08-17 16:32:27 -04:00
dpugmire
240483ce96 make namespaces consistent. 2020-08-17 16:21:59 -04:00
dpugmire
58d8119f2a Addressing code review comments. 2020-08-17 15:33:29 -04:00
Kenneth Moreland
38a6fe22f8 Merge topic 'arraycopy-with-buffer'
8983154e9 Add DeepCopy to ArrayHandle
694ba7e92 Change ArrayCopy to deep copy Buffer objects where possible

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2212
2020-08-14 15:48:51 -04:00
Sujin Philip
0beb0f650b Merge topic 'add-kokkos-backend'
2d1b609b3 Use Ubuntu instead of rhel8 for cuda+kokkos
769248583 Make sure we use c++14 when using CUDA 11+
64efa6401 Kokkos: make sure we don't pass multiple rdc flags
b2f4c8e5e Switch -O3 to -O2 on Linux with Cuda 10
db57ed26a Fix warnings
452f61e29 Add Kokkos backend

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2164
2020-08-14 09:35:46 -04:00
Kenneth Moreland
8983154e9e Add DeepCopy to ArrayHandle
`ArrayHandle::DeepCopy` creates a new `ArrayHandle` of the same type and
deep copies the data into it.

This functionality is similar to `ArrayCopy`. However, it can be used
without having to compile for the device on which the copy happens.
2020-08-13 16:56:06 -06:00
Kenneth Moreland
694ba7e92c Change ArrayCopy to deep copy Buffer objects where possible
Now that the data in an `ArrayHandle` is stored in `Buffer` objects, we
now have a more efficient way of doing deep copies of memory. Rather
than call `Algorithm::Copy`, which iterates over the array and copies
each item, `ArrayCopy` now uses the `Buffer` interface to do direct
device-to-device (or host-to-host) mem copies. This should be more
efficent and take less time to compile.

Note that this direct `Buffer` copy only works if the two `ArrayHandle`s
are of the same type. If they are different, `ArrayCopy` still has to
fall back to using `Algorithm::Copy`.

Also note that not all `ArrayHandle`s are using the new `ArrayHandle`
interface (and therefore not using `Buffer` objects). Thus, a fallback
is still available for old `ArrayHandle` types.
2020-08-13 16:56:06 -06:00
dpugmire
68020589c3 Code cleanup for merge. 2020-08-13 17:05:22 -04:00
dpugmire
8d565bbda6 Forgot to include the CMake file from the other branch. 2020-08-13 10:27:04 -04:00
dpugmire
9d31d587b3 Add streamline/particle advection filters. 2020-08-13 10:01:52 -04:00
dpugmire
c806403e2a distributed memory support for streamline and particleadvect filters. 2020-08-13 09:53:57 -04:00
Kenneth Moreland
6dbf304000 Merge topic 'num-buffers-runtime-selectable'
72475177d Make number of buffers in an ArrayHandle runtime selectable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2206
2020-08-12 18:23:59 -04:00
Sujin Philip
db57ed26a2 Fix warnings 2020-08-12 13:55:24 -04:00
Sujin Philip
452f61e290 Add Kokkos backend 2020-08-12 13:55:24 -04:00
Robert Maynard
477d225415 Always have VTK-m tests enable vtkmdiy mpi environment 2020-08-11 17:02:19 -04:00
Kenneth Moreland
72475177d8 Make number of buffers in an ArrayHandle runtime selectable
This has no real change in the operation, but it will simplify code as
we convert `ArrayHandle`s to the new type. We will be able to write
simple runtime code rather than complex metaprogramming to determine the
number of buffers to use.
2020-08-11 13:25:06 -06:00
Kenneth Moreland
d3a6def082 Update filters that use FieldCell to use FieldFilter instead
We no longer need to use this deprecated name for a filter class.
2020-08-10 17:25:55 -06:00
Kenneth Moreland
9d91e006a9 Deprecate FilterCell
This class no longer serves any purpose (and in fact is now only a
trivial alias for FilterField). Subclasses should just use FilterField
instead.
2020-08-10 17:19:06 -06:00
Petar Hristov
7a179e6a07 Merge branch 'master' into working-branch 2020-08-07 17:28:26 +01:00
Petar Hristov
c40b98e990 Fix to read the scan inclusive output value directly. 2020-08-06 16:55:04 +01:00
Robert Maynard
f22dd9f571 Allow VTK-m Buffer to have ownership transferred 2020-08-06 10:31:57 -04:00
Petar Hristov
ce30e7c62f Refatored writePortal antipattern. 2020-08-05 19:20:24 +01:00
Robert Maynard
47843ea2e3 Update vtkm/interop to use non-deprecated make_ArrayHandle API 2020-08-03 12:15:16 -04:00
Vicente Bolea
922a570703 Merge topic 'fix-515-vtkdatasetwriter-remove-justpoints'
ab0fecda7 VTKDataSetWriter: remove just_points argument

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2185
2020-07-28 20:26:37 -04:00
Petar Hristov
332532b290 Removed unused Euler Tour header files. 2020-07-28 08:09:04 +01:00
Petar Hristov
ad497e2619 Merged with master. 2020-07-27 16:27:14 +01:00
Petar Hristov
cd43328ef7 Fixed signed conversion build warning. 2020-07-27 10:43:20 +01:00
Petar Hristov
6b82c1ab77 Fixed CUDA build errors. 2020-07-27 10:00:11 +01:00
Vicente Adolfo Bolea Sanchez
ab0fecda7f VTKDataSetWriter: remove just_points argument
Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2020-07-24 15:54:13 -04:00
Petar Hristov
ce653c78f1 Fixed contour tree example app. 2020-07-24 14:17:36 +01:00
Petar Hristov
4707e5997e Fixed code review issues. 2020-07-24 13:50:12 +01:00
Kenneth Moreland
5f541d2515 Drop log message when ignoring copy in move
For `make_ArrayHandle` and `make_Field` when it is determined that the
data can be safely moved, just silently move instead of copy instead of
printing a log message saying the copy flag will be ignored.

Also fix an issue with `make_ArrayHandle` when the data was not moved
when it could have been.
2020-07-23 17:59:50 -06:00
Kenneth Moreland
4c56797c5d Remove ArrayHandleSOA constructors with ambiguous move semantics
Also correct some constructors/functions that should be
deprecated.
2020-07-23 17:54:42 -06:00
Kenneth Moreland
0d484505e7 Fix bad gcc compiler warning about static definition (again) 2020-07-23 17:53:15 -06:00
Kenneth Moreland
2163077441 Fix errors with memory access 2020-07-23 11:02:40 -06:00
Kenneth Moreland
e23989bde1 Use data method to get pointer from std::vector
Do not use `&v.front()` to get the pointer from an `std::vector`. That
behavior is undefined when the vector is empty. Instead, use `v.data()`.
2020-07-23 11:02:40 -06:00
Kenneth Moreland
2e243cbbac Fix issue with using std::string in ArrayHandle
The recent version of ArrayHandleBasic allocates typeless arrays without
any initialization. This can cause issues with types that require a
constructor. The UnitTestVariantArrayHandle was trying to create an
ArrayHandle with an std::string, and the uninitialized strings were
causing crashes on some platforms.
2020-07-23 11:02:38 -06:00
Kenneth Moreland
46f253b927 Fix compiler issue with MSVC 2020-07-23 10:53:42 -06:00
Kenneth Moreland
d1a4aecc59 Improvements to moving data into ArrayHandle
We have made several improvements to adding data into an `ArrayHandle`.

## Moving data from an `std::vector`

For numerous reasons, it is convenient to define data in a `std::vector`
and then wrap that into an `ArrayHandle`. It is often the case that an
`std::vector` is filled and then becomes unused once it is converted to an
`ArrayHandle`. In this case, what we really want is to pass the data off to
the `ArrayHandle` so that the `ArrayHandle` is now managing the data and
not the `std::vector`.

C++11 has a mechanism to do this: move semantics. You can now pass
variables to functions as an "rvalue" (right-hand value). When something is
passed as an rvalue, it can pull state out of that variable and move it
somewhere else. `std::vector` implements this movement so that an rvalue
can be moved to another `std::vector` without actually copying the data.
`make_ArrayHandle` now also takes advantage of this feature to move rvalue
`std::vector`s.

There is a special form of `make_ArrayHandle` named `make_ArrayHandleMove`
that takes an rvalue. There is also a special overload of
`make_ArrayHandle` itself that handles an rvalue `vector`. (However, using
the explicit move version is better if you want to make sure the data is
actually moved.)

## Make `ArrayHandle` from initalizer list

A common use case for using `std::vector` (particularly in our unit tests)
is to quickly add an initalizer list into an `ArrayHandle`. Now you can
by simply passing an initializer list to `make_ArrayHandle`.

## Deprecated `make_ArrayHandle` with default shallow copy

For historical reasons, passing an `std::vector` or a pointer to
`make_ArrayHandle` does a shallow copy (i.e. `CopyFlag` defaults to `Off`).
Although more efficient, this mode is inherintly unsafe, and making it the
default is asking for trouble.

To combat this, calling `make_ArrayHandle` without a copy flag is
deprecated. In this way, if you wish to do the faster but more unsafe
creation of an `ArrayHandle` you should explicitly express that.

This requried quite a few changes through the VTK-m source (particularly in
the tests).

## Similar changes to `Field`

`vtkm::cont::Field` has a `make_Field` helper function that is similar to
`make_ArrayHandle`. It also features the ability to create fields from
`std::vector`s and C arrays. It also likewise had the same unsafe behavior
by default of not copying from the source of the arrays.

That behavior has similarly been depreciated. You now have to specify a
copy flag.

The ability to construct a `Field` from an initializer list of values has
also been added.
2020-07-23 10:53:38 -06:00
Kenneth Moreland
744edbf428 Merge topic 'gcc-static-function-warning'
b1f648bfd Remove gcc warning about static declared function

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2193
2020-07-22 15:20:45 -04:00
Li-Ta Lo
537557ef91 Merge topic 'worket_invoker_dispatcher2'
0dcc6cc16 reverse #include on CellNeighborhood
2489da125 restore comment, add needed #include
f33318247 Reverse Invoker, Dispatcher and Worklet dependency

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !2192
2020-07-22 14:20:35 -04:00
dpugmire
e60d899536 Use the ResetTypes spell to fix the ArrayCopy issue. 2020-07-22 12:03:11 -04:00
Kenneth Moreland
b1f648bfdf Remove gcc warning about static declared function
While compiling UnitTestVariantArrayHandle, some versions of gcc
(between 6 and 8, I think) gave a warning like the following:

```
../vtkm/cont/StorageVirtual.h:227:12: warning: 'vtkm::Id vtkm::cont::internal::detail::StorageVirtualImpl<T, S>::GetNumberOfValues() const [with T = std::__cxx11::basic_string<char>; S = vtkm::cont::StorageTagImplicit<{anonymous}::UnusualPortal<std::__cxx11::basic_string<char> > >]' declared 'static' but never defined [-Wunused-function]
```

This warning makes no sense because it is refering to a method that is
not declared static. (In fact, it overrides a virtual method.)

I believe this is an obscure bug in these versions of gcc. I found a
[stackoverflow post] that seems to have the same problem, but no
workaround was found.

The warning originated from code that had little effect. It was part of
a test with a custom ArrayHandle storage type that was already disabled
for other reasons. Just removed the code.

[stackoverflow post]: https://stackoverflow.com/questions/56615695/how-to-fix-declared-static-but-never-defined-on-member-function
2020-07-22 08:28:28 -06:00
dpugmire
0a4d184205 fix compile error in array copy 2020-07-22 09:59:20 -04:00
Li-Ta Lo
0dcc6cc160 reverse #include on CellNeighborhood 2020-07-21 18:49:57 -06:00
Li-Ta Lo
2489da1259 restore comment, add needed #include 2020-07-21 18:21:44 -06:00
Li-Ta Lo
f333182476 Reverse Invoker, Dispatcher and Worklet dependency 2020-07-21 17:25:43 -06:00
dpugmire
246be1b7f0 Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into generalizeField 2020-07-21 15:03:08 -04:00
dpugmire
415e2a5ac8 Fix to deal with float data when double enabled. 2020-07-21 15:00:47 -04:00
Li-Ta Lo
567b1fedd2 Merge topic 'cell_neighbor'
9cd70a7dc Install WorkletNeighborhood.h
f66c782b1 Extract WorkletNeighborhood base class
760c51ed6 install ThreadIndicesNeighborhood.h
e52b8fa88 Add CellNeighborhood

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !2181
2020-07-21 13:45:40 -04:00
dpugmire
5ad32f4860 enable reading data files. 2020-07-21 11:23:58 -04:00
Li-Ta Lo
9cd70a7dc5 Install WorkletNeighborhood.h 2020-07-21 08:48:49 -06:00
dpugmire
31c97bed89 Generalize fields for particle advection 2020-07-20 21:15:46 -04:00
Li-Ta Lo
f66c782b14 Extract WorkletNeighborhood base class 2020-07-20 17:50:14 -06:00
Kenneth Moreland
502c310cf8 Merge topic 'deprecate-arrayhandlevirtualcoordinates'
c689a68c5 Suppress bad deprecation warnings in MSVC
a3f23a03b Do not cast to ArrayHandleVirtual in VariantArrayHandle::CastAndCall
f6b13df51 Support coordinates of both float32 and float64
453e31404 Deprecate ArrayHandleVirtualCoordinates
be7f06bbe CoordinateSystem data is VariantArrayHandle

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2177
2020-07-16 17:25:43 -04:00
Li-Ta Lo
760c51ed62 install ThreadIndicesNeighborhood.h 2020-07-16 08:06:17 -06:00
Li-Ta Lo
e52b8fa88a Add CellNeighborhood 2020-07-15 14:41:32 -06:00
Sujin Philip
c35323ae42 Merge branch 'upstream-diy' into update-to-latest-diy
* upstream-diy:
  diy 2020-07-15 (4ea1241e)
2020-07-15 15:36:03 -05:00
Sujin Philip
78221a09ed Update diy tag name 2020-07-15 15:35:48 -05:00
Kenneth Moreland
c689a68c5c Suppress bad deprecation warnings in MSVC
The Microsoft compiler has this annoying and stupid behavior where if
you have a generic templated method/function and that method is
instantiated with a deprecated class, then the compiler will issue a
C4996 warning even if the calling code is suppressing that warning
(because, for example, you are implementing other deprecated code and
the use is correct). There is no way around this other than suppressing
the warnings for all uses of the templated method.
2020-07-14 16:25:04 -06:00
Kenneth Moreland
ea340ed9cb Fix UnitTestArrayPortalValueReference
A recent change to the continuous integration setup has caused
`UnitTestArrayPortalValueReference` to fail on one platform.

The problem was that the test was doing two unsafe things with the
right-shift assignment operator. The first unsafe thing was using itself
as the operand.

```cpp
  ref >>= ref;
```

This causes clang to give a "self assign overload" warning. Using a
variable as its own operand for a compute assign operation isn't great
style, but for some operations it can cause weird errors. The reason for
the warning is that for a true integer shift operation, the compiler
will recognize that the result should be 0. So, when using this on base
integer types, you will get 0. But overloads can give you something
different, so that might lead to unexpected results. Because we _are_
using an overload (for the `ArrayPortalValueReference` class), the
compiler tells us we can get potentially unexpected results.

OK. That seems like something we can safely ignore (and were ignoring
for some time). After all, the whole point of the
`ArrayPortalValueReference` operators is to behave exactly the same as
the values they wrap. That brings us to the second unsafe thing the test
was doing: using an invalid value as the right hand operation. And this
is where things get weird.

The test was specifically failing when being run on `Int32`. It was
setting the underlying value for `ref` to be `1000` to start with. So
the expression `ref >>= ref` was trying to right shift `ref` by 1000
bits. Logically, this should of course give you 0. However, shifting a
number by more bits than exist causes undefined behavior (c.f.
https://wiki.sei.cmu.edu/confluence/display/c/INT34-C.+Do+not+shift+an+expression+by+a+negative+number+of+bits+or+by+greater+than+or+equal+to+the+number+of+bits+that+exist+in+the+operand).
You might not get back the expected value, and this is exactly what was
happening.

What I think happened was that the compiler determined that any valid
shift would be contained in 5 bits, so it truncated the value (1000) to
the least signifcant 5 bits (which happens to be 8). It then shifted
1000 by 8 and got the value 3 instead of 0.

The fix picks an operand number that is sure to be valid.
2020-07-14 16:13:12 -06:00
Kenneth Moreland
a3f23a03b6 Do not cast to ArrayHandleVirtual in VariantArrayHandle::CastAndCall
We are moving to deprecate `ArrayHandleVirtual`, so we are removing the
feature where `VariantArrayHandle::CastAndCall` automatically casts to
an `ArrayHandleVirtual` if possible.

The big reason to make this change now (as opposed to later when
`ArrayHandleVirtual` is deprecated) is to improve compile times.
This prevents us from having to compile an extra code path using
`ArrayHandleVirtual`.
2020-07-14 08:53:03 -06:00
Kenneth Moreland
f6b13df513 Support coordinates of both float32 and float64
Previously there were issues if the coordinate system was using floating
point values that were not FloatDefault. This remedies that issue.
2020-07-14 08:53:01 -06:00
Kenneth Moreland
453e314044 Deprecate ArrayHandleVirtualCoordinates
We are in the process of deprecating virtual classes in VTK-m
(that run in the execution environment).
2020-07-14 08:51:47 -06:00
Kenneth Moreland
be7f06bbe7 CoordinateSystem data is VariantArrayHandle
`CoordinateSystem` differed from `Field` in that its `GetData`
method returned an `ArrayHandleVirtualCoordinates` instead of
a `VariantArrayHandle`. This is probably confusing since
`CoordianteSystem` inherits `Field` and has a pretty dramatic
difference in this behavior.

In preparation to deprecate `ArrayHandleVirtualCoordinates`, this
changes `CoordiantSystem` to be much more like `Field`. (In the
future, we may change the `CoordinateSystem` to point to a `Field`
rather than be a special `Field`.)

A method named `GetDataAsMultiplexer` has been added to
`CoordinateSystem`. This method allows you to get data from
`CoordinateSystem` as a single array type without worrying
about creating functors to handle different types and without
needing virtual methods.
2020-07-14 08:50:39 -06:00
Dave Pugmire
e66986dabe Merge topic 'worldAnnotationsOptional'
cabaf3e26 Add option to enable/disable world annotations.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Matt Larsen <larsen30@llnl.gov>
Merge-request: !2175
2020-07-14 10:19:48 -04:00
Petar Hristov
15cbf41dfb Merge branch 'master' into working-branch 2020-07-14 15:09:26 +01:00
Petar Hristov
97b6e727f3 Fixing osx build warnings. 2020-07-14 14:00:02 +01:00
Robert Maynard
29bac212c7 Merge topic 'extrude-fix'
a428d75e0 adding CellSetExtrude to DefaultTypesVTK
235d9ce14 add GetThreadIndex to ThreadIndicesExtrude classes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2172
2020-07-13 14:24:58 -04:00
dpugmire
cabaf3e269 Add option to enable/disable world annotations. 2020-07-09 14:38:39 -04:00
Sujin Philip
b32cc894b6 Merge topic 'fix-gitlab-ci'
2f7ae83c9 Fix warnings
e67fc619c Fix setting build type in gitlab ci

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2171
2020-07-09 14:38:32 -04:00
Kenneth Moreland
e2027da0c3 Merge topic 'write-uniform-rectilinear'
058927c82 Write uniform and rectilinear grids to legacy VTK files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Sujin Philip <sujin.philip@kitware.com>
Merge-request: !2173
2020-07-09 10:53:20 -04:00
Sujin Philip
2f7ae83c9f Fix warnings 2020-07-09 08:10:54 -05:00
Kenneth Moreland
85bdc030ba Merge topic 'fix-multiplexer-cuda'
18b5be92d Fix issue with CUDA and ArrayHandleMultiplexer

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2168
2020-07-09 08:25:55 -04:00
Petar Hristov
c6433140da Removed unused worklet. 2020-07-09 12:45:59 +01:00
Petar Hristov
98d0d69947 Removed unused library. 2020-07-09 10:49:51 +01:00
Petar Hristov
8fc73ebd23 Removed uint variables. 2020-07-09 10:20:37 +01:00
Kenneth Moreland
058927c82f Write uniform and rectilinear grids to legacy VTK files
As a programming convenience, all `vtkm::cont::DataSet` written by
`vtkm::io::VTKDataSetWriter` were written as a structured grid. Although
technically correct, it changed the structure of the data. This meant that
if you wanted to capture data to run elsewhere, it would run as a different
data type. This was particularly frustrating if the data of that structure
was causing problems and you wanted to debug it.

Now, `VTKDataSetWriter` checks the type of the `CoordinateSystem` to
determine whether the data should be written out as `STRUCTURED_POINTS`
(i.e. a uniform grid), `RECTILINEAR_GRID`, or `STRUCTURED_GRID`
(curvilinear).
2020-07-08 19:12:14 -06:00
Caitlin Ross
a428d75e02 adding CellSetExtrude to DefaultTypesVTK 2020-07-08 14:51:41 -04:00
Caitlin Ross
235d9ce14b add GetThreadIndex to ThreadIndicesExtrude classes 2020-07-08 14:51:41 -04:00
Kenneth Moreland
d5fd24fe13 Merge topic 'fix-allocate-token-deadlock'
cbf986891 Fix potential deadlock in ArrayHandle::PrepareForOutput

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2170
2020-07-08 13:47:04 -04:00
Petar Hritov
c20608288c Removed unused worklet. 2020-07-08 14:26:25 +01:00
Kenneth Moreland
cbf9868915 Fix potential deadlock in ArrayHandle::PrepareForOutput
`ArrayHandle::PrepareForOutput` often has to reallocate the array to the
specified size. Previously, this allocation was not happening with the
`Token` that is passed to `PrepareForOutput`. If the `ArrayHandle` is
already attached or enqueued for that `Token`, then the allocation would
deadlock.

You can now pass a `Token` object to `Allocate`, which is what
`PrepareForOutput` does.
2020-07-07 18:30:38 -06:00
Kenneth Moreland
18b5be92d6 Fix issue with CUDA and ArrayHandleMultiplexer
When you try to call the `Reduce` operation in the CUDA device adapter
with a sufficently complex interator type, you get a compile error
that says `error: cannot pass an argument with a user-provided
copy-constructor to a device-side kernel launch`.

This appears to be a bug in either nvcc or Thrust. I believe it is
related to the following reported issues:

* https://github.com/thrust/thrust/issues/928
* https://github.com/thrust/thrust/issues/1044

Work around this problem by making a special condition for calling
`Reduce` with an `ArrayHandleMultiplexer` that calls the generic
algorithm in `DeviceAdapterAlgorithmGeneral` instead of the algorithm in
Thrust.
2020-07-06 13:51:36 -06:00
Sujin Philip
8c3c138bb9 Enable the Game of Life example back
It was commented out by accident in a previous commit.
2020-07-06 12:25:42 -05:00
Petar Hritov
9e8784a780 Refactoring. 2020-07-03 18:28:21 +01:00
Petar Hritov
edd2585752 Merge branch 'master' into working-branch 2020-07-03 13:55:21 +01:00
Petar Hritov
cdc0fa9e42 Added some additional comments. 2020-07-03 13:53:49 +01:00
Petar Hritov
1ed02d151f Working volume parallel BD version. 2020-07-03 11:40:47 +01:00
Robert Maynard
749a110cd0 Merge branch 'upstream-diy' into update_diy_to_always_build_with_pic
* upstream-diy:
  diy 2020-07-01 (b0623438)
2020-07-01 10:48:43 -04:00
Robert Maynard
5a2a26d3fc Update DIY to make sure we always build diy libs with pic enabled 2020-07-01 10:48:18 -04:00
Robert Maynard
a1680ef8bf Merge branch 'upstream-diy' into update_diy_to_namespace_DEBUG_define
* upstream-diy:
  diy 2020-06-24 (ab765e66)
2020-07-01 08:28:17 -04:00
Robert Maynard
f7b3d1bca7 Update DIY to not leak the DEBUG define
Fixes #539
2020-07-01 08:28:10 -04:00
Kenneth Moreland
42219f8d61 Fix buffer leak in BufferInfo 2020-06-29 16:36:21 -06:00
Kenneth Moreland
8e1c87b5c2 Work around known bug in LagrangianFilter
The implementation of LagrangianFilter uses some `ArrayHandle`s
declared as `static` in the .hxx header file. One of the bad
consequences of this is that there is no control over when the
arrays are freed. We have seen where these arrays get freed
after the CUDA system is closed, which causes nasty things to
happen as the program closes.

This works around the problem until a fix is implemnted.
2020-06-25 14:02:46 -06:00
Kenneth Moreland
a47fd42bc1 Pin user provided memory in ArrayHandle
Often when a user gives memory to an `ArrayHandle`, she wants data to be
written into the memory given to be used elsewhere. Previously, the
`Buffer` objects would delete the given buffer as soon as a write buffer
was created elsewhere. That was a problem if a user wants VTK-m to write
results right into a given buffer.

Instead, when a user provides memory, "pin" that memory so that the
`ArrayHandle` never deletes it.
2020-06-25 14:02:46 -06:00
Kenneth Moreland
56bec1dd7b Replace basic ArrayHandle implementation to use Buffers
This encapsulates a lot of the required memory management into the
Buffer object and related code.

Many now unneeded classes were deleted.
2020-06-25 14:02:26 -06:00
Kenneth Moreland
8f7b0d18be Add Buffer class
The buffer class encapsulates the movement of raw C arrays between
host and devices.

The `Buffer` class itself is not associated with any device. Instead,
`Buffer` is used in conjunction with a new templated class named
`DeviceAdapterMemoryManager` that can allocate data on a given
device and transfer data as necessary. `DeviceAdapterMemoryManager`
will eventually replace the more complicated device adapter classes
that manage data on a device.

The code in `DeviceAdapterMemoryManager` is actually enclosed in
virtual methods. This allows us to limit the number of classes that
need to be compiled for a device. Rather, the implementation of
`DeviceAdapterMemoryManager` is compiled once with whatever compiler
is necessary, and then the `RuntimeDeviceInformation` is used to
get the correct object instance.
2020-06-25 14:01:39 -06:00
Li-Ta Lo
365b1bb25c use make_ArrayHandleZip 2020-06-25 09:51:06 -06:00
Li-Ta Lo
980c4864ac Merge branch 'master' into standard_normal 2020-06-24 14:38:50 -06:00
Li-Ta Lo
beba90b6f7 Merge topic 'uniform_real'
143e3d39a remove unused type alias
01a448663 Merge branch 'master' into uniform_real
c67e5bb12 fixe warnings about implicit type conversion
1e4294392 Add deterministic seed to avoid potential spurious failure
5b0e309b9 the random source is still 64 bits
cc3061bab Avoid calling ReadPortal() all the time
9bf6dea22 remove inline initialization of seed
e69308047 Add statistics base testing, add Flot32 RNG

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2148
2020-06-24 16:36:36 -04:00
Nick
470058c328 Unfoobar the float_distance MR. 2020-06-24 10:52:59 -04:00
Kenneth Moreland
f6a8993469 Make tests that throw an STL exception fail
If a test throws any unexpected exception, the test is supposed to
detect that and fail. For the STL exceptions, the test failed to return
an error code. Fix that.
2020-06-23 16:25:09 -06:00