Commit Graph

6704 Commits

Author SHA1 Message Date
Li-Ta Lo
b78f91b067 add comment on the field parameter 2021-03-04 11:14:14 -07:00
Li-Ta Lo
226e0ccc30 initialize the old way 2021-03-04 09:29:00 -05:00
Li-Ta Lo
30aa5b0526 add floating point atomic add for MSVC 2021-03-04 09:28:55 -05:00
Li-Ta Lo
dfa1a64729 Merge branch 'master' into fp_atomics 2021-03-04 09:27:06 -05:00
Dave Pugmire
a42bb1b0c7 Merge topic 'messenger_cleanup'
8bf53bc36 Cleanup per review.
9c9db23de Fixes per review
2d1ff10d0 Code cleanup
5c4537692 Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into messenger_cleanup
43b4bf46d Fix for serial builds.
ebb1019aa Add CheckRequests method.
af14f583a Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into messenger_cleanup
55fff59e0 Cleanup the messenger classes.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Abhishek Yenpure <abhishek@uoregon.edu>
Merge-request: !2410
2021-03-03 16:38:54 -05:00
Kenneth Moreland
a7100c845a Do not assume CUDA reduce operator is unary
The `Reduce` algorithm is sometimes used to convert an input type to a
different output type. For example, you can compute the min and max at
the same time by making the output of the binary functor a pair of the
input type. However, for this to work with the CUDA algorithm, you have
to be able to also convert the input type to the output type. This was
previously done by treating the binary operator as also a unary
operator. That's fine for custom operators, but if you are using
something like `thrust::plus`, it has no unary operation. (Why would
it?)

So, detect whether the operator has a unary operation. If it does, use
it to cast from the input portal to the output type. If it does not,
just use `static_cast`. Thus, the operator only has to have the unary
operation if `static_cast` does not work.
2021-03-03 09:39:51 -07:00
Kenneth Moreland
f3a6931f6b Fix casting issues in TBB functors 2021-03-03 09:39:51 -07:00
Kenneth Moreland
cc5b9a016f Add casts to FunctorsGeneral.h
If you are using the classes in `FunctorsGeneral.h`, you specify both
the result type and the type of the operands. Presumably you are already
comfortable with any type conversions. So let them keep.
2021-03-03 09:39:51 -07:00
Kenneth Moreland
d9c988b200 Allow for different types in basic type operators
The basic type operators in `Types.h` (i.e. `vtkm::Add`,
`vtkm::Subtract`, `vtkm::Multiply` and `vtkm::Divide`) required the same
type for both arguments. This caused problems when used with `Reduce`
and the initial value type did not match exactly.

Use some tricks from `BinaryOperators.h` to be flexible about using
different types.
2021-03-03 09:39:45 -07:00
dpugmire
799dbacd92 Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into add_SOA_to_default_types 2021-03-02 19:41:30 -05:00
Kenneth Moreland
58bd890c9c Merge topic 'variant-no-ref'
878a5e5ae Disallow references in Variant

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Li-Ta Lo <ollie@lanl.gov>
Merge-request: !2428
2021-03-02 13:53:40 -05:00
dpugmire
21a3137000 kick the builds 2021-03-02 13:47:11 -05:00
dpugmire
8bf53bc368 Cleanup per review. 2021-03-02 13:20:20 -05:00
dpugmire
9c9db23de5 Fixes per review 2021-03-02 13:04:11 -05:00
dpugmire
565522eb62 Add ArrayHandleSOA to default 2021-03-02 12:09:26 -05:00
Kenneth Moreland
878a5e5ae2 Disallow references in Variant
I have run into strange problems with reference types sneaking into
templates. Reference types can cause weird errors when passing things
across hosts and devices, and it's best not to let them sneak into an
object like Varient where they become more difficult to check for.
2021-03-01 16:09:19 -07:00
Kenneth Moreland
80c1f0a974 Be more conservative about is_trivial support
`std::is_trivial` is part of the C++14 specification. However, we have
encountered multiple compilers that purport to implement C++14 but do
not implement `std::is_trivial` and the like checks correctly.

To avoid such issues, only use `std::is_trivial` on compilers that we
have tested to support it.
2021-03-01 15:12:27 -07:00
Gunther H. Weber
e4a46f3392 Removed two TODO comments after verifying parameters 2021-02-26 17:01:14 -08:00
Gunther H. Weber
3ef95ded23 Port bug fix from distributed to augmented contour tree filter 2021-02-26 15:23:44 -08:00
Gunther H. Weber
70f7337f64 Fix hang in distributed contour tree
Pass division vector to DIY RegularDecomposer to ensure its decomposition matches the one in the partitioned data set.
2021-02-26 15:23:44 -08:00
mclarsen
1c060d9c50 more missing sstream headers 2021-02-26 13:49:42 -08:00
Kenneth Moreland
91fc69fd06 Merge topic 'implicit-functions-no-virtual'
662998f19 Remove make_ImplicitFunctionFunctor functions
27cc99acb Add documentation for Multiplexer and General implicit functions
6a445ebcf Do not return a reference from ImplicitFunction::PrepareForExecution
b0fcab5d7 Do not capture references to execution objects
096e7457c Fix CUDA issues
8c6623736 Suppress deprecation warnings in deprecated class
a6725b3ac Remove use of deprecated ImplicitFunctions with virtual methods
180d11e7f Add ImplicitFunctionGeneral
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Nickolas Davis <nadavi@sandia.gov>
Merge-request: !2413
2021-02-26 15:19:30 -05:00
mclarsen
5be6fb0c50 add another missing header 2021-02-26 07:35:26 -08:00
mclarsen
572840f492 add another missing header 2021-02-26 07:29:18 -08:00
mclarsen
ffb0548b92 adding missing header 2021-02-26 07:17:52 -08:00
Kenneth Moreland
662998f194 Remove make_ImplicitFunctionFunctor functions
They were meant to replace `make_ImplicitFunction*Handle` classes, but
they don't really provide any interesting functionality and are not
backward compatible in any case. So just get rid of one more thing we
don't need to support.
2021-02-25 14:05:02 -07:00
Kenneth Moreland
27cc99acb4 Add documentation for Multiplexer and General implicit functions 2021-02-25 14:00:20 -07:00
Kenneth Moreland
6a445ebcf0 Do not return a reference from ImplicitFunction::PrepareForExecution
This can cause many troubles when passing around in a Variant
or across devices.
2021-02-25 13:49:04 -07:00
Kenneth Moreland
1aa0714aec Merge topic 'summit-errors'
aa5c9dba2 Remove problematic lambda functions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2418
2021-02-25 11:41:51 -05:00
dpugmire
2d1ff10d04 Code cleanup 2021-02-24 15:58:49 -05:00
dpugmire
5c4537692e Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into messenger_cleanup 2021-02-24 12:42:33 -05:00
Matt Larsen
96223a955e i was wrong about the ray direction 2021-02-24 09:36:20 -08:00
Kenneth Moreland
b0fcab5d7f Do not capture references to execution objects
It is possible for a transport to return a reference to an object.
At some point, however, the object has to be potentially copied
to a different memory space to be used in the execution environment.
This was getting fouled up because the reference type was being
captured. Instead, remove any references from the object.
2021-02-24 11:58:18 -05:00
Kenneth Moreland
aa5c9dba28 Remove problematic lambda functions
The GCC 7 compiler on summit was failing to compile all of the
code. The problematic parts involved using lambda functions.
I think the problem is that the compiler has a bug where it
has a problem resolving the type of variables captured by
reference. The problem seems similar to this bug reported
to Kokkos:

