Commit Graph

7465 Commits

Author SHA1 Message Date
Kenneth Moreland
b2b075f047 Consolidate UnitTestDataSet*
Previously, each device adapter implementation had their own version of
these tests by including a common header. Simplify this by making a
single test in UnitTests_vtkm_cont_testing for each, which can now be
compiled for and tested on a device.
2022-07-13 12:09:24 -06:00
Kenneth Moreland
f48789f57c Consolidate UnitTestComputeRange
Previously, each device adapter implementation had their own version of
this test by including a common header. Simplify this by making a single
test in UnitTests_vtkm_cont_testing, which can now be compiled for and
tested on a device.

Also re-enabled the testing of ranges for Vecs of size 9, which is now
supported.
2022-07-13 12:07:10 -06:00
Kenneth Moreland
bda676e7d9 Consolidate UnitTestColorTable
Previously, each device adapter implementation had their own version of
this test by including a common header. Simplify this by making a single
test in UnitTests_vtkm_cont_testing, which can now be compiled for and
tested on a device.
2022-07-13 12:05:39 -06:00
Kenneth Moreland
12c1a80212 Consolidate UnitTestCellLocator*
Previously, each device adapter implementation had their own version of
these tests by including a common header. Simplify this by making a
single test in UnitTests_vtkm_cont_testing for each, which can now be
compiled for and tested on a device.
2022-07-13 12:03:25 -06:00
Kenneth Moreland
891cfcfa86 Consolidate UnitTestBitField
Previously, each device adapter implementation had their own version of
this test by including a common header. Simplify this by making a single
test in UnitTests_vtkm_cont_testing, which can now be compiled for and
tested on a device.
2022-07-13 11:59:27 -06:00
Kenneth Moreland
05bf2e4518 Remove TestingFancyArrayHandles.h
This header file contained tests for a bunch of fancy array handles so
that they could be compiled for each device. These tests were bunched
together because they were replicated for each device implementation,
which was a hassle. However, having a bunch of tests crammed together is
problematic for a number of reasons.

The new testing no longer has a need to make a separate test for each
device. Thus, the tests for the individual devices are removed, and the
tests are split up and added to the basic vtkm_cont tests. In some
cases, individual tests already existed there as well (probably because
the developer did not see the test).
2022-07-13 11:52:11 -06:00
Kenneth Moreland
3a03c38ebf Consoidate UnitTestArrayHandleMultiplexer
Previously, each device adapter implementation had their own version of
this test by including a common header. Simplify this by making a single
test in UnitTests_vtkm_cont_testing, which can now be compiled for and
tested on a device.
2022-07-13 11:52:04 -06:00
Kenneth Moreland
2a0e92c63e Consolidate UnitTestArrayHandle
Previously, each device adapter implementation had their own version of
this test by including a common header. Simplify this by making a single
test in UnitTests_vtkm_cont_testing, which can now be compiled for and
tested on a device.
2022-07-13 11:49:26 -06:00
Manish Mathai
b4e6370e9e Merge topic 'mapper-connectivity-scalar-range'
6eada2d55 Update MapperConnectivity to honor scalar field range

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Roxana Bujack <bujack@lanl.gov>
Merge-request: !2791
2022-07-12 19:03:04 -04:00
Gunther Weber
e66b1d4f63 Merge topic 'update-contour-tree-includes'
1a05c3579 Added missing iomanip include
4feba2f5d Update includes for distributed contour tree app to filter refactor

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2813
2022-07-12 16:21:32 -04:00
Kenneth Moreland
c7053f584c Merge topic 'deallocate-after-finalize'
9855db096 Add test for array and datas that are cleaned up after finalize

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Sujin Philip <sujin.philip@kitware.com>
Merge-request: !2801
2022-07-12 14:33:30 -04:00
Kenneth Moreland
961ba26306 Merge topic 'intermittent-timer-failures'
ef58bd9c4 Fix intermittent UnitTestTimer failures with CUDA

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Vicente Bolea <vicente.bolea@kitware.com>
Merge-request: !2817
2022-07-12 12:35:17 -04:00
Kenneth Moreland
5659d74bd4 Merge topic 'resizable-arrayhandle-buffer-vec'
05f144eb1 Allow ArrayHandle to have a runtime selectable number of buffers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2798
2022-07-12 12:04:24 -04:00
Kenneth Moreland
ef58bd9c4a Fix intermittent UnitTestTimer failures with CUDA
We have been noticing occasional failures of UnitTestTimer on the
dashboard for CUDA devices. The timer seems to be recording less time
than is actually elapsed.

The problem might be that the CUDA timer actually inserts fences to the
CUDA stream rather than record the current time. Thus, the actual time
might start after some pending operations complete.

To attempt to match the UnitTestTimer measurements closer to wall-clock
time, add a synchronize before starting the timer.
2022-07-12 08:52:12 -06:00
Vicente Bolea
3ae5511211 Merge topic 'add-macos-build'
e26455076 CI: adds gitlab macos_xcode13 build
464524a4b Worklet: remove unused var in WaveletDWT
c661e4afb CI: refactor cmake.sh file
5c5ec868d CI: updates cmake sha256sum for macOS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2810
2022-07-11 14:57:55 -04:00
Gunther Weber
9352374039 Merge topic 'fix-gcc-compuile-error-on-mac'
af65a4e63 Fix compile error when using GCC on macOS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2722
2022-07-11 12:42:26 -04:00
Kenneth Moreland
ad8657a670 Merge topic 'realloc-moved-vector'
f598656d5 Enable reallocation of ArrayHandleBasic with moved std::vector

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Li-Ta Lo <ollie@lanl.gov>
Merge-request: !2811
2022-07-11 11:28:54 -04:00
Kenneth Moreland
05f144eb19 Allow ArrayHandle to have a runtime selectable number of buffers
Previously, the number of buffers held by an `ArrayHandle` had to be
determined statically at compile time by the storage. Most of the time
this is fine. However, there are some exceptions where the number of
buffers need to be selected at runtime. For example, the
`ArrayHandleRecombineVec` does not specify the number of components it
uses, and it needed a hack where it stored buffers in the metadata of
another buffer, which is bad.

This change allows the number of buffers to vary at runtime (at least at
construction). The buffers were already managed in a `std::vector`. It
now no longer forces the vector to be a specific size.
`GetNumberOfBuffers` was removed from the `Storage`. Instead, if the
number of buffers was not specified at construction, an allocation of
size 0 is done to create default buffers.

The biggest change is to the interface of the storage object methods,
which now take `std::vector` instead of pointers to `Buffer` objects.
This adds a little hastle in having to copy subsets of this `vector`
when a storage object has multiple sub-arrays. But it does simplify some
of the templating.
2022-07-11 07:48:25 -06:00
Vicente Adolfo Bolea Sanchez
464524a4b2 Worklet: remove unused var in WaveletDWT 2022-07-09 13:29:26 -04:00
Gunther H. Weber
1a05c35798 Added missing iomanip include 2022-07-08 15:36:59 -07:00
Kenneth Moreland
f598656d53 Enable reallocation of ArrayHandleBasic with moved std::vector
It is possible to create an `ArrayHandleBasic` from a `std::vector`. It
is possible to move the `vector` into the `ArrayHandle` such that the
`ArrayHandle` takes over the memory. When you do this, the `ArrayHandle`
should be able to resize the data if necessary. However, this was not
working.

There were actually 3 problems that were colluding to lead to this
incorrect behavior.

1. The `Buffer` object was not allowing the reallocation of pinned data.
Pinned data means that the `Buffer`'s memory is pointing to some user
data that should stay where it is. Instead, the `Buffer` should attempt
to reallocate the pinned data using its registered realloc method. This
registered realloc method should be the think to throw the exception if
reallocation is not supported. (Technically, the memory doesn't really
need to be pinned since the data is moved and the user no longer has
direct access to it. But for implementation reasons, moved `vector` data
is pinned.)

2. The `InvalidRealloc` function was not properly throwing an exception.
This was not noticed since `Buffer` was inappropriately throwing an
exception for it.

