Automatic Differentiation
 
Loading...
Searching...
No Matches
stan::math::pinned_matrix< MatrixType > Class Template Reference

Detailed Description

template<typename MatrixType>
class stan::math::pinned_matrix< MatrixType >

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.

Template Parameters
MatrixTypeEigen matrix type this works as (MatrixXd, VectorXd ...)

Definition at line 24 of file pinned_matrix.hpp.

#include <pinned_matrix.hpp>

+ Inheritance diagram for stan::math::pinned_matrix< MatrixType >:

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_matrixoperator= (const pinned_matrix< MatrixType > &other)
 Copy assignment operator.
 
pinned_matrixoperator= (pinned_matrix< MatrixType > &&other)
 Move assignment operator.
 
template<typename T >
pinned_matrixoperator= (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)
 
Scalarmap_memory (cl::Buffer &b, Eigen::Index size)
 
void unmap_memory (const char *function)
 

Protected Attributes

cl::Buffer buffer_
 

The documentation for this class was generated from the following file: