vtk-m/vtkm/exec
Kenneth Moreland c9bcdd0195 Use a union in Variant for safe type punning
Create a `VaraintUnion` that is an actual C++ `union` to store the data
in a `Variant`.

You may be asking yourself, why not just use an `std::aligned_union`
rather than a real union type? That was our first implementation, but
the problem is that the `std::aligned_union` reference needs to be
recast to the actual type. Typically you would do that with
`reinterpret_cast`. However, doing that leads to undefined behavior. The
C++ compiler assumes that 2 pointers of different types point to
different memory (even if it is clear that they are set to the same
address). That means optimizers can remove code because it "knows" that
data in one type cannot affect data in another type. To safely change
the type of an `std::aligned_union`, you really have to do an
`std::memcpy`. This is problematic for types that cannot be trivially
copied. Another problem is that we found that device compilers do not
optimize the memcpy as well as most CPU compilers. Likely, memcpy is
used much less frequently on GPU devices.
2021-03-30 10:16:16 -06:00
..
arg removing ArrayHandleExtrude* 2021-02-10 15:20:35 -05:00
cuda Deprecate ArrayHandle::ExecutionTypes 2021-02-08 12:17:37 -07:00
internal Use a union in Variant for safe type punning 2021-03-30 10:16:16 -06:00
kokkos Add Kokkos backend 2020-08-12 13:55:24 -04:00
openmp Label tests which exercise a given Device Adapter 2019-09-13 15:52:40 -04:00
serial Remove ArrayHandleStreaming capabilities 2020-03-24 15:01:56 -06:00
tbb Label tests which exercise a given Device Adapter 2019-09-13 15:52:40 -04:00
testing Revert change the removes printing of seed. 2020-11-18 11:03:19 -05:00
AtomicArrayExecutionObject.h Add floating point atomics 2021-03-11 08:19:51 -07:00
BoundaryState.h Optimize StructuredPointGradient for non boundary points. 2020-05-22 14:58:38 -04:00
CellDerivative.h Remove some unneeded include statements from vtkm/exec 2020-06-22 09:28:51 -04:00
CellEdge.h Remove some unneeded include statements from vtkm/exec 2020-06-22 09:28:51 -04:00
CellFace.h clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
CellInside.h Switch from VTK-c to LCL 2019-10-07 15:38:36 -04:00
CellInterpolate.h Remove some unneeded include statements from vtkm/exec 2020-06-22 09:28:51 -04:00
CellLocator.h Fix compile errors and warnings related to new CellLocator structure 2021-02-15 12:39:11 -07:00
CellLocatorBoundingIntervalHierarchy.h Support deprecated behavior of point locator pointers 2021-02-18 13:11:54 -07:00
CellLocatorMultiplexer.h Support deprecated behavior of point locator pointers 2021-02-18 13:11:54 -07:00
CellLocatorRectilinearGrid.h Support deprecated behavior of point locator pointers 2021-02-18 13:11:54 -07:00
CellLocatorTwoLevel.h Support deprecated behavior of point locator pointers 2021-02-18 13:11:54 -07:00
CellLocatorUniformGrid.h Support deprecated behavior of point locator pointers 2021-02-18 13:11:54 -07:00
CellMeasure.h clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
CMakeLists.txt Remove virtual methods from cell locators 2021-02-15 12:39:11 -07:00
ColorTable.h Remove virtual methods from ColorTable 2020-09-14 13:26:16 -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 Correct warnings found by GCC 9.2 2019-12-02 09:33:35 -05:00
ConnectivityStructured.h Add CellNeighborhood 2020-07-15 14:41:32 -06:00
ExecutionWholeArray.h Make ExecutionWholeArray objects not depend on device type 2021-02-09 19:16:51 -07: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 Make sure return value of cell operations is initialized 2020-03-14 00:24:13 -06:00
PointLocator.h implement PointLocator without virtual methods 2021-02-17 17:16:17 +00:00
PointLocatorSparseGrid.h Support deprecated behavior of point locator pointers 2021-02-18 13:11:54 -07:00
TaskBase.h conslidate the license statement 2019-04-17 10:57:13 -06:00