vtk-m/vtkm/cont/cuda
hschroot 20c1a04894 CopyInto function for ArrayHandles
ArrayHandles in DAX have a CopyInto function which allows the user to copy an array handle's data into a compatible STL type iterator. Originally this was fairly straight forward to implement since array handles in DAX are templated on the DeviceAdapterTag. In contrast, VTKm array handles use a polymorphic ArrayHandleExecutionManager under the hood allowing a single array handle to interface with multiple devices at runtime. To achieve this virtual functions are used. This makes implementing the CopyInto function difficult since it is templated on the IteratorType and virtual functions cannot be templated.

To work around this, I've implemented a concrete templated CopyInto function in the class derived from ArrayHandleExecutionManagerBase. In the ArrayHandle class, CopyInto dynamically casts the base class into the derived class, then calls the CopyInto function defined in the derived class.

The drawback to this approach is that, should the user define their own class that inherits from ArrayHandleExectionManagerBase, they are not forced to implement the CopyInto function, unlike the other virtual functions.
2015-09-17 14:26:19 -04:00
..
internal CopyInto function for ArrayHandles 2015-09-17 14:26:19 -04:00
testing Add compute bounds to Fields 2015-07-22 12:17:33 -04:00
ChooseCudaDevice.h Make ChooseCudaDevice only consider SM3 and above equal. 2015-06-30 08:18:16 -04:00
CMakeLists.txt Always install all device headers even when device isn't enabled. 2015-09-17 09:28:21 -04:00
DeviceAdapterCuda.h DeviceAdapter Tags now always exist, and contain if the device is valid. 2015-09-17 09:28:21 -04:00