vtk-m/vtkm/exec
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
..
arg Support using arrays with dynamic Vec-likes as output arrays 2023-01-23 13:02:40 -07:00
cuda Fix compile issues when using cuda 12 2023-01-18 12:06:35 -05:00
internal Expose the Variant helper class 2022-11-01 07:52:41 -06:00
kokkos Add module mechanism 2022-10-26 12:51:05 -06:00
openmp cmake: namespace vtkm export targets 2022-12-09 18:46:56 -05:00
serial Add module mechanism 2022-10-26 12:51:05 -06:00
tbb cmake: namespace vtkm export targets 2022-12-09 18:46:56 -05:00
testing Expose the Variant helper class 2022-11-01 07:52:41 -06:00
AtomicArrayExecutionObject.h Remove deprecated features from VTK-m 2022-11-17 07:12:31 -06:00
BoundaryState.h Fix doxygen groups 2022-09-09 10:37:31 +08:00
CellDerivative.h Remove deprecated features from VTK-m 2022-11-17 07:12:31 -06:00
CellEdge.h Remove deprecated features from VTK-m 2022-11-17 07:12:31 -06:00
CellFace.h Remove deprecated features from VTK-m 2022-11-17 07:12:31 -06:00
CellInside.h Switch from VTK-c to LCL 2019-10-07 15:38:36 -04:00
CellInterpolate.h Remove deprecated features from VTK-m 2022-11-17 07:12:31 -06:00
CellLocatorBoundingIntervalHierarchy.h Remove deprecated features from VTK-m 2022-11-17 07:12:31 -06:00
CellLocatorMultiplexer.h Remove deprecated features from VTK-m 2022-11-17 07:12:31 -06:00
CellLocatorPartitioned.h add partitioned cell locator 2022-11-01 11:08:18 +01:00
CellLocatorRectilinearGrid.h Remove deprecated features from VTK-m 2022-11-17 07:12:31 -06:00
CellLocatorTwoLevel.h Remove deprecated features from VTK-m 2022-11-17 07:12:31 -06:00
CellLocatorUniformBins.h Add a new unstructured cell locator 2022-11-22 09:51:40 -05:00
CellLocatorUniformGrid.h Remove deprecated features from VTK-m 2022-11-17 07:12:31 -06:00
CellMeasure.h Fixing dashboard warnings 2022-02-02 16:15:12 +05:30
CMakeLists.txt Add a new unstructured cell locator 2022-11-22 09:51:40 -05:00
ColorTable.h Remove deprecated features from VTK-m 2022-11-17 07:12:31 -06:00
ColorTable.hxx Fix warning about return value 2020-09-14 15:04:03 -06:00
ConnectivityExplicit.h Refactor CellSetExplicit to remove NumIndices. 2019-09-30 12:27:13 -04:00
ConnectivityExtrude.h Update CellSetExtrude to not specify exec types by device 2021-02-08 16:57:16 -07:00
ConnectivityPermuted.h Make connectivity structures trivially copyable 2021-03-30 12:59:07 -06:00
ConnectivityStructured.h Make connectivity structures trivially copyable 2021-03-30 12:59:07 -06:00
FieldNeighborhood.h Add CellNeighborhood 2020-07-15 14:41:32 -06:00
FunctorBase.h Always export VTK-m functor symbols 2019-08-01 12:53:54 -04:00
ParametricCoordinates.h Remove deprecated features from VTK-m 2022-11-17 07:12:31 -06:00
PointLocatorSparseGrid.h Remove deprecated features from VTK-m 2022-11-17 07:12:31 -06:00
TaskBase.h conslidate the license statement 2019-04-17 10:57:13 -06:00
Variant.h Expose the Variant helper class 2022-11-01 07:52:41 -06:00
vtkm.module Add module mechanism 2022-10-26 12:51:05 -06:00