59 : m_data(data), m_pitch(cols * sizeof(T)),
60 m_dims(
shape<2>{rows, cols}){};
68 T*
data()
const {
return m_data; }
81 size_t pitch()
const {
return m_pitch; }
103 size_t width()
const {
return m_dims[1] *
sizeof(T); }
114 size_t height()
const {
return m_dims[0]; }
T * data() const
Get the beginning address of the 2D memory wrapped by this HostMemory2D object.
Definition: host_memory_2d.hpp:68
HostMemory2D(T *data, size_t rows, size_t cols)
Construct a HostMemory2D class around the memory given by the pointer and the rows and columns of the...
Definition: host_memory_2d.hpp:58
shape< 2 > dims() const
Get the dimensions of this memory region in terms of elements.
Definition: host_memory_2d.hpp:121
Eigen::array< size_t, N > shape
Shape of vectors, matrices, tensors, etc.
Definition: defs.hpp:66
size_t pitch() const
Get the pitch of the 2D matrix memory wrapped by this HostMemory2D object.
Definition: host_memory_2d.hpp:81
T value_type
Type of the values wrapped around current DeviceMemory1D object.
Definition: host_memory_2d.hpp:43
size_t height() const
Get the height of the 2D matrix in terms of number of elements.
Definition: host_memory_2d.hpp:114
A wrapper template class around a row-major matrix type stored in main memory (host memory)...
Definition: host_memory_2d.hpp:37
size_t width() const
Get the width of the 2D matrix in terms of bytes.
Definition: host_memory_2d.hpp:103
Main namespace for bnmf-algs library.
Definition: alloc_model_funcs.hpp:12