3. The reallocation method `StdVectorReallocater` had a bad assert that
crashed the program during reallocation.
2022-07-08 11:49:16 -06:00
Kenneth Moreland
9e8e2c140c Fix problem with imprecise float comparison 2022-07-08 10:31:37 -04:00
Kenneth Moreland
80f15aa8de Fix dispatcher invoke error test for asychronous schedules 2022-07-08 06:57:43 -06:00
Kenneth Moreland
b504597a99 Fix warnings about unreachable statements 2022-07-08 06:35:13 -06:00
Kenneth Moreland
567b626080 Remove warnins about unused functions
nvcc is giving me lots of annoying warnings about unused functions.
Typically, this warning is given when a function declared as static or
in an anonymous namespace is never used. The "functions" in question are
not really functions. They are templated methods (in a class in an
anonymous namespace).

Specificaly, I'm getting errors like this:

```
/.../vtkm/cont/testing/UnitTestArrayHandleDecorator.cxx(96): warning #177-D: function "<unnamed>::DecoratorTests::InvertibleDecorImpl::CreateFunctor(PortalTs&&...) const [with PortalTs=<vtkm::cont::internal::decor::GetWritePortalType<vtkm::cont::ArrayHandleCounting<signed char>>, vtkm::cont::internal::decor::GetWritePortalType<vtkm::cont::ArrayHandleConstant<signed char>>, vtkm::cont::internal::decor::GetWritePortalType<vtkm::cont::ArrayHandle<vtkm::Int8, vtkm::cont::StorageTagBasic>>>]" was declared but never referenced
```

That said, these warnings appear to be an annoying but harmless bug in
nvcc. This warning is in error because

1. The method in question is _definitely_ being used.
2. I'm pretty sure this warning should not be given for a templated
method even if it was never used. SFINAE alone should be enough
justification to allow this to exist without warning.

The easiest way around the spurious error is to declare these structures
in a namespace with a name.
2022-07-08 06:28:51 -06:00
Kenneth Moreland
163d591795 Add DEVICE_SOURCES to vtkm_unit_tests
The `vtkm_unit_tests` function in the CMake build now allows you to specify
which files need to be compiled with a device compiler using the
`DEVICE_SOURCES` argument. Previously, the only way to specify that unit
tests needed to be compiled with a device compiler was to use the
`ALL_BACKENDS` argument, which would automatically compile everything with
the device compiler as well as test the code on all backends.
`ALL_BACKENDS` is still supported, but it no longer changes the sources to
be compiled with the device compiler.
2022-07-08 06:28:51 -06:00
Kenneth Moreland
56fa8688f1 Check results of Algorithm tests
The `UnitTestAlgorithm` test was running several device algorithms, but
it was not checking the results of any of them. (In fact, it was not
even setting values in the input arrays.) So, it verified that the
execution did not crash, but did not verify correctness.

Add checks to the results to make sure this executed correctly. (Part of
the reason for this change was a warning that popped up because a result
value was never used.)
2022-07-07 15:21:25 -06:00
Kenneth Moreland
b2ce30e690 Fix bug with voxels in legacy vtk files
The legacy VTK file reader for unstructured grids had a bug when reading
cells of type voxel. VTK-m does not support the voxel cell type in
unstructured grids (i.e. explicit cell sets), so it has to convert them to
hexahedron cells. A bug in the reader was mangling the cell array index
during this conversion.
2022-07-06 09:37:29 -06:00
Kenneth Moreland
9855db0961 Add test for array and datas that are cleaned up after finalize
It is the case that arrays might be deallocated from a device after the
device is closed. This can happen, for example, when an `ArrayHandle` is
declared globally. It gets constructed before VTK-m is initialized. This
is OK as long as you do not otherwise use it until VTK-m is initialized.
However, if you use that `ArrayHandle` to move data to a device and that
data is left on the device when the object closes, then the
`ArrayHandle` will be left holding a reference to invalid device memory
once the device is shut down. This can cause problems when the
`ArrayHandle` destructs itself and attempts to release this memory.

The VTK-m devices should gracefully handle deallocations that happen
after device shutdown.
2022-07-01 12:36:55 -06:00
Li-Ta Lo
a513a0458f Merge topic 'process_cell_field_cleanup'
533c0548d remove more unused ProcessCellField and ProcessPointField
9269a3a3d removed unused ProcessCellField

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2799
2022-06-30 17:18:58 -04:00
Li-Ta Lo
2c328844c6 Merge topic 'contour_tree_refactor3'
48da3a460 blame auto-complete
0ce48aaae restore damage CLion did to #include
709c2974e restore default parameters for deprecated constructor
62e2c3a89 move deprecated constructor to deprecated class
81ce881b0 add newline
d1cede4d2 migrated ContourTreeUniformDistributed filter

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2795
2022-06-30 12:49:05 -04:00
Li-Ta Lo
48da3a460e blame auto-complete 2022-06-30 10:03:27 -06:00
Li-Ta Lo
533c0548da remove more unused ProcessCellField and ProcessPointField 2022-06-30 09:57:37 -06:00
Li-Ta Lo
0ce48aaaed restore damage CLion did to #include 2022-06-30 09:31:20 -06:00
Li-Ta Lo
9269a3a3d4 removed unused ProcessCellField 2022-06-30 09:27:09 -06:00
Kenneth Moreland
5488a08987 Merge topic 'copy-invalid-variant'
5e476d703 Enable copying invalid variants

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Li-Ta Lo <ollie@lanl.gov>
Merge-request: !2794
2022-06-30 10:43:41 -04:00
Li-Ta Lo
709c2974ed restore default parameters for deprecated constructor 2022-06-30 08:00:02 -06:00
Kenneth Moreland
e312c54356 Fix type comparison on OSX
`UnknownArrayHandle` compares `std::type_index` objects to check whether a
requested type is the same as that held in the array handle. However, it is
possible that different translation units can create different but
equivalent `std::type_info`/`std::type_index` objects. In this case, the
`==` operator might return false for two equivalent types. This can happen
on OSX.

To get around this problem, `UnknownArrayHandle` now does a more extensive
check for `std::type_info` object. It first uses the `==` operator to
compare them (as before), which usually works but can possibly return
`false` when the correct result is `true`. To check for this case, it then
compares the name for the two types and returns `true` iff the two names
are the same.
2022-06-30 07:37:27 -06:00
Li-Ta Lo
62e2c3a898 move deprecated constructor to deprecated class 2022-06-30 07:33:40 -06:00
Kenneth Moreland
5e476d7030 Enable copying invalid variants
There was a bug where if you attempted to copy a variant that was not
valid (i.e. did not hold an object), a seg fault could happen. This has
been changed to set the target variant to also be invalid.
2022-06-30 06:24:03 -06:00
Li-Ta Lo
81ce881b0a add newline 2022-06-29 15:01:20 -06:00
Li-Ta Lo
d1cede4d2b migrated ContourTreeUniformDistributed filter 2022-06-29 14:58:10 -06:00
Li-Ta Lo
22ee3c3fa5 Merge topic 'contour_tree_refactor2'
62ac60929 restore ContourTreeAugmented worklet unit test
62e8c1831 fixed CMakeLists.txt identation
4ea27a6c6 add installation of header files
7c8dbcde2 migrated ContourTreeAugmented filter

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2793
2022-06-29 14:00:32 -04:00
Li-Ta Lo
62ac60929a restore ContourTreeAugmented worklet unit test 2022-06-29 10:10:19 -06:00
Li-Ta Lo
62e8c18310 fixed CMakeLists.txt identation 2022-06-28 14:53:44 -06:00
Li-Ta Lo
4ea27a6c61 add installation of header files 2022-06-28 07:10:19 -06:00
Li-Ta Lo
7c8dbcde28 migrated ContourTreeAugmented filter 2022-06-27 18:01:42 -06:00
Kenneth Moreland
7f96fce773 Move MeshQualityAspectGamma to its own filter
All the mesh quality metrics are now in their own filter. Remove the
worklet that attempted to do all of them and clean up the uber
MeshQuality filter to only be using the specific filters.
2022-06-23 07:53:42 -06:00
Kenneth Moreland
c3fcc94643 Move MeshQualityAspectRatio to its own filter 2022-06-23 07:53:42 -06:00
Kenneth Moreland
5288afa5dc Move MeshQualityCondition to its own filter 2022-06-23 07:53:42 -06:00