Commit Graph

2645 Commits

Author SHA1 Message Date
Kenneth Moreland
e0abb39810 Unify common storage types
The list defining the common storage types was defined in
DefaultTypes.h.in. The problem was that derived default types could not
just add their own type. They had to redefine the whole list.

Instead, move the list to StorageList.h. Also updated
DefaultTypesVTK.h.in to use this list when using XGC. This enables
ArrayHandleSOA for this case.
2021-05-13 08:18:33 -06:00
Nickolas Davis
c4117ede8a Merge topic 'prefix-cmd-line-args'
968c66f94 add TODO to update kokkos initialize
18d7827db update vtkm test arguments
5fa8734bb update vtkm initialize flags to have 'vtkm' prefix and deprecate old flags

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <morelandkd@ornl.gov>
Merge-request: !2456
2021-05-12 09:57:47 -04:00
Sujin Philip
7972070d7c PartitionedDataSet GetField should be const 2021-04-30 16:27:58 -04:00
nadavi
968c66f949 add TODO to update kokkos initialize 2021-04-29 00:58:50 +00:00
nadavi
18d7827db7 update vtkm test arguments 2021-04-29 00:58:50 +00:00
nadavi
5fa8734bbc update vtkm initialize flags to have 'vtkm' prefix and deprecate old flags 2021-04-29 00:58:50 +00:00
Kenneth Moreland
8eed21d085 Do not declare headers for virtual classes that are removed 2021-04-28 15:28:06 -06:00
Kenneth Moreland
cb3bb43ff9 Completely deprecate virtual methods
Deprecate `VirtualObjectHandle` and all other classes that are used to
implement objects with virtual methods in the execution environment.

Additionally, the code is updated so that if the
`VTKm_NO_DEPRECATED_VIRTUAL` flag is set none of the code is compiled at
all. This opens us up to opportunities that do not work with virtual
methods such as backends that do not support virtual methods and dynamic
libraries for CUDA.
2021-04-28 07:28:32 -06:00
Nick Thompson
9f1ef651c4 Update UnitTestError.cxx 2021-04-16 17:46:43 +00:00
Nick Thompson
794872eb07 Fix error in unit test. 2021-04-13 11:21:42 -04:00
Nick Thompson
9d6b732750 Use better variable names. 2021-04-12 18:51:53 -04:00
Nick Thompson
4133e40c06 Remove printing of expected errors. 2021-04-12 18:51:53 -04:00
Nick Thompson
eb760e04ef Revert removal of print statements. 2021-04-12 18:51:53 -04:00
Nick Thompson
e7c075b5c4 Remove unused variable. 2021-04-12 18:51:53 -04:00
Nick Thompson
cb83b81793 Save another 10 seconds. 2021-04-12 18:51:52 -04:00
Nick Thompson
1b11348cc3 Reduce data size to operate on in unit tests. 2021-04-12 18:51:52 -04:00
Nick Thompson
134c6c3d4e Speed up CellLocator tests. 2021-04-12 18:51:51 -04:00
Nick Thompson
33993db2df Reduce runtime of unit tests. 2021-04-12 18:51:51 -04:00
Nick Thompson
ff4ad96efc Do not print extra information on Kokkos and CUDA. 2021-04-12 15:01:07 -04:00
Nick Thompson
321571fabe Make sure operator precedence is correct over macro invocation. 2021-04-12 13:50:27 -04:00
Nick Thompson
94a32bf64c Improve code in response to review. 2021-04-12 13:42:19 -04:00
Nick Thompson
568c0b5d29 Small formatting changes. 2021-04-12 13:05:36 -04:00
Nick Thompson
a8e25da0ab Add __func__ to unit test metadata printed on failure. 2021-04-12 12:54:38 -04:00
Kenneth Moreland
14839a0325 Fix deprecation warnings with MSVC 2021-04-08 09:28:03 -06:00
Kenneth Moreland
5510521a06 Fix VariantArrayHandle::AsVirtual with cast arrays
The both the underlying `UnknownArrayHandle` and `ArrayHandleVirtual`
handle `ArrayHandleCast` specially. This caused problems when passing an
`ArrayHandleCast` to `VariantArrayHandle::AsVirtual`. Solve the problem
by stripping out the cast storage tags and letting these classes handle
it internally.

