Template Class device_matrix
Defined in File device_matrix.h
Inheritance Relationships
Base Type
private boost::noncopyable
Class Documentation
-
template<typename T>
class device_matrix : private boost::noncopyable A cuda device buffer object that represents a global memory buffer on a cuda device. Matrix size is fixed at construction and can only be resized using move semantics.
Note
See https://www.quantstart.com/articles/Matrix-Matrix-Multiplication-on-the-GPU-with-Nvidia-CUDA/
- Template Parameters:
T – numeric type
Public Functions
-
inline device_matrix()
Default constructor.
-
inline device_matrix(device_matrix &&other) noexcept
Move Constructor.
- Parameters:
other –
-
inline device_matrix &operator=(device_matrix &&other) noexcept
Move Assignment Operator.
- Parameters:
other –
- Returns:
device_matrix&
-
inline device_matrix(size_t rows, size_t cols, const T *data = nullptr)
Construct a new device matrix object of fixed size and initialized asyncronously if data is provided.
- Parameters:
rows – number of rows
cols – number of columns
data – constigous column major data of size rows*cols*sizeof(T) to copy to device
-
template<int Rows, int Cols>
inline explicit device_matrix(const Eigen::Matrix<T, Rows, Cols> &data)
-
inline ~device_matrix()
-
__host__ inline size_t GetRows() const
-
__host__ inline size_t GetCols() const
-
__host__ inline size_t GetCount() const
-
__host__ inline size_t GetSize() const
-
__host__ inline void SetZeroAsync()
-
__host__ inline void SetDataSync(const T *data)
Performs a synchronous copy of data into the device buffer.
- Parameters:
data –
- Returns:
host