Commit Graph

1165 Commits

Author SHA1 Message Date
Kenneth Moreland
ea560e9486 Remove deprecated virtual methods
Several revisions ago, the ability to use virtual methods in the
execution environment was deprecated. Completely remove this
functionality for the VTK-m 2.0 release.
2022-10-28 10:56:52 -06:00
Kenneth Moreland
ad1e7b5bdb Add module mechanism
This mechanism sets up CMake variables that allow a user to select which
modules/libraries to create. Dependencies will be tracked down to ensure
that all of a module's dependencies are also enabled.

The modules are also arranged into groups.
Groups allow you to set the enable flag for a group of modules at once.
Thus, if you have several modules that are likely to be used together,
you can create a group for them.

This can be handy in converting user-friendly CMake options (such as
`VTKm_ENABLE_RENDERING`) to the modules that enable that by pointing to
the appropriate group.
2022-10-26 12:51:05 -06:00
Vicente Bolea
0fb0cb5e9f Merge topic 'oclf-in-every-mr'
d60c370d1 CI: Enable Ascent builds in MR
e4d23a4ae CI: remove unused variable warnings

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2858
2022-10-25 16:57:08 -04:00
Vicente Adolfo Bolea Sanchez
e4d23a4ae6 CI: remove unused variable warnings 2022-10-25 15:40:48 -04:00
Kenneth Moreland
6f84d938aa AddHelp option to Initialize should add --help argument
When you used the `AddHelp` option to `Initialize`, it added a
`--vtkm-help` option and `-h`, but not `--help`, which was weird. It
also avoided adding `--vtkm-help` when `AddHelp` was not used, but did
print out a usage statement under other circumstances.

This changes the behavior to add `--vtkm-help`, `--help`, and `-h` when
`AddHelp` is on and only `--vtkm-help` when it is off.
2022-10-24 14:38:37 -06:00
Dave Pugmire
0fb721207f Kick the dashboard builds. 2022-08-30 16:24:01 -04:00
Dave Pugmire
98994026bb Change GetPartitionField to GetFieldFromPartition. 2022-08-29 14:57:36 -04:00
Dave Pugmire
f69e598225 Change of Field::Association names. 2022-08-29 06:40:42 -04:00
Dave Pugmire
fa401ba016 Copy PDS fields in filter. Add more tests. 2022-08-25 09:28:35 -04:00
Dave Pugmire
714e1226ce Create FieldCollection class. 2022-08-22 15:02:03 -04:00
Dave Pugmire
cbdb797f1e Add fields to vtkm::cont::PartitionedDataSet 2022-08-22 08:43:15 -04:00
Dave Pugmire
2a577476dd Add function to reduce code in tests. 2022-08-10 11:57:18 -04:00
Dave Pugmire
09a8ac4feb Call ReadPortal() after each invoke. 2022-08-10 07:44:27 -04:00
Dave Pugmire
699d84681a Fixes kokkos builds. Need to call ReadPortal(). 2022-08-10 07:40:53 -04:00
Dave Pugmire
18260c7681 debugging the dashboards... 2022-08-09 13:40:47 -04:00
Dave Pugmire
aaf4be942e debug dashboards..... 2022-08-09 09:29:43 -04:00
Dave Pugmire
67f83b230b Dashboard debugging.... 2022-08-09 09:15:45 -04:00
Dave Pugmire
2540e52f49 Address suggestion to test uninitialized values. Dashboard debug. 2022-08-08 21:26:55 -04:00
Dave Pugmire
f6326f19c0 Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into cellLocator_lastCell 2022-08-05 16:05:37 -04:00
Kenneth Moreland
5d78780f6e Define LastCell type in cell locator structure
Rather than try to collect all `LastCell` types inside of a single
header and make an uber type, have each cell locator define its own cell
locator type and use that.
2022-08-05 12:43:50 -06:00
Dave Pugmire
3e794d16bc Allocate lastCell structures first. 2022-08-05 09:49:53 -04:00
Dave Pugmire
6a200c62d9 Cuda fixes: device in headers.. 2022-07-29 13:39:38 -04:00
Kenneth Moreland
d967205817 Consolidate UnitTestVirtualObjectHandle
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 13:27:38 -06:00
Kenneth Moreland
896065044a Consolidate UnitTestPointLocatorSparseGrid
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 13:27:38 -06:00
Kenneth Moreland
d569bbca40 Consolidate UnitTestImplicitFunction
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 13:27:17 -06:00
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
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
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
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
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
Gunther H. Weber
c347977119 Use test_equal_ArrayHandles instead of own test function 2022-06-08 15:28:09 -07:00
Gunther H. Weber
bfb19f14ab Start adding unit tests for vtkm::cont::Algorithm::Transform 2022-06-08 14:53:47 -07:00
Gunther H. Weber
d6a7348172 Add unit test for serializing an empty ArrayHandle and fix test failure
Fix: Always serialize the size of the Buffer in vtkm/cont/internal/Buffer.cxx
but only serialize its contents, if the size differs from zero.
2022-06-06 19:52:13 -07:00
Kenneth Moreland
43fe2c5ce5 Merge topic 'unknownarrayhandle-all-types'
9ea11440e Do not require `VecTraits` for `UnknownArrayHandle` components

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Dave Pugmire <dpugmire@gmail.com>
Merge-request: !2778
2022-05-25 08:30:24 -04:00
Kenneth Moreland
7749b86b22 Move MakeTestDataSet.cxx to vtkm_cont
Originally `MakeTestDataSet.h` was header-only code. This was changed to
put its functionality into a library. The obvious library to put it in
was `vtkm_cont_testing`.

The problem is that there is some external code that is (unadvisably)
adding this header to their own code. This code ends up breaking because
it needed to include `vtkm_cont_testing`, which was not needed before.

As a workaround, there was a CMake interface link that caused external
code linking in `vtkm_cont` to also link in `vtkm_cont_testing`. This
works OK, but creates something of a circular dependency. CMake itself
has no problem with this, because `vtkm_cont` did not itself depend on
`vtkm_cont_testing`; only things that linked to `vtkm_cont` also had to
link to `vtkm_cont_testing`.

Unfortunately, some Ascent CMake script was trying to trace down
dependencies and ran into an infinite loop. So this solution was not so
great for them.

Get around the problem by just adding the `MakeTestDataSet` code
directly to `vtkm_cont` (for now).
2022-05-24 14:43:10 -06:00
Kenneth Moreland
9ea11440eb Do not require VecTraits for UnknownArrayHandle components
Whan an `UnknownArrayHandler` is constructed from an `ArrayHandle`, it uses
the `VecTraits` of the component type to construct its internal functions.
This meant that you could not put an `ArrayHandle` with a component type
that did not have `VecTraits` into an `UnknownArrayHandle`.

`UnknownArrayHandle` now no longer needs the components of its arrays to
have `VecTraits`. If the component type of the array does not have
`VecTraits`, it treats the components as if they are a scalar type.
2022-05-24 13:36:00 -06:00
Kenneth Moreland
f8f41e0ef5 Update use of field association enumerations
The enumerations in `vtkm::cont::Field::Association` were renamed in the
previous commit. The old names still exist, but are deprecated. Change
the rest of the code to use the new names.
2022-03-17 11:02:37 -06:00