Redesign StorageBasic to allow modification of user provided memory.
The driving desire for this change was to make vtk-m ArrayHandle behave more like the standard vector. The canonical example of what we want to support is:
std::vector<vtkm::Id> values;
values.resize(100);
vtkm::cont::ArrayHandle<vtkm::Id> array = vtkm::cont::make_ArrayHandle(values);
vtkm::cont::DeviceAdapterAlgorithm<DeviceAdapter>::Sort(array);
And with-out the ability to modify user provided memory, this was impossible.
Merge request reports
Activity
@kmorel, @jsmeredith, @chrismsewell, @dpugmire
Here are the modifications to StorageBasic that allow modification of user's data from an ArrayHandle. It should be noted, that an ArrayHandle that is allocated with users data, can not be resized to a larger size as that would invalidate the pointer to the users data.
Please register or sign in to reply