It's annoying to have to fix a problem in a method of a deprecated class
that returns another class that is deprecated for a different reason. No
one should really be running this.
2021-04-08 09:21:39 -06:00
Kenneth Moreland
b4ef9fcac3 Fix UnknownArrayHandle::CastAndCall for special arrays
`UnknownArrayHandle` treats a `ArrayHandleCast` and
`ArrayHandleMultiplexer` special. When you put one of these arrays in an
`UnknownArrayHandle`, it takes the original array out and stores it. If
you try to take an array of that type out, it will again do the proper
conversion.

The only problem is that if you use `IsType`, the result can be
unexpected. This is what happened with `CastAndCall`, which was using
`IsType` internally. Changed that to `CanConvert` to properly get the
array handle out.
2021-04-07 16:12:42 -06:00
Kenneth Moreland
68f39b86a8 Deprecate VariantArrayHandle
`VaraintArrayHandle` has been replaced by `UnknownArrayHandle` and
`UncertainArrayHandle`. Officially make it deprecated and point users to
the new implementations.
2021-04-07 16:12:38 -06:00
nadavi
26d9ecb398 split vtkm/Algorithms.h into UpperBound.h, LowerBound.h, and BinarySearch.h 2021-04-07 18:53:09 +00:00
Kenneth Moreland
3813fb515c Make ArrayPortalRecombineVec trivially copyable
Using this internal class is a bit tricky because it requires a pointer
to a C array that is expected to contain portals. Both the C array and
the portals must be defined for the expected device. This is already
handled by the associated Storage. Assuming all of this holds, make sure
the `ArrayPortalRecombineVec` is trivially copyable. This is a
requirement for passing objects to the execution environment.
2021-04-02 07:37:26 -06:00
Kenneth Moreland
26d5168b4d Fix types used for coordinates in ArrayRangeCompute
Was using scalar types for `ArrayRangeCompute` for storage of types like
Cartesian product. It should be `Vec3` types.
2021-03-30 09:37:34 -06:00
Kenneth Moreland
eadaf06f0c Set what string in Error::SetMessage
`vtkm::cont::Error` inherits from `std::exception`. As such, it has a
special `what` string that reports an error message in a standard way.
This is particularly useful when a `vtkm::cont::Error` exception remains
uncaught because the system will print the `what` string before
crashing.

Unfortunately, the `what` string was only being set in the `Error`
constructor that took a message. That is a problem for subclasses like
`ErrorCuda` that used the default constructor and then used
`SetMessage`. The `what` string did not get set in this case.

Change the behavior to capture the stack trace in the default
constructor and update the `what` string if a subclass uses
`SetMessage`.
2021-03-29 06:04:22 -06:00
Li-Ta Lo
9fbb916a00 Merge topic 'fp_atomics2'
b590a8ebb Add floating point atomics

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@acm.org>
Merge-request: !2438
2021-03-16 14:06:24 -04:00
Nick Thompson
d815493986 Merge topic 'write_cellset_extrude'
b1c0f46ac Response to code review.
4e7d85094 Remove default template argument that breaks build.
4cb661006 Implement GetIndices.
2d35ab05a Write CellSetExtrude as CellSetExplicit.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Dave Pugmire <dpugmire@gmail.com>
Merge-request: !2436
2021-03-12 19:32:55 -05:00
Nick Thompson
b1c0f46ac0 Response to code review. 2021-03-12 21:14:50 +00:00
Nick Thompson
4e7d85094e Remove default template argument that breaks build. 2021-03-12 15:37:32 -05:00
Nick Thompson
4cb661006e Implement GetIndices. 2021-03-12 14:40:27 -05:00
Li-Ta Lo
b590a8ebb2 Add floating point atomics 2021-03-11 08:19:51 -07:00
Kenneth Moreland
91d13bdfb2 Merge topic 'reduce-initial-type'
563e23aac Fix unintended cast in TBB Reduce's return value
a7100c845 Do not assume CUDA reduce operator is unary
f3a6931f6 Fix casting issues in TBB functors
cc5b9a016 Add casts to FunctorsGeneral.h
d9c988b20 Allow for different types in basic type operators

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2431
2021-03-08 18:06:51 -05:00
Kenneth Moreland
563e23aaca Fix unintended cast in TBB Reduce's return value
It was setting the return value type the same as the initial value.
However, the value type can change based on the array type and the
operator.
2021-03-08 14:12:20 -07: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
21a3137000 kick the builds 2021-03-02 13:47:11 -05:00
dpugmire
565522eb62 Add ArrayHandleSOA to default 2021-03-02 12:09:26 -05: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
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
ffb0548b92 adding missing header 2021-02-26 07:17:52 -08: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