Commit Graph

7382 Commits

Author SHA1 Message Date
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
Li-Ta Lo
09bc3f426e Merge topic 'amr_refactor'
cfe4d4635 add deprecated AmrArrays.h
4f97a60d8 Update CMakeLists.txt
99d17b30a migrate AmrArray filter

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Roxana Bujack <bujack@lanl.gov>
Merge-request: !2775
2022-05-25 10:05:33 -04: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
5afafd4a4b Merge topic 'break-circular-dependency'
7749b86b2 Move MakeTestDataSet.cxx to vtkm_cont

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Nicole Marsaglia <marsaglia1@llnl.gov>
Merge-request: !2779
2022-05-24 17:28:51 -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
Li-Ta Lo
cfe4d4635d add deprecated AmrArrays.h 2022-05-20 16:05:36 -06:00
Li-Ta Lo
4f97a60d8f Update CMakeLists.txt 2022-05-20 17:41:04 -04:00
Li-Ta Lo
99d17b30a0 migrate AmrArray filter 2022-05-20 15:07:34 -06:00
Li-Ta Lo
ebfbeabc8a Merge topic 'mir_filter'
7d83a7dc5 remove unreachable code
98e0f4c25 remove shared states from MIRFilter instances
1d64b1045 added deprecated MIRFilter.h
7903cee23 Update CMakeLists.txt
7e6e5f0b8 Update MIRFilter.cxx
911c66377 Merge branch 'master' into mir_filter
ac078c8c0 call DoMapeField
0a0e30858 Migrate MIR filter

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2770
2022-05-20 11:25:27 -04:00
Li-Ta Lo
7d83a7dc5c remove unreachable code 2022-05-19 17:44:46 -06:00
Li-Ta Lo
98e0f4c259 remove shared states from MIRFilter instances 2022-05-19 16:59:34 -06:00
Li-Ta Lo
1d64b1045c added deprecated MIRFilter.h 2022-05-19 10:44:42 -06:00
roxana bujack
21934c6f50 squash and rebase all commits from merge request 2728 2022-05-19 11:28:13 +02:00
Li-Ta Lo
7903cee230 Update CMakeLists.txt 2022-05-18 17:58:29 -04:00
Li-Ta Lo
7e6e5f0b86 Update MIRFilter.cxx 2022-05-18 17:57:59 -04:00
Li-Ta Lo
911c663774 Merge branch 'master' into mir_filter 2022-05-18 08:57:10 -06:00
Li-Ta Lo
ac078c8c0f call DoMapeField 2022-05-18 08:55:28 -06:00
Li-Ta Lo
2b102e2b7c Merge topic 'probe_refactor'
849106762 remove include CellDeepCopy
4108febd3 remove #include functional
daaac78f1 minor changes based on code review
aecdd7705 Update vtkm/filter/resampling/testing/CMakeLists.txt
38000ed6d Use ALL_BACKENDS for unit test
ab09f77b7 migrate Probe filter

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2771
2022-05-18 10:48:37 -04:00
Li-Ta Lo
849106762e remove include CellDeepCopy 2022-05-18 07:15:00 -06:00
Li-Ta Lo
daaac78f15 minor changes based on code review 2022-05-18 05:59:07 -06:00
Li-Ta Lo
aecdd77053 Update vtkm/filter/resampling/testing/CMakeLists.txt 2022-05-17 10:42:33 -04:00
Li-Ta Lo
38000ed6df Use ALL_BACKENDS for unit test 2022-05-17 06:07:03 -06:00
Li-Ta Lo
ab09f77b7c migrate Probe filter 2022-05-16 14:55:14 -06:00
Li-Ta Lo
0a0e30858e Migrate MIR filter 2022-05-16 09:26:08 -06:00
Kenneth Moreland
746d1efa4f Use Buffer objects for dispatcher base test
`UnitTestDispatcherBase` previously used arrays from `std::vector` to
test dispatching data to worklets. This only works for devices that have
unified memory with the host.

Change the test to use `vtkm::cont::internal::Buffer` objects and
properly copy data to/from the device for devices that have separate
memory spaces.
2022-05-13 16:02:59 -04:00
Kenneth Moreland
3ba13c5cc4 Re-enable hip builds
There were several tests that were disabled for hip because they either
took too long to compile or were failing. We are getting closer to
making everything work, so re-enable this part of the build.
2022-05-12 16:00:30 -04:00
Kenneth Moreland
9d4df90dfd Merge topic 'backport-2748' into release-1.8
d6353e1eb Fix StructuredPointGradient for Uniform Point Coordinates

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2765
2022-05-05 13:08:01 -04:00
Sujin Philip
d6353e1eb7 Fix StructuredPointGradient for Uniform Point Coordinates
The scalar field difference along x, y, and z should be divided by the
spacing not multiplied. This was causing some test failures in VTK and
ParaView when overriding the default contour filter with `vtkmContour`.
2022-05-04 12:55:33 -04:00
Kenneth Moreland
a78c02285b Merge topic 'pointtransform-symbols'
d3de36f47 Remove inline from PointTransform methods to be exported

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Nicole Marsaglia <marsaglia1@llnl.gov>
Merge-request: !2763
2022-05-04 11:51:42 -04:00
Kenneth Moreland
d3de36f470 Remove inline from PointTransform methods to be exported
When `PointTransform` was converted to the new filter structure, some of
the methods that were moved from .hxx to .cxx (and therefore compiled in
a library) were still marked as `inline`. This caused the compiler to
not compile the function into the library if it was not used. Fix the
problem by removing the `inline` modifier to the method implementations.
2022-05-03 12:57:14 -06:00
Sujin Philip
6d254d3e60 Fix StructuredPointGradient for Uniform Point Coordinates
The scalar field difference along x, y, and z should be divided by the
spacing not multiplied. This was causing some test failures in VTK and
ParaView when overriding the default contour filter with `vtkmContour`.
2022-04-28 12:50:09 -04:00
Kenneth Moreland
2fe1950adc Merge topic 'particle-density-interface'
ac9923151 Change ParticleDensity interface for setting mesh parameters

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2758
2022-04-22 16:15:23 -04:00
Kenneth Moreland
9da1d639e8 Merge topic 'gamma-typo'
ac8c8b1ce Fix typo: Gama -> Gamma

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2757
2022-04-22 12:34:22 -04:00
Kenneth Moreland
ac99231516 Change ParticleDensity interface for setting mesh parameters
Previously, the mesh parameters used for the `ParticleDensity` filters
had to be provided in the constructor. However, this is different than
most other filters in VTK-m. It also can be more error prone as it is
easy to mix up unnamed arguments.

Add methods to `ParticleDensityBase` to allow setting/getting parameters
like `Dimensions` and `Bounds` to make it more clear what the values
mean.
2022-04-22 09:26:19 -06:00
Manish Mathai
09fc8155af Merge topic 'fix-mapper-quad'
27825778e Fix color rendering when using MapperQuad

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2729
2022-04-20 12:04:35 -04:00
Kenneth Moreland
ac8c8b1cee Fix typo: Gama -> Gamma 2022-04-12 15:03:22 -06:00
Kenneth Moreland
60e6b3ec84 Fix deprecated method export
The deprecated class `vtkm::filter::MeshQuality` contained a private
method that was referenced in its inlined constructor. The problem was
that this private method was compiled in the `vtkm_filter_mesh_info`
library but not properly exported. Fix this by adding an export to the
class.
2022-04-12 10:26:54 -06:00
Kenneth Moreland
a9d49b35b2 Merge topic 'scoped-enum-field-to-colors'
e6b37f7a4 Remove deprecated use of old unscoped enums in FieldToColors
f37cc7657 Use scoped enum for FieldToColors modes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Dave Pugmire <dpugmire@gmail.com>
Merge-request: !2734
2022-04-11 10:54:43 -04:00
Vicente Adolfo Bolea Sanchez
86bf876178 cuda: Fix new cuda version warnings 2022-04-07 17:50:37 -04:00
Gunther Weber
5ad164f98f Merge topic 'fix-memory-reallocation-kokkos'
291dafb17 use kokkos allocate whn oldSize is zero

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2746
2022-04-05 13:17:39 -04:00
Kenneth Moreland
a96f2a32b4 Merge topic 'gradient-test'
3b0cdcec2 Add tests for divergence, vorticity, and q criterion

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Sujin Philip <sujin.philip@kitware.com>
Merge-request: !2739
2022-04-01 10:11:43 -04:00
Abdelilah Essiari
291dafb173 use kokkos allocate whn oldSize is zero 2022-03-31 14:38:03 -04:00
Kenneth Moreland
62e509c0a2 Turn off inlining of Variant::CastAndCall for HIP
The current implementation of the AMD HIP compiler adds default compiler
flags to attempt to inline everything possible. This is wrecking havoc
with the `Variant::CastAndCall` function, whose implementation has one
or more large switch statements with each case calling a different
potentially inline function. In some parts of the VTK-m code, this is
dragging the compilation on for days as it tries to resolve a
`Variant::CastAndCall` within a `Variant::CastAndCall`. This will
probably need to be addressed in the compiler, but meanwhile we will
force the inlining to be turned off for the function called by
`Variant::CastAndCall`. It is unclear if this will result in some extra
runtime overhead, but the change is worth it to get reasonable compile
times.

