You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RMM implements DeviceBuffer which is Cython native class wrapping around something similar to std::vector<unsigned char, custom_cuda_allocator (calls resource manager)> which is called device_buffer.
DeviceBuffer stores a unique pointer to an instance of this class. DeviceBuffer implements __cuda_array_interface__. Direct constructors always allocate new memory and copy provided inputs into the newly allocated array.
Zero-copy construction is possible from a unique_ptr<device_ buffer>, with the ownership being moved to the Cython extension instance.
DeviceBuffer provides __reduce__ method to support pickling (which works by copying content of the device buffer to host) and provides the following set of routines, among others:
copy_to_host(host_buf_obj) to copy content of the underlying device_buffer to a host buffer
copy_from_host(host_buf_obf) to copy content of the host buffer into memory of underlying device_buffer
copy_from_device(cuda_ary_obj) to copy device memory underyling cuda_ary_obj Python object implementing __cuda_array_interface__ to the memory underlying DeviceBuffer instance.
Activity
oleksandr-pavlyk commentedon Oct 20, 2020
RMM implements
DeviceBufferwhich is Cython native class wrapping around something similar tostd::vector<unsigned char, custom_cuda_allocator (calls resource manager)>which is calleddevice_buffer.DeviceBufferstores a unique pointer to an instance of this class.DeviceBufferimplements__cuda_array_interface__. Direct constructors always allocate new memory and copy provided inputs into the newly allocated array.Zero-copy construction is possible from a
unique_ptr<device_ buffer>, with the ownership being moved to the Cython extension instance.DeviceBuffer provides
__reduce__method to support pickling (which works by copying content of the device buffer to host) and provides the following set of routines, among others:copy_to_host(host_buf_obj)to copy content of the underlying device_buffer to a host buffercopy_from_host(host_buf_obf)to copy content of the host buffer into memory of underlying device_buffercopy_from_device(cuda_ary_obj)to copy device memory underylingcuda_ary_objPython object implementing__cuda_array_interface__to the memory underlyingDeviceBufferinstance.RMM's methods are declared
nogil.diptorupd commentedon Nov 2, 2020
I have documented the current discussion in our docs under
dpctl.memory. Closing this issue.PokhodenkoSA commentedon Nov 2, 2020
Related: #140