vtk-m/vtkm
Kenneth Moreland eda6dc39f2 Support using arrays with dynamic Vec-likes as output arrays
When you use an `ArrayHandle` as an output array in a worklet (for example,
as a `FieldOut`), the fetch operation does not read values from the array
during the `Load`. Instead, it just constructs a new object. This makes
sense as an output array is expected to have garbage in it anyway.

This is a problem for some special arrays that contain `Vec`-like objects
that are sized dynamically. For example, if you use an
`ArrayHandleGroupVecVariable`, each entry is a dynamically sized `Vec`. The
array is referenced by creating a special version of `Vec` that holds a
reference to the array portal and an index. Components are retrieved and
set by accessing the memory in the array portal. This allows us to have a
dynamically sized `Vec` in the execution environment without having to
allocate within the worklet.

The problem comes when we want to use one of these arrays with `Vec`-like
objects for an output. The typical fetch fails because you cannot construct
one of these `Vec`-like objects without an array portal to bind it to. In
these cases, we need the fetch to create the `Vec`-like object by reading
it from the array. Even though the data will be garbage, you get the
necessary buffer into the array (and nothing more).

Previously, the problem was fixed by creating partial specializations of
the `Fetch` for these `ArrayHandle`s. This worked OK as long as you were
using the array directly. However, the approach failed if the `ArrayHandle`
was wrapped in another `ArrayHandle` (for example, if an `ArrayHandleView`
was applied to an `ArrayHandleGroupVecVariable`).

To get around this problem and simplify things, the basic `Fetch` for
direct output arrays is changed to handle all cases where the values in the
`ArrayHandle` cannot be directly constructed. A compile-time check of the
array's value type is checked with `std::is_default_constructible`. If it
can be constructed, then the array is not accessed. If it cannot be
constructed, then it grabs a value out of the array.
2023-01-23 13:02:40 -07:00
..
cont Support using arrays with dynamic Vec-likes as output arrays 2023-01-23 13:02:40 -07:00
exec Support using arrays with dynamic Vec-likes as output arrays 2023-01-23 13:02:40 -07:00
filter Resolve sprintf warning 2023-01-10 10:38:29 -07:00
internal CMAKE: fix vtkm devices namespaces 2022-12-26 13:40:12 -05:00
interop Add module mechanism 2022-10-26 12:51:05 -06:00
io Merge branch 'master' into add_hdf5_reader 2023-01-16 17:56:36 -08:00
random Add module mechanism 2022-10-26 12:51:05 -06:00
rendering Remove deprecated features from VTK-m 2022-11-17 07:12:31 -06:00
source Change auto seed behavior in PerlinNoise source 2022-12-06 12:21:04 -07:00
testing Remove deprecated features from VTK-m 2022-11-17 07:12:31 -06:00
thirdparty cmake: namespace vtkm export targets 2022-12-09 18:46:56 -05:00
worklet cmake: namespace vtkm export targets 2022-12-09 18:46:56 -05:00
.gitattributes diy 2019-04-09 (f7a68da4) 2019-04-09 11:42:54 -04:00
Assert.h Disable VTKM_ASSERT when using HIP 2020-09-25 11:06:57 -04:00
Atomic.h CI: updates kokkos version 2021-09-20 18:23:16 -04:00
BinaryOperators.h Make BinaryOperators/Predicates more flexible. 2019-12-18 15:51:59 -05:00
BinaryPredicates.h Make BinaryOperators/Predicates more flexible. 2019-12-18 15:51:59 -05:00
Bitset.h Add unittest for particlearraycopy 2020-06-18 15:45:36 -04:00
Bounds.h Add a new unstructured cell locator 2022-11-22 09:51:40 -05:00
CellClassification.h Remove deprecated features from VTK-m 2022-11-17 07:12:31 -06:00
CellShape.h clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
CellTraits.h clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
CMakeLists.txt Remove deprecated features from VTK-m 2022-11-17 07:12:31 -06:00
Deprecated.h Disable deprecation for MSVC 2017 2021-04-26 12:47:44 -06:00
ErrorCode.h clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
Flags.h conslidate the license statement 2019-04-17 10:57:13 -06:00
Geometry.h conslidate the license statement 2019-04-17 10:57:13 -06:00
Geometry.hxx Update vtkm/Geometry.hxx to follow clangs rules on function markup 2020-09-25 09:37:46 -04:00
Hash.h conslidate the license statement 2019-04-17 10:57:13 -06:00
ImplicitFunction.h Remove deprecated features from VTK-m 2022-11-17 07:12:31 -06:00
List.h Remove deprecated features from VTK-m 2022-11-17 07:12:31 -06:00
LowerBound.h split vtkm/Algorithms.h into UpperBound.h, LowerBound.h, and BinarySearch.h 2021-04-07 18:53:09 +00:00
Math.h Fix unresolved external symbol __popcnt on win-arm64 2022-11-27 19:51:17 -05:00
Math.h.in Fix unresolved external symbol __popcnt on win-arm64 2022-11-27 19:46:13 -05:00
Matrix.h Break LUP factorization when invalid matrix found 2021-07-12 10:29:46 -06:00
NewtonsMethod.h conslidate the license statement 2019-04-17 10:57:13 -06:00
Pair.h conslidate the license statement 2019-04-17 10:57:13 -06:00
Particle.h Hide Particle class members 2022-12-13 13:19:21 -05:00
Range.h Add implementation of VecTraits for Range and Bounds 2022-01-25 10:55:35 -07:00
RangeId2.h ExtractStructured now compiles quicker and with less compiler memory 2019-12-11 08:59:42 -05:00
RangeId3.h ExtractStructured now compiles quicker and with less compiler memory 2019-12-11 08:59:42 -05:00
RangeId.h ExtractStructured now compiles quicker and with less compiler memory 2019-12-11 08:59:42 -05:00
StaticAssert.h clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
Swap.h Fix compile issues when using cuda 12 2023-01-18 12:06:35 -05:00
TopologyElementTag.h clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
Transform3D.h conslidate the license statement 2019-04-17 10:57:13 -06:00
Tuple.h Update vtk-m doxygen to generate less warnings 2020-06-01 16:58:32 -04:00
Tuple.h.in Update doxygen comments in Tuple.h.in 2020-06-03 09:22:48 -06:00
TypeList.h Enable reinterpreting UnknownArrayHandle to compatible C types 2021-01-13 09:19:27 -07:00
Types.h Allow for different types in basic type operators 2021-03-03 09:39:45 -07:00
TypeTraits.h Add implementation of ArrayRangeCompute for UnknownArrayHandle 2021-02-17 09:18:31 -07:00
UnaryPredicates.h conslidate the license statement 2019-04-17 10:57:13 -06:00
UpperBound.h split vtkm/Algorithms.h into UpperBound.h, LowerBound.h, and BinarySearch.h 2021-04-07 18:53:09 +00:00
VecAxisAlignedPointCoordinates.h Add VecFlat class 2020-12-16 17:22:44 -07:00
VecFlat.h Fix warning in VecFlat 2020-12-17 13:39:02 -07:00
VecFromPortal.h Support using arrays with dynamic Vec-likes as output arrays 2023-01-23 13:02:40 -07:00
VecFromPortalPermute.h Add recursive component queries to VecTraits 2019-09-09 08:19:15 -06:00
VectorAnalysis.h Avoid floating point exception in Orthonormalize 2021-07-12 10:29:46 -06:00
VecTraits.h Use types for different options in PA filters. 2022-06-23 15:25:31 -04:00
VecVariable.h Generalize fields for particle advection 2020-07-20 21:15:46 -04:00
Version.h.in conslidate the license statement 2019-04-17 10:57:13 -06:00
vtkm.module Add module mechanism 2022-10-26 12:51:05 -06:00