Stan Math Library
4.9.0
Automatic Differentiation
|
Equivalent to Eigen::Matrix
, except that the data is stored in (hopefully pinned) memory, allocated by OpenCL driver.
If the OpenCL device uses the same memory as host, this memory can be used by device without making copies. Otherwise copying to and from device using this memory is usually faster than using non-pinned memory.
MatrixType | Eigen matrix type this works as (MatrixXd , VectorXd ...) |
Definition at line 24 of file pinned_matrix.hpp.
#include <pinned_matrix.hpp>
Public Types | |
using | Scalar = value_type_t< MatrixType > |
using | Base = Eigen::Map< MatrixType > |
using | PlainObject = std::decay_t< MatrixType > |
Public Member Functions | |
pinned_matrix () | |
Default constructor. | |
pinned_matrix (Eigen::Index rows, Eigen::Index cols) | |
Constructs pinned_matrix with given number of rows and columns. | |
pinned_matrix (Eigen::Index size) | |
Constructs pinned_matrix with given size. | |
template<typename T , require_eigen_t< T > * = nullptr> | |
pinned_matrix (const T &other) | |
Constructs pinned_matrix from an expression. | |
pinned_matrix (const pinned_matrix< MatrixType > &other) | |
Copy constructor. | |
pinned_matrix (pinned_matrix< MatrixType > &&other) | |
Move constructor. | |
~pinned_matrix () | |
Destructor unmaps the memory. | |
pinned_matrix & | operator= (const pinned_matrix< MatrixType > &other) |
Copy assignment operator. | |
pinned_matrix & | operator= (pinned_matrix< MatrixType > &&other) |
Move assignment operator. | |
template<typename T > | |
pinned_matrix & | operator= (const T &other) |
Assignment operator for assigning an expression. | |
Static Public Attributes | |
static constexpr int | RowsAtCompileTime = MatrixType::RowsAtCompileTime |
static constexpr int | ColsAtCompileTime = MatrixType::ColsAtCompileTime |
Protected Member Functions | |
pinned_matrix (cl::Buffer &&b, Eigen::Index rows, Eigen::Index cols) | |
pinned_matrix (cl::Buffer &&b, Eigen::Index size) | |
Scalar * | map_memory (cl::Buffer &b, Eigen::Index size) |
void | unmap_memory (const char *function) |
Protected Attributes | |
cl::Buffer | buffer_ |