bnmf-algs
|
A wrapper template class around a contiguous array of T types laid out in main memory (host memory). More...
#include <host_memory_1d.hpp>
Public Types | |
using | value_type = T |
Type of the values stored in the memory sequence wrapped around the current HostMemory1D object. More... | |
Public Member Functions | |
HostMemory1D (T *data, size_t num_elems) | |
Construct a HostMemory1D class around the memory given by address and number of elements. More... | |
T * | data () const |
Get the address of the memory sequence wrapped with the current HostMemory1D object. More... | |
size_t | bytes () const |
Get the number of bytes of the memory sequence wrapped with the current HostMemory1D object. More... | |
shape< 1 > | dims () const |
Get the dimensions of this memory region in terms of elements. More... | |
A wrapper template class around a contiguous array of T types laid out in main memory (host memory).
HostMemory1D class represents the memory for a contiguous sequence of T values in host memory. The intended use of this class is to provide an interface that can be used with CUDA functions.
HostMemory1D class does not own the memory it is given. Therefore, no allocation, copying or memory freeing is performed. The only use case of HostMemory1D is to provide a unified interface with DeviceMemory1D so that the two classes can be used interchangeably by cuda::copy1D function. See cuda::copy1D for details about copying memory using CUDA functions from host/device to host/device memory.
T | Type of the values in the given memory address. |
using bnmf_algs::cuda::HostMemory1D< T >::value_type = T |
Type of the values stored in the memory sequence wrapped around the current HostMemory1D object.
|
inline |
Construct a HostMemory1D class around the memory given by address and number of elements.
The given memory address is assumed to reside in host memory (main memory). Therefore, this function does not perform any memory allocation on main memory or GPU device.
data | Beginning address of the sequence of T values. |
num_elems | Number of T values in the sequence starting at parameter data. |
|
inline |
Get the number of bytes of the memory sequence wrapped with the current HostMemory1D object.
|
inline |
Get the address of the memory sequence wrapped with the current HostMemory1D object.
|
inline |
Get the dimensions of this memory region in terms of elements.