|
HAMR
The Heterogeneous Accelerator Memory Resource
|
#include <hamr_buffer_handle.h>
Public Member Functions | |
| buffer_handle () | |
| construct an empty, and unusable object More... | |
| buffer_handle (const std::shared_ptr< T > &src, size_t size, int read_only, int cpu_accessible, int cuda_accessible, size_t stream) | |
| construct from existing data More... | |
| buffer_handle (const std::shared_ptr< const T > &src, size_t size, int cpu_accessible, int cuda_accessible, size_t stream) | |
| construct from existing read only data More... | |
| ~buffer_handle () | |
| destruct More... | |
| buffer_handle (const buffer_handle< T > &other) | |
| copy construct More... | |
| buffer_handle (buffer_handle< T > &&other) | |
| move construct More... | |
| buffer_handle< T > & | operator= (const buffer_handle< T > &)=default |
| copy assign More... | |
| buffer_handle< T > & | operator= (buffer_handle< T > &&)=default |
| move assign More... | |
| PyObject * | get_cuda_array_interface () |
| PyObject * | get_numpy_array_interface () |
| PyObject * | get_array_interface () |
| void | to_stream (std::ostream &os) const |
Public Attributes | |
| std::shared_ptr< T > | m_data |
| size_t | m_size |
| int | m_read_only |
| int | m_cpu_accessible |
| int | m_cuda_accessible |
| size_t | m_stream |
A resource management class that is used to keep data shared with Python codes from a ::hamr_buffer alive while it is being accessed by the Python codes. The class also implements the Numpy array interface protocol and the Numba CUDA array interface protocol enabling seamless access by those libraries.
|
inline |
construct an empty, and unusable object
| hamr::buffer_handle< T >::buffer_handle | ( | const std::shared_ptr< T > & | src, |
| size_t | size, | ||
| int | read_only, | ||
| int | cpu_accessible, | ||
| int | cuda_accessible, | ||
| size_t | stream | ||
| ) |
construct from existing data
| hamr::buffer_handle< T >::buffer_handle | ( | const std::shared_ptr< const T > & | src, |
| size_t | size, | ||
| int | cpu_accessible, | ||
| int | cuda_accessible, | ||
| size_t | stream | ||
| ) |
construct from existing read only data
| hamr::buffer_handle< T >::~buffer_handle |
destruct
| hamr::buffer_handle< T >::buffer_handle | ( | const buffer_handle< T > & | other | ) |
copy construct
| hamr::buffer_handle< T >::buffer_handle | ( | buffer_handle< T > && | other | ) |
move construct
| PyObject * hamr::buffer_handle< T >::get_array_interface |
returns a dictionary as decribed in the Numpy array interface and Numba CUDA array interface protocols. The caller must ensure the data is accessible in the desired technology before use. See ::get_numpy_array_interface and ::get_cuda_array_interface which implement check ensuring that this is true.
| PyObject * hamr::buffer_handle< T >::get_cuda_array_interface |
returns a dictionary as described in the Numba CUDA array interface protocol if the data is accessible from CUDA. Otherwise, an AttributeError is rasied.
| PyObject * hamr::buffer_handle< T >::get_numpy_array_interface |
returns a dictionary as described in the Numpy array_interface protocol if the data is accessible from CUDA. Otherwise, an AttributeError is rasied.
|
default |
move assign
|
default |
copy assign