https://github.com/kokkos/kokkos-kernels/issues/349

Solved the problem by removing the lambdas with either a
named method or just inline code.

I suspect the problem arose (without anyone's knowledge) with
MR !2331, which moved VTK-m to C++14. This GCC error seems to
happen with C++14 but not C++11. (The features of lambdas changed
between these two versions of C++.)
2021-02-24 09:52:59 -07:00
Matt Larsen
32b87b8b00 Merge topic 'the_robot_made_me_do_this_to_fix_things'
b9326c208 force update the images
b4877cf73 fix conversion warning
cac09110d fix rendering depths and divide by zero

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2419
2021-02-24 10:22:06 -05:00
mclarsen
b4877cf730 fix conversion warning 2021-02-23 14:52:35 -08:00
mclarsen
cac09110d8 fix rendering depths and divide by zero 2021-02-23 14:36:58 -08:00
nadavi
bd72d72471 improve regression test error output when args aren't set 2021-02-22 23:36:30 +00:00
Kenneth Moreland
096e7457c3 Fix CUDA issues 2021-02-22 06:40:03 -07:00
Kenneth Moreland
8c66237364 Suppress deprecation warnings in deprecated class
The implementation of a deprecated class should not give deprecation
warnings from its own implementation.
2021-02-22 06:40:03 -07:00
Kenneth Moreland
a6725b3acd Remove use of deprecated ImplicitFunctions with virtual methods
Unfortunately, this introduces a backward-incompatible change with the
filters that use ImplicitFunctions. Before, they would get an
ImplicitFunctionHandle. This class is deprecated, and there is no easy
way to get back the actual type of implicit function stored in it.
2021-02-22 06:40:02 -07:00
Kenneth Moreland
180d11e7f2 Add ImplicitFunctionGeneral 2021-02-22 06:40:02 -07:00
Kenneth Moreland
5ab9ddb637 Update ImplicitFunction tests to use non-virtual objects
There is still a test for the deprecated functionality (for now). The
deprecated test only happens if deprecated virtuals are still compiled,
and warnings are suppressed for this part of the code.
2021-02-22 06:40:02 -07:00
Kenneth Moreland
0cddbef0b9 Deprecated virutal methods in ImplicitFunctions
The `ImplicitFunction` classes are now trivial classes that can be
passed among host and devices. Because of this, we now need to know the
type of the `ImplicitFunction` in order to use it.

The old functionality still exists (when virtual methods are still being
compiled), but will give deprecation warnings. It is also not possible
to get a pointer from `ImplicitFunctionHandle` and cast it back to the
original data type (because the type changed). This is a weird testing
feature that makes little sense in practice.

Also unsupported in the deprecated classes is the ability to change
the object and have those changes reflected in the handle. This is
unfortunate, but it would have been difficult to implement this
feature that is going away and only appears to be used in some of
the tests.
2021-02-22 06:40:02 -07:00
Gunther Weber
561db99b30 Merge topic 'debug/ctwarp3d'
7a14ea0ef Use Float64 instead of FloatDefault in TreeCompiler
96424c833 Fix bad ordering of args for CountLinkComponentsIn2DSlice in IsNecessary

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !2414
2021-02-21 21:57:38 -05:00
Gunther Weber
e3851ce236 Merge topic 'contour-tree-array-decorator'
ebb265ce0 Add missing VTKM_EXEC_CONT declarations to functor
10ea36bb9 Pick one approach of using array handle decorator for contour tree
585f0ccb1 Two versions for replacing array transform with array decorator

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !2412
2021-02-21 21:56:32 -05:00
Gunther H. Weber
ebb265ce03 Add missing VTKM_EXEC_CONT declarations to functor 2021-02-18 16:53:50 -08:00
Kenneth Moreland
1822792b85 Support deprecated behavior of point locator pointers
`PointLocator`s have changed from being virtual objects to being trivial
objects. Part of this change means that when a worklet gets the
execution object for a point locator, it gets the actual object (or a
reference to it) instead of a pointer to an object. This means that the
new code uses the `.` operator to access the locator's features instead
of the `->` operator.

To support code still using the deprecated functionality, added a
specific `->` operator to the locator execution object to make it behave
as if it were a pointer. However, this operator is marked deprecated to
warn the user that they should modify their code to use the `.` instead.
2021-02-18 13:11:54 -07:00
Gunther H. Weber
10ea36bb95 Pick one approach of using array handle decorator for contour tree 2021-02-18 11:55:04 -08:00
dpugmire
43b4bf46db Fix for serial builds. 2021-02-18 14:36:29 -05:00
dpugmire
ebb1019aab Add CheckRequests method. 2021-02-18 11:14:02 -05:00
dpugmire
af14f583a7 Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into messenger_cleanup 2021-02-18 09:04:57 -05:00
dpugmire
55fff59e09 Cleanup the messenger classes. 2021-02-18 09:01:23 -05:00
Gunther H. Weber
585f0ccb18 Two versions for replacing array transform with array decorator 2021-02-17 19:17:31 -08:00
Nickolas Davis
8e757e58ad Merge topic 'point-locator-virtual-removal'
f70ecd435 implement PointLocator without virtual methods

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !2403
2021-02-17 15:53:32 -05:00
Kenneth Moreland
75597e240b Merge topic 'array-range-compute-unknown'
04f020ae6 Update Field to use new ArrayRangeCompute features
2a41428fe Add implementation of ArrayRangeCompute for UnknownArrayHandle

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Sujin Philip <sujin.philip@kitware.com>
Merge-request: !2409
2021-02-17 15:43:53 -05:00
Kenneth Moreland
b9430c52e6 Create ArrayHandleOffsetsToNumComponents
This is a fancy array that takes an array of offsets and converts it to
an array of the number of components for each packed entry.

This replaces the use of `ArrayHandleDecorator` in `CellSetExplicit`.
The two implementation should do the same thing, but the new
`ArrayHandleOffsetsToNumComponents` should be less complex for
compilers.
2021-02-17 10:44:47 -07:00
nadavi
f70ecd4354 implement PointLocator without virtual methods 2021-02-17 17:16:17 +00:00
Kenneth Moreland
04f020ae65 Update Field to use new ArrayRangeCompute features
Reduces the amount of code that has to be generated. Also improves the
number of arrays supported and has better support for deprecated
versions of `GetRange`.
2021-02-17 09:18:36 -07:00
Kenneth Moreland
2a41428fe4 Add implementation of ArrayRangeCompute for UnknownArrayHandle
This allows you to easily compute the range of any ArrayHandle, even if
you don't know the type.

A unit test for ArrayRangeCompute was also added.
2021-02-17 09:18:31 -07:00
Gunther H. Weber
7a14ea0efa Use Float64 instead of FloatDefault in TreeCompiler 2021-02-16 20:32:39 -08:00
Kenneth Moreland
047d79672a Fix CUDA compilation error with Lagrangian filter
CUDA architecture has a limited amount of memory available for
constants. The CUDA compiler uses this space to hold constants for some
optimizations. However, for large kernels, the number of constants
needed might be larger than the constant space available. For these
conditions, you have to disable this form of optimization with the `-
Xptxas --disable-optimizer-constants` flags.

Currently, the only file that seems to have this issue is the test for
the Lagrangian filter. Someone should take a closer look to see if this
filter in particular is making unnecessarily large worklet/kernel. (In
particular, why does the Lagrangian filter have a larger kernel than the
streamline and stream surface filters?)

If this occurance happens more often, we might need to add some ways to
configure it in the build.
2021-02-16 13:25:11 -07:00
Kenneth Moreland
2399741a97 Change Probe filter to use CellLocatorChooser
There was some compile errors with CUDA and the CellLocatorGeneral.
Apparently it added enough to the CUDA kernel to cause issues with
constant memory.
2021-02-15 12:39:12 -07:00
Kenneth Moreland
e61c54f873 Add CellLocatorChooser
`CellLocatorChooser` allows you to select a cell locator at compile
time. Unlike `CellLocatorGeneral`, you have to deduce what cell set
types you might have, but you don't have to have a large switch
statement in the middle of your worklet.
2021-02-15 12:39:11 -07:00
Kenneth Moreland
23c823d4b4 Fix compile errors and warnings related to new CellLocator structure 2021-02-15 12:39:11 -07:00
Kenneth Moreland
47429a3164 Fix export issues with CellLocatorBase 2021-02-15 12:39:11 -07:00
Kenneth Moreland
8922f600e1 Use GNU attributes for deprecated
There appears to be a bug in GCC where if you mixed C++ attributes like
`[[deprecated]]` with GNU attributes like `__attribute__(())`, you will
get a compile error. This can be a problem when using attributes to both
set the export (i.e. visibility) of an item and deprecating the same
item.

This problem has been encountered before. Commit
34b0bba84207a89e8fddfe62e7a1ff30b1b53a18 fixed the problem by using
`[[gnu::visibility()]]` instead of `__attribute__()` in the export
macros. This works fine for export macros defined by VTK-m headers such
as `VTKM_ALWAYS_EXPORT`. Unfortunately, we have little control over the
export macros that CMake automatically creates. Rather than rewrite the
CMake export code, we go the other way and use `__attribute__()` for all
exports _and_ the depreciated attribute.
2021-02-15 12:39:11 -07:00
Kenneth Moreland
0a5f5d55c9 Remove virtual methods from cell locators
Deprecated the `CellLocator` class and made all methods of the
other `CellLocator` classes non-virtual. General locators can
still use the `CellLocatorGeneral` class, but this class now
only works with a predefined set of locators. (The functionality
to provide a function to select a locator has been removed.)
2021-02-15 12:39:11 -07:00
Oliver Ruebel
96424c8331 Fix bad ordering of args for CountLinkComponentsIn2DSlice in IsNecessary 2021-02-15 04:17:04 -08:00
Kenneth Moreland
34b6bea013 Merge topic 'device-free-execwholearray'
0797359c5 Make ExecutionWholeArray objects not depend on device type
0bee74438 Support DeviceAdapterId in deprecated ArrayHandle

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Nick Thompson <nathompson7@protonmail.com>
Merge-request: !2405
2021-02-12 20:00:11 -05:00
Caitlin Ross
40185ee440 attempting to fix various build and linking errors 2021-02-10 15:20:35 -05:00
Caitlin Ross
5336fea028 add XGC storage tags to DefaultTypesVTK 2021-02-10 15:20:35 -05:00
Caitlin Ross
a5689ec84d testing array range for xgc coords 2021-02-10 15:20:35 -05:00
Caitlin Ross
e73a0bccb8 update ArrayRangeCompute to handle ArrayHandleXGC* 2021-02-10 15:20:35 -05:00
Caitlin Ross
46155daaa2 removing ArrayHandleExtrude* 2021-02-10 15:20:35 -05:00
Caitlin Ross
a9711bffb7 update XGC ArrayHandles to new buffer style 2021-02-10 10:18:53 -05:00
Kenneth Moreland
0797359c57 Make ExecutionWholeArray objects not depend on device type
With recent changes to `Arrayhandle`, the type for the associated array
portal is now the same across all devices. This means that almost all
exec objects no longer need to be specialized on the device types. Thus,
clean up the whole array exec objects to no longer need to be templated
on device.
2021-02-09 19:16:51 -07:00
Kenneth Moreland
0bee744384 Support DeviceAdapterId in deprecated ArrayHandle
The original `ArrayHandle` design had the `PrepareFor*` methods
templated on the device adapter tag. This is no longer necessary (at
least for any existing `ArrayHandle`), so support calling `PrepareFor*`
with a `DeviceAdapterId` that is resolved at runtime.
2021-02-09 19:16:51 -07:00
Kenneth Moreland
c62e38bab6 Make locator exec objects not depend on device type
With recent changes to `ArrayHandle`, the type for the associated array
portal is now the same across all devices. This means that almost all
exec objects no longer need to be specialized on the device types. Thus,
clean up the locator exec objects to no longer need to be templated on
device.
2021-02-09 17:20:57 -07:00
Kenneth Moreland
6232670049 Merge topic 'deprecate-executiontypes'
05fc1747e Make deprecated tags more descriptive
b92566cdd Convert `std::endl` to `'\n'`
b8b958a98 Get rid of CellSetStructured.hxx
f4bc3002b Fix compiler error with `constexpr` method
4d8f05bae Update CellSetExtrude to not specify exec types by device
3962e73b0 Fix issues with class specialization
c55d15f39 Deprecate ArrayHandle::ExecutionTypes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2401
2021-02-09 13:33:08 -05:00
Kenneth Moreland
05fc1747e0 Make deprecated tags more descriptive
Also, test to make sure that the deprecated types are still valid.
2021-02-09 09:45:41 -07:00
Kenneth Moreland
b92566cdd1 Convert std::endl to '\n'
Using `std::endl` has a side effect of flushing the stream, which can
have unintended performance consequences.
2021-02-09 08:53:46 -07:00
Nick Thompson
f4a3538a6f Merge topic 'fix_matrix'
e4241aa53 Make matrix unit tests less verbose.
bba3d29c2 Remove UB from Matrix.h, and replace by quiet NaNs.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !2402
2021-02-08 21:01:18 -05:00
Kenneth Moreland
b8b958a98b Get rid of CellSetStructured.hxx
One of the MSVC builds was giving template resolution problems for one
of the methods declared non-inline for no discernable reason. It sounds
like a compiler bug. Rather than try to  work around the issue, just
move the declaration inline.

In fact, all the methods are really small (only 1 or 2 lines). Just
delete the .hxx file and simplify things.
2021-02-08 18:43:31 -07:00
Kenneth Moreland
f4bc3002bb Fix compiler error with constexpr method
The `GetMaxNumberOfNeighbours` of the `MeshStructure*` classes was
declared `constexpr`. This was causing some compiler errors.

I think the problem is actually a bug with GCC (https://gcc.gnu.org/
bugzilla/show_bug.cgi?id=66297). Whether it is a compiler bug or not,
there does not seem to be a large value to declaring this method
`constexpr`, so I just removed the keyword.
2021-02-08 17:21:53 -07:00
Kenneth Moreland
4d8f05baef Update CellSetExtrude to not specify exec types by device
Somewhere during this edit I removed a header file that didn't strictly
need to be there. This caused me to have to add

```cpp
```

in several places in the code.
2021-02-08 16:57:16 -07:00
Kenneth Moreland
3962e73b06 Fix issues with class specialization
C++ has some weird rules about specializing subclasses.
2021-02-08 14:31:45 -07:00
Nick Thompson
e4241aa530 Make matrix unit tests less verbose. 2021-02-08 16:18:13 -05:00
Nick Thompson
bba3d29c2a Remove UB from Matrix.h, and replace by quiet NaNs. 2021-02-08 15:40:23 -05:00
Kenneth Moreland
c55d15f397 Deprecate ArrayHandle::ExecutionTypes
The newer version of `ArrayHandle` no longer supports different types of
portals for different devices. Thus, the `ReadPortalType` and
`WritePortalType` are sufficient for all types of portals across all
devices.

This significantly simplifies supporting execution objects on devices,
and thus this change also includes many changes to various execution
objects to remove their dependence on the device adapter tag.
2021-02-08 12:17:37 -07:00
Vicente Adolfo Bolea Sanchez
02f97325c4 Merge branch 'upstream-lcl' into refactor-use-cpp14
# By Lightweight Cell Library Upstream
* upstream-lcl:
  lcl 2021-02-08 (6fe1a2d8)
2021-02-08 17:13:10 +01:00
Vicente Adolfo Bolea Sanchez
bbe36d8c33 cmake: set c++14 as minimum c++ rev
Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
2021-02-08 17:13:05 +01:00
dpugmire
ed7358ed23 Kick the dashboard. 2021-02-05 16:32:42 -05:00
dpugmire
6367e46804 Bug fix when pathline rank has 0 ds. 2021-02-05 15:57:18 -05:00
dpugmire
6608a38eef Debugging the dashboard 2021-02-05 14:08:46 -05:00
dpugmire
b4768f06bd Bug fix. Must copy particles. 2021-02-05 12:17:27 -05:00
dpugmire
4773b51ca3 Debug test fail... 2021-02-05 12:04:24 -05:00
dpugmire
982b693abb Forgot to add hxx file. 2021-02-05 11:32:38 -05:00
dpugmire
aa713b565f Support for dist-memory pathlines. 2021-02-05 09:40:50 -05:00
Kenneth Moreland
71a5bd3b95 Fix compile error with MSVC
Some (but not all) versions of visual studio seem to have a bug that
causes a syntax error when using the deprecated attribute in a templated
constructor.
2021-02-04 08:47:28 -07:00
Kenneth Moreland
7df5c39358 Remove device template argument from AtomicArrayExecutionObject
The actual code for AtomicArrayExecutionObject does not need to be
specialized by the device. The functionality is implemented by calling
the vtkm::Atomic* methods, which are properly implemented on each
device.
2021-02-04 08:47:28 -07:00
Kenneth Moreland
99e613d377 Avoid conversion warnings in RecombineVec copy
Unfortunately, there is no way to specify when copying `RecombineVec`s
whether we wish to allow precision loss in conversions. Because
sometimes we need them, disable the warnings.
2021-02-03 10:06:12 -07:00
Kenneth Moreland
4c524de625 Fix inverted ArrayCopy arguments
Also fix condition where a `UnknownArrayHandle` destination does not
have an underlying `ArrayHandle` set yet.
2021-02-02 17:34:12 -07:00
Kenneth Moreland
1faed3712e Remove the use of ResetTypes for ArrayCopy
It used to be the case where you needed to call `ResetTypes` on a
`VariantArrayHandle` before using `ArrayCopy` to limit the types it gets
compiled for. However, there is now a general form for
`UnknownArrayHandle`, so `ResetTypes` no longer does anything useful in
this case. Remove the use of that.
2021-02-02 17:34:08 -07:00
Kenneth Moreland
ad7033684f Change ArrayCopy of UnknownArrayHandle to limit types
Rather than copy every type to every other type, only copy for the same
base type or copy to/from FloatDefault. This should reduce the amount of
code generated by a lot.

This reduces the size of the .o for ArrayCopy.cxx on my mac from
21MB to 7.7MB.
2021-02-02 17:33:08 -07:00
Kenneth Moreland
916a01d7b9 Add general ArrayCopy between UnknownArrayHandles
Add an overload of `ArrayCopy` that takes `UnknownArrayHandle`s and
copies them for (almost) any `ArrayHandle` type.

The code uses `CastAndCallWithExtractedArray` to reduce the total number
of copy conditions to about 100, which are all precompiled into the
library. On a debug build on my mac, this creates a .o file of 21MB.
That's not great, but not terrible. Hopefully, this can be used to
consolidate copy implementations elsewhere.
2021-02-02 17:33:08 -07:00
Kenneth Moreland
26ea2ab420 Break circular dependency of ArrayCopy.h and UnknownArrayHandle.h
The circular dependency came from UnknownArrayHandle.h needing
VTKmDefaultTypes.h, which needed all the cell set types. Some of those
cell sets used ArrayCopy in templated functions. Changed those functions
to directly deep copy the ArrayHandle.
2021-02-02 17:33:08 -07:00
Kenneth Moreland
990cc9ecea Test copying UnknownArrayHandle 2021-02-02 17:33:08 -07:00
Oliver Ruebel
cea1173233 Reverse error check in ContourTreeMaker 2021-02-02 13:46:01 -08:00
Oliver Ruebel
5005b5d44a Updated ContourTreeMesh::DebugPrint / ContourTreeMaker::DebugPrintt to use per-call build guards 2021-02-02 13:44:50 -08:00
Gunther Weber
8ebd889732 Merge topic 'add-contour-tree-unit-tests'
c59d8b25b Use test_equal_ArrayHandles instead of custom functions ArraysEqual
06ab386a0 Added test for combinining contour tree meshes
3d5adf335 Re-enabled tests with external files (and added required files to Git LFS)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !2344
2021-02-01 16:55:29 -05:00
Kenneth Moreland
76634d167e Merge topic 'deprecate-arrayhandle-shrink'
34412ff29 Deprecate ArrayHandle::Shrink
eb90a6080 Update documentation for Storage

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2392
2021-02-01 16:07:22 -05:00
Kenneth Moreland
880d26d60a Add test for UnknownArrayHandle::NewInstanceFloatBasic 2021-02-01 10:24:13 -07:00
Kenneth Moreland
d51fdaddf8 Add UnknownArrayHandle::NewInstanceFloatBasic
This provides the ability to convert an array handle of an unknown value
type to an array handle that has `vtkm::FloatDefault` as its base
component type. Thus subsequently lets you pull the components as
`vtkm::FloatDefault` without having to worry about type conflicts.
2021-02-01 09:34:08 -07:00
Kenneth Moreland
34412ff298 Deprecate ArrayHandle::Shrink
This method has been subsumed by Allocate with vtkm::CopyFlag::On.
2021-02-01 08:07:40 -07:00
Gunther H. Weber
c59d8b25b1 Use test_equal_ArrayHandles instead of custom functions ArraysEqual 2021-01-29 11:33:25 -08:00
Gunther H. Weber
06ab386a03 Added test for combinining contour tree meshes 2021-01-29 09:45:13 -08:00
Gunther H. Weber
3d5adf335d Re-enabled tests with external files (and added required files to Git LFS) 2021-01-29 09:45:13 -08:00
Gunther H. Weber
239adf5980 Fix typos in functor names for contour tree 2021-01-28 14:29:45 -08:00
Kenneth Moreland
eb90a6080c Update documentation for Storage 2021-01-28 14:37:10 -07:00
Gunther H. Weber
5d8a67eff1 Re-enable marching cubes unit tests for disitrbuted contour tree 2021-01-28 11:51:42 -08:00
Gunther H. Weber
0183db6854 Split array access into separate lines and add VTKM_ASSERT 2021-01-27 19:31:56 -08:00
Kenneth Moreland
8b133288ce Fix deprecation warnings
There was an error that caused deprecation warnings in VTK-m to be
suppressed, which meant that many uses of deprecated features went
unnoticed. This fixes those deprecation warnings.

The majority of the warnings were caused by the use of the deprecated
`Cast`, `CopyTo`, and `ResetTypes` methods of `UnknownArrayHandle` (or
`VariantArrayHandle`). Both `Cast` and `CopyTo` have been subsumed by
`AsArrayHandle` (to make the functionality more clear). `ResetTypes` now
requires a second template argument to define the storage types to try.

Also fixed some issues with `SerializableField` being deprecated.
This class is no longer necessary because `Field` can now be directly
serialized.
2021-01-26 07:56:39 -07:00
Kenneth Moreland
b085cde358 Fix runaway deprecation suppression
Field.h had a runaway deprecation suppression where the pragmas to
suppress deprecation warnings were turned on but not properly turned
off. This caused deprecation warnings to be turned off for anything
including Field.h (directly or indirectly), and consequently lots of use
of deprecated features went unnoticed.
2021-01-25 15:25:12 -07:00
Kenneth Moreland
3f5193d231 Consolidate getting a scalar field array
There are several places in the ray casting library that require
operating on a field that we know is a scalar field. Previously, these
were all independently cast to an uncertain array of the limited types.
Rather than have independent calls everywere, make a consolidated
function that does the same operation for everyone.

This fixes an issue with using a deprecated version of a method. It also
makes it possible to quickly change types in the future.
2021-01-25 15:25:11 -07:00
Li-Ta Lo
e7cf3d784a Merge topic 'hdf5_image_io'
081f8aaea reformat if statements, add comments on the HDF5 macros
31aa46706 Merge branch 'master' into hdf5_image_io
e65c0713b move #include of hdf5.h into .cxx files
ff0b8fd0b changed to CMake files based on Robert's feedback
ca0ce4de7 Merge branch 'master' into hdf5_image_io
23a95f864 exclude header files from install check when it is not enabled
d81f08eed correct copyright mesage
fb6c9afe7 uncomment ubuntu1805_cuda image
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Li-Ta Lo <ollie@lanl.gov>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2371
2021-01-16 09:26:15 -05:00
Li-Ta Lo
081f8aaea8 reformat if statements, add comments on the HDF5 macros 2021-01-15 15:05:52 -07:00
Li-Ta Lo
31aa467068 Merge branch 'master' into hdf5_image_io 2021-01-15 09:25:18 -07:00
Li-Ta Lo
e65c0713b8 move #include of hdf5.h into .cxx files 2021-01-15 09:12:52 -07:00
Kenneth Moreland
3a7ba1d569 Fix deprecation warning in MSVC
MSVC tends to give deprecation warnings in templated methods that are
used with deprecated classes rather than where the deprecated thing was
declared. That makes it annoyingly hard to supress them to implement
support of deprecated items.
2021-01-14 17:01:23 -07:00
Kenneth Moreland
11a4c9867e Change Field to hold UnknownArrayHandle rather than VariantArrayHandle
The `VariantArrayHandle` will soon be deprecated for its replacement of
`UnknownArrayHandle`. Thus, `Field` and related classes should start
using the new `UnknownArrayHandle`.
2021-01-14 17:01:22 -07:00
Li-Ta Lo
ff0b8fd0bb changed to CMake files based on Robert's feedback 2021-01-14 14:23:05 -07:00
Li-Ta Lo
ca0ce4de7b Merge branch 'master' into hdf5_image_io 2021-01-14 14:08:00 -07:00
Kenneth Moreland
63d32a863e Fix compile error from invalid ArrayHandle
The compile error happened from incompatible code changes between !2349
and !2374. The former removed the ability to use non-`Vec` values in
`ArrayHandleSOA`. The latter tried to create such an `ArrayHandle`
inside a template function that was called with the SOA storage.
2021-01-14 13:12:57 -07:00
Kenneth Moreland
a6edc832da Merge topic 'soa-array-default'
cecd81d5d Add types appropriate for Ascent
865855ea0 Add changelog for making ArrayHandleSOA a default array
50ff9c22a Add support of `ArrayHandleSOA` as a default storage type
bc09a9cd1 Add precompiled versions of `ArrayRangeCompute` for `ArrayHandleSOA`
77f9ae653 Support `ArrayHandleSOA` only for `Vec` value types

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2349
2021-01-14 12:40:58 -05:00
Kenneth Moreland
7a3f20560a Merge topic 'switch-to-new-arrayhandle'
3228752b2 Fix error message when using deprecated storage
5ef4e7eee Make new style of ArrayHandle the expected style

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2375
2021-01-14 10:14:20 -05:00
Kenneth Moreland
9ed68f5a42 Add default copy constructor for RecombineVec
Some compilers complain if the copy constructor is not explicitly
specified.
2021-01-13 09:19:34 -07:00
Kenneth Moreland
66fbc99b09 Disable ArrayHandleCounting for invalid value types
`ArrayHandleCounting` only works with values that support basic
arithmetic. The concept of counting makes little sense for types that
are not well defined for addition and multiplication like `bool`,
`string` and other custom types.
2021-01-13 09:19:34 -07:00
Kenneth Moreland
0b2dbfdda1 Fix ICE in GCC 4.8 2021-01-13 09:19:34 -07:00
Kenneth Moreland
50d9320135 Add missing types to serialization of UnknownArrayHandle 2021-01-13 09:19:34 -07:00
Kenneth Moreland
ab9c0f7248 Add arithmetic assignment operators to RecombineVec
`RecombineVec` is the class used as the value type for
`ArrayHandleRecombineVec`. It is a `Vec`-like object, but has several
limitations (including arithmetic operators like `+` won't work).
Arithmetic assignment operators are useful so you don't have to create
impossible intermediate values.
2021-01-13 09:19:34 -07:00
Kenneth Moreland
1cc6dbb0c2 Allow VecBaseCommon operators to work with any Vec-like
Previously, the arithmetic assignment operators (`+=`, `-=`, `*=`, `/=`)
on `VecBaseCommon` only accepted another subclass of `VecBaseCommon`.
Changed the operators to accept any type.

The benefit of this change is that the assignment operator of classes
that inherit from `VecBaseCommon` can now work with `Vec`-like classes
that do not inherit from `VecBaseCommon`. I think the only real downside
is that the template could match other classes that would lead to
invalid comparisons. But such use would lead to a compile error anyway.
The difference is that instead of getting an error that no overloaded
version of the operator is available, you will get an error inside the
code of the operator.
2021-01-13 09:19:34 -07:00
Kenneth Moreland
74536d4ca1 Support Vec operators on ArrayPortalValueReference 2021-01-13 09:19:33 -07:00
Kenneth Moreland
06c59fed13 Update MapFieldMergeAverage/Permuation to use new CastAndCall
These functions now use
`UnknownArrayHandle::CastAndCallWithExtractedArray` to reduce the number
of times the worklet is run.
2021-01-13 09:19:33 -07:00
Kenneth Moreland
f90c2bfd0b Add UnknownArrayHandle::CastAndCallWithExtractedArray
This provides a convenience for calling a function for most
`ArrayHandle` types.
2021-01-13 09:19:33 -07:00
Kenneth Moreland
97324e75cd Enable reinterpreting UnknownArrayHandle to compatible C types
The base C types have several "duplicate" types that the compiler
considers different even though the byte representation is the same. For
example, `char` and `signed char` have the same meaning but are treated
as different types. Likewise, 'long', 'int', and 'long long' are all
different types even though 'long' is the same as either 'int' or 'long
long'.

When pulling extracted components from `UnknownArrayHandle`, there is
little value for creating multiple code paths for types like `char` and
`signed char`. Instead, allow implicit conversion among these types.
2021-01-13 09:19:27 -07:00
Kenneth Moreland
3228752b2d Fix error message when using deprecated storage
When using the old style of storage, you need to declare it as the old
style so that a bridge to the new style can be built in. You get a
compile error message if this is not done. The previous message gave the
wrong instructions.
2021-01-12 07:18:08 -07:00
Kenneth Moreland
5ef4e7eeee Make new style of ArrayHandle the expected style
What was previously declared as `ArrayHandleNewStyle` is now just the
implementation of `ArrayHandle`. The old implementation of `ArrayHandle`
has been moved to `ArrayHandleDeprecated`, and `ArrayHandle`s still
using this implementation must declare `VTKM_ARRAY_HANDLE_DEPRECATED` to
use it.
2021-01-12 07:17:53 -07:00
Kenneth Moreland
b4ca18607c Merge topic 'recombine-vec-array'
f941cb607 Move Fetch specializations to vtkm/exec/arg
439c18cfc Add changedoc for ArrayHandleRecombineVec
9833f3d0d Fix issue with using recombined vec as an output array
7dd9b4252 Add UnknownArrayHandle::ExtractArrayFromComponents
755af739e Add ArrayHandleRecombineVec

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2372
2021-01-11 13:50:57 -05:00
Robert Maynard
ca8e4fe09a Merge topic 'correct_atomic_unused_warnings_msvc'
c5efdb39a vtkm/Atomic doesn't generate unused parameter warnings on MSVC

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Vicente Bolea <vicente.bolea@kitware.com>
Merge-request: !2380
2021-01-11 13:27:33 -05:00
Kenneth Moreland
f941cb607c Move Fetch specializations to vtkm/exec/arg
Some of the special `ArrayHandle`s require specialized versions of
`vtkm::exec::arg::Fetch`. The specializations were not put in the
respective vtkm/exec/arg/Fetch*.h header files because the definition of
the `ArrayHandle`s was not available there. The implementation was in
the ArrayHandle*.h files, but it is hard to find the specialization
there.

Instead, make a secondary header file in vtkm/exec/arg that implements
the Fetch specialization and include it from the ArrayHandle*.h file.
That way, the basic Fetch does not have to include odd `ArrayHandle`
types but the `Fetch` implemenations are still all located together.
2021-01-11 10:47:58 -07:00
Robert Maynard
c5efdb39ac vtkm/Atomic doesn't generate unused parameter warnings on MSVC 2021-01-11 09:01:48 -05:00
Sujin Philip
4fac642273 Merge topic 'kokkos-opt-scan'
e57f5a175 Fix DeviceAdapterAlgorithmGeneral Reduce
1b7fc3d3e Use `Kokkos::parallel_scan` for Scan functionality

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2360
2021-01-08 10:33:12 -05:00
Sujin Philip
e57f5a175d Fix DeviceAdapterAlgorithmGeneral Reduce
It was using `ArrayHandleImplicit` in an unsupported manner.
2021-01-07 16:24:53 -05:00
Sujin Philip
1b7fc3d3e4 Use Kokkos::parallel_scan for Scan functionality 2021-01-07 16:24:39 -05:00
Kenneth Moreland
fa876efc90 Correct documentation for AtomicArrayExecutionObject
The code example had errors that would prevent it from compiling
correctly.
2021-01-07 13:57:38 -07:00
Robert Maynard
df93250969 Merge topic 'flying_edges_support_kokkos'
ebf648906 FlyingEdges uses optimized Y axis algorithm for Kokkos device

Acked-by: Kitware Robot <kwrobot@kitware.com>
Rejected-by: Robert Maynard <robert.maynard@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !2367
2021-01-07 15:16:09 -05:00
Kenneth Moreland
318a03019f Merge topic 'undeprecate-unknownarrayhandle-numberofcomponents'
d91b4f356 Undeprecate UnknownArrayHandle::GetNumberOfComponents

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2377
2021-01-07 15:03:53 -05:00
Robert Maynard
ebf648906f FlyingEdges uses optimized Y axis algorithm for Kokkos device 2021-01-07 13:46:42 -05:00
Kenneth Moreland
d91b4f3568 Undeprecate UnknownArrayHandle::GetNumberOfComponents
This method was originally deprecated to avoid confusion with the
indexing of the components in `ExtractComponent`. However, there might
be good reason to want to know the non-flat number of components, so
maybe getting rid of it is not a great idea. Unmark the method as
deprecated, at least for now.
2021-01-07 09:48:25 -07:00
nadavi
a31293da7f Add uniformat grid contour regression tests
Fixes #576

The Y-axis flying edge bug(s) had been fixed in !2197, and so
now we can test uniform data
2021-01-07 11:26:24 -05:00
Kenneth Moreland
cecd81d5db Add types appropriate for Ascent 2021-01-07 08:15:17 -07:00
nadavi
dd3193d69d consolidate contour-wedge baseline images to favor new pixel diff calculation 2021-01-06 20:50:50 +00:00
nadavi
da751cf061 change arg ordering, support setting number of error pixels allowed 2021-01-06 20:50:49 +00:00
Kenneth Moreland
50ff9c22aa Add support of ArrayHandleSOA as a default storage type 2021-01-06 13:20:58 -07:00
Kenneth Moreland
bc09a9cd15 Add precompiled versions of ArrayRangeCompute for ArrayHandleSOA 2021-01-06 13:20:58 -07:00
Kenneth Moreland
77f9ae653d Support ArrayHandleSOA only for Vec value types
Previously, `ArrayHandleSOA` worked with any value type that supported
`VecTraits`. That means that `ArrayHandleSOA` worked with scalar types
like `Float32`. However, for scalar types, the behavior is essentially
the same as `ArrayHandleBasic`, but with lots of extra templating and
code generation.

Although there is nothing _wrong_ with allowing `ArrayHandleSOA` holding
a scalar, there is no real reason to either (other than likely template
convenience). Generally, there is nothing wrong with supporting it, but
if you want to support `ArrayHandleSOA` in places where types are not
known (e.g. `Field`), then templating tends to iterate over the cross of
all supported types with all supported storage. That means such code
will automatically generate a bunch of code for `ArrayHandleSOA` with
scalars even if there is no reason for those code paths.

So, we can just disable the use of `ArrayHandleSOA` with scalars to
allow us to use `ArrayHandleSOA` as a default storage without creating
all these useless code paths.
2021-01-06 13:20:58 -07:00
Li-Ta Lo
d81f08eedb correct copyright mesage 2021-01-05 13:29:35 -07:00
Li-Ta Lo
6af7c3122a making WriteDataSet virtual 2021-01-05 12:59:52 -07:00
Kenneth Moreland
9833f3d0da Fix issue with using recombined vec as an output array
`ArrayHandleRecombineVec` is used when calling
`ExtractArrayFromComponents` from `UnkownArrayHandle`. It needs special
handling with the `Fetch` for an output array.
2021-01-04 14:21:32 -07:00
Kenneth Moreland
7dd9b4252a Add UnknownArrayHandle::ExtractArrayFromComponents
This method allows you to extract an `ArrayHandle` from
`UnknownArrayHandle` when you only know the base component type.

Also removed the `Read/WritePortalForBaseComponentType` method
from `UnknownArrayHandle`. This functionality is subsumed by
`ExtractArrayFromComponents`.
2021-01-04 14:17:24 -07:00
Kenneth Moreland
755af739e3 Add ArrayHandleRecombineVec
The primary purpose of `ArrayHandleRecombineVec` is to take arrays
returned from `ArrayExtractComponent` and recombine them again into a
single `ArrayHandle` that has `Vec` values.
2021-01-04 11:55:02 -07:00
Li-Ta Lo
fac489644f HDF5 unit tests
Move HDF5ImageWriter/Reader to its own unit test. Use user supplied
field name as HDF5 dataset name.
2021-01-04 10:01:49 -07:00
Li-Ta Lo
03cb5cb43c rename file names and add reference to the specification 2021-01-04 09:04:08 -07:00
Robert Maynard
90c607c999 Correct CMake checking for targets before creation 2020-12-30 12:42:51 -05:00
Robert Maynard
4c2f8cc635 Merge topic 'workaround_hip_min_bug'
0134de4fe Don't use HIP overloads for std::min

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !2366
2020-12-29 08:55:03 -05:00
Robert Maynard
0134de4fe4 Don't use HIP overloads for std::min
The HIP overloads for std::min don't return the first parameter
when the two values are equal which causes problems when inputs
such as nan.

Reported upstream:
https://github.com/ROCm-Developer-Tools/HIP/issues/2209
2020-12-28 13:29:32 -05:00
Robert Maynard
7897d23c39 Cleanup some minor CMake style issues 2020-12-28 10:36:00 -05:00
Li-Ta Lo
da7d6aaf19 Add HDF5 Image file support 2020-12-25 16:02:08 -07:00
Kenneth Moreland
932c8e5ec0 Wrap test_equal_ArrayHandles into a precompiled library
The previous implementation of test_equal_ArrayHandles was several
templates that had to be resolved by any test that used them, which
could be costly for unknown array types. Simplify this a bit by moving
the implementation of testing unknown arrays into a library.

Another advantage of the new implementation is that is handles more
cases. Thus, you should not need to `ResetTypes` on the unknown/
uncertain arrays.
2020-12-22 17:17:19 -07:00
Kenneth Moreland
5610d674d8 Print TestEqualResult messages in VTK_TEST_ASSERT
Some of the `test_equal` functions return a `TestEqualResult`
instead of a `bool` to capture more information about what
the error was. Unfortunately, using this was awkward because
you couldn't just call the `test_equal_*` inside of a
`VTKM_TEST_ASSERT`. Rather, you would have to do the comparison
and then check it.

This change adds an overload to `VTKM_TEST_ASSERT` that specifically
takes a `TestEqualResult`, checks its condition, and prints out
the contained messages. Thus, your command can just look like
`VTKM_TEST_ASSERT(test_equal_ArrayHandles(...));` and it will
provide the additional information.
2020-12-22 17:17:10 -07:00
Kenneth Moreland
84bfcc238c Move test_equal_* classes to top namespace
These helper functions were in vtkm::cont::testing, but that made them
hard to discover (and I personally kept forgetting about them). Move
them to the top namespace so that IDE of test_equal will helpfully
remind us of these other test functions.
2020-12-22 13:46:02 -07:00
Kenneth Moreland
16471fcaff Fix ArrayHandleView compile error caused by merge error
Recent merge requests !2354 and !2356 both edited ArrayHandleView. Git
successfully merged the changes, but the changes were still incompatible
with each other, causing an unexpected compile error on master. This
fixes the issue.
2020-12-22 07:47:33 -07:00
Kenneth Moreland
39715c92da Merge topic 'arrayhandleview-use-buffer'
1ed8b1f68 Convert ArrayHandleView to new buffer-style array

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2356
2020-12-22 09:32:16 -05:00
Kenneth Moreland
e56c6af41c Merge topic 'array-handle-stride'
7935716f8 Fix warning in VecFlat
8dfd01942 Add changelog for extract component
03c3f9e17 Update `MapField` helper functions to use extracted array components
67507185c Add ability to extract components in `UnknownArrayHandle`
0f24f82da Disable resizing of `ArrayHandleStride`
760553725 Add ArrayExtractComponent function
0ab3edd87 Add VecFlat class
73af6e679 Add ArrayHandleStride

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2354
2020-12-22 09:27:32 -05:00
Kenneth Moreland
1ed8b1f688 Convert ArrayHandleView to new buffer-style array 2020-12-21 07:51:42 -07:00
Kenneth Moreland
3eeeb1cb08 Merge topic 'arrayhandlegroupvecvariable-use-buffer'
802d78828 Convert ArrayHandleGroupVecVariable to new buffer-style arrays

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2357
2020-12-18 16:06:35 -05:00
Kenneth Moreland
a5d57e7440 Convert ArrayHandleConcatenate to new buffer-style arrays 2020-12-17 14:58:09 -07:00
Kenneth Moreland
802d788289 Convert ArrayHandleGroupVecVariable to new buffer-style arrays 2020-12-17 14:06:56 -07:00
Kenneth Moreland
7935716f8a Fix warning in VecFlat
`VecFlat` has a casting operator to cast itself to the nested version of
the `Vec`. However, for a simple `Vec` type, the superclass of `VecFlat`
is the same type as the "nested" `Vec` type (which was flat to begin
with). This meant that the casting operator was never used because it
casted to the same type as the object being cast from. Most compilers
silently ignored this, but some gave a warning that the casting operator
would never be used because of this condition.

Fix the problem by having a different implemention of `VecFlat` when
applied to a `Vec` that is already flat.
2020-12-17 13:39:02 -07:00
Kenneth Moreland
599c2f6391 Convert ArrayHandlePermutation to new buffer-style array 2020-12-17 09:00:03 -07:00
Kenneth Moreland
03c3f9e178 Update MapField helper functions to use extracted array components
Previously, the `MapFieldMergeAverage` and `MapFieldPermutation` helper
function had to iterate over every possible type and create a separate
code path. This change uses the new extract component functionality to
create separate code paths only for different component types. This both
requires less code (the common filter library dropped from 66MB to 42MB
on my Mac) and covers more cases (such as `Vec`s larger than 4
components).

To make the implementation easier, `UnknownArrayHandle` now can create a
new `UnknownArrayHandle` of the same `ValueType` but with the basic
storage (so you can work with read-only storage) and the ability to
allocate the unknown array.
2020-12-16 17:23:35 -07:00
Kenneth Moreland
67507185ce Add ability to extract components in UnknownArrayHandle
This allows you to handle just about every type of array with about 10
basic types. It allows you to ignore both the size of `Vec`s and the
actual storage of the data.
2020-12-16 17:23:27 -07:00
Kenneth Moreland
0f24f82dad Disable resizing of ArrayHandleStride
The typical use case of `ArrayHandleStride` is to flexibly point into
another array, often looking at a single component in an array. It is
typical that multiple things will be accessing the same array, and bad
things could happen as they all try to resize. There was some code to
try to figure out what the size of the original array was, but it was
fragile.

It is safer for now to disable the behavior altogether. If a use case
pops up, we can reintroduce the code.
2020-12-16 17:22:44 -07:00
Kenneth Moreland
760553725c Add ArrayExtractComponent function
`ArrayExtractComponent` allows you to get a component of an array.
Unlike `ArrayHandleExtractComponent`, the type you get is always the
same: an `ArrayHandleStride`. This way, you can get an array that
contains the data of an extracted component with less templating and
potentially dramatically reduce the amount of code generated (although
some runtime integer arithmetic is added).
2020-12-16 17:22:44 -07:00
Kenneth Moreland
0ab3edd87d Add VecFlat class
`vtkm::VecFlat` is a wrapper around a `Vec`-like class that may be a
nested series of vectors. For example, if you run a gradient operation
on a vector field, you are probably going to get a `Vec` of `Vec`s that
looks something like `vtkm::Vec<vtkm::Vec<vtkm::Float32, 3>, 3>`. That
is fine, but what if you want to treat the result simply as a `Vec` of
size 9?

The `VecFlat` wrapper class allows you to do this. Simply place the
nested `Vec` as an argument to `VecFlat` and it will behave as a flat
`Vec` class. (In fact, `VecFlat` is a subclass of `Vec`.) The `VecFlat`
class can be copied to and from the nested `Vec` it is wrapping.

There is a `vtkm::make_VecFlat` convenience function that takes an
object and returns a `vtkm::VecFlat` wrapped around it.
2020-12-16 17:22:44 -07:00
Kenneth Moreland
73af6e6795 Add ArrayHandleStride 2020-12-16 17:22:44 -07:00
Robert Maynard
004f320e20 Merge topic 'expand_kokkos_device_to_support_hip'
7475c318b VTK-m now uses CMake's future HIP lang for Kokkos+HIP

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Sujin Philip <sujin.philip@kitware.com>
Merge-request: !2351
2020-12-16 08:58:17 -05:00
Kenneth Moreland
fd07c241e2 Merge topic 'release-read-only'
7811cc4b1 Add standard support for read-only storage
a6b9d5c49 Add tests for ReleaseResources of fancy arrays

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2345
2020-12-14 10:03:20 -05:00
Robert Maynard
7475c318be VTK-m now uses CMake's future HIP lang for Kokkos+HIP 2020-12-11 09:13:12 -05:00