Thanks to Nick Curtis for tracking this down and providing the solution.
2022-03-28 14:14:06 -06:00
Kenneth Moreland
6afff75501 Modify Variant CastAndCall to have fewer cases in its switch
The previous implementation of `Variant`'s `CastAndCall` generated a
switch statement with 20 cases (plus a default) regardless of how many
types were handled by the `Variant` (with the excess doing nothing
useful). This reduced the amount of code, but caused the compiler to
have to build many more instructions (and optimize for them). This in
turn lead to large compile times and unnecessary large libraries/
executables.

This change makes a different function to use for `CastAndCall` so that
the number of cases in the switch matches exactly the number of types in
the `Variant`'s union.

Because the size of VariantImplDetail.h was getting large, I also
reduced the maximum expansions for the code. This does not seem to
negatively affect compile time, and I doubt it will have an noticible
difference in running time (when in release mode).

I also modified some other parts of this code to match the expansion
without making unnecessary defaults.
2022-03-28 14:14:06 -06:00
Kenneth Moreland
61a44887fd Update vtkm_add_instantiations documentation 2022-03-23 06:34:05 -06:00
Kenneth Moreland
1c1881d53e Declare methods for instances out of line
For the templated methods that we are precompiling instances for, do not
put their implementation inside of the class declaration. The problem is
that if you define a method inside of a class, it is implicitly inline.
If it is inline, a compiler might choose to compile it even if an
external symbol exists.
2022-03-23 06:33:45 -06:00
Kenneth Moreland
13de2b7303 Protect gradient instantiations from ambiguity
It appears that some compilers treat template instances different than
calling a template. For example, if you have

```cpp
template <typename T, typename U>
void Foo(T t, U u);

template <typename T>
void Foo(T t, int u);

template void Foo(int t, int u);
```

that some compilers will complain that the instance is ambiguous because
it matches both versions of Foo even though the second one is the one
that is called (unless you specifically declare template parameters).

This is what happend with the gradient instances. Fix the problem by
wrapping the "ambiguous" cases to be called by a simple, single
templated function.
2022-03-23 06:33:41 -06:00
Kenneth Moreland
f4de1d8ee2 Compile instantiations of the gradient filter
When the gradient filter was moved over to the new filter structure, it
lost its instantiations. This is a problem because the gradient filter,
which compresses a lot of the code into single worklet calls for
efficiency, is one of the longest to compile filters.

This commit restores the instantiations with the updated instantiation
functionality. This breaks up the code into many translation units that
can be compiled simultaneously and thus not hold up the entire compile
on one process.
2022-03-23 06:33:41 -06:00
Kenneth Moreland
6eb9c9876c Add generalized instantiation
Recently, an instantiation method was added to the VTK-m configuration
files to set up a set of source files that compile instances of a template.
This allows the template instances to be compiled exactly once in separate
build files.

However, the implementation made the assumption that the instantiations
were happening for VTK-m filters. Now that the VTK-m filters are being
redesigned, this assumption is broken.

Thus, the instantiation code has been redesigned to be more general. It can
now be applied to code within the new filter structure. It can also be
applied anywhere else in the VTK-m source code.
2022-03-23 06:33:36 -06:00