mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-16 17:22:55 +00:00
c123796949
Previously memory that was allocated outside of VTK-m was impossible to transfer to VTK-m as we didn't know how to free it. By extending the ArrayHandle constructors to support a Storage object that is being moved, we can clearly express that the ArrayHandle now owns memory it didn't allocate. Here is an example of how this is done: ```cpp T* buffer = new T[100]; auto user_free_function = [](void* ptr) { delete[] static_cast<T*>(ptr); }; vtkm::cont::internal::Storage<T, vtkm::cont::StorageTagBasic> storage(buffer, 100, user_free_function); vtkm::cont::ArrayHandle<T> arrayHandle(std::move(storage)); ``` |
||
---|---|---|
.. | ||
internal | ||
testing | ||
ChooseCudaDevice.h | ||
CMakeLists.txt | ||
DeviceAdapterCuda.h | ||
ErrorCuda.h |