![]() |
Stan Math Library
2.20.0
reverse mode automatic differentiation
|
Represents a matrix on the OpenCL device. More...
#include <matrix_cl.hpp>
Public Member Functions | |
template<TriangularViewCL triangular_view = TriangularViewCL::Entire> | |
void | zeros () |
Stores zeros in the matrix on the OpenCL device. More... | |
template<TriangularMapCL triangular_map = TriangularMapCL::LowerToUpper> | |
void | triangular_transpose () |
Copies a lower/upper triangular of a matrix to it's upper/lower. More... | |
template<TriangularViewCL triangular_view = TriangularViewCL::Entire> | |
void | sub_block (const matrix_cl &A, size_t A_i, size_t A_j, size_t this_i, size_t this_j, size_t nrows, size_t ncols) |
Write the contents of A into this starting at the top left of this More... | |
int | rows () const |
int | cols () const |
int | size () const |
void | clear_write_events () const |
Clear the write events from the event stacks. More... | |
void | clear_read_events () const |
Clear the read events from the event stacks. More... | |
void | clear_read_write_events () const |
Clear the write events from the event stacks. More... | |
const std::vector< cl::Event > & | write_events () const |
Get the events from the event stacks. More... | |
const std::vector< cl::Event > & | read_events () const |
Get the events from the event stacks. More... | |
const std::vector< cl::Event > | read_write_events () const |
Get the events from the event stacks. More... | |
void | add_read_event (cl::Event new_event) const |
Add an event to the read event stack. More... | |
void | add_write_event (cl::Event new_event) const |
Add an event to the write event stack. More... | |
void | add_read_write_event (cl::Event new_event) const |
Add an event to the read/write event stack. More... | |
void | wait_for_write_events () const |
Waits for the write events and clears the read event stack. More... | |
void | wait_for_read_events () const |
Waits for the read events and clears the read event stack. More... | |
void | wait_for_read_write_events () const |
Waits for read and write events to finish and clears the read, write, and read/write event stacks. More... | |
const cl::Buffer & | buffer () const |
matrix_cl () | |
matrix_cl (const matrix_cl &A) | |
matrix_cl (const int &rows, const int &cols) | |
Constructor for the matrix_cl that only allocates the buffer on the OpenCL device. More... | |
template<int R, int C> | |
matrix_cl (const Eigen::Matrix< double, R, C > &A) | |
Constructor for the matrix_cl that creates a copy of the Eigen matrix on the OpenCL device. More... | |
matrix_cl & | operator= (const matrix_cl &a) |
Represents a matrix on the OpenCL device.
The matrix data is stored in the oclBuffer_.
Definition at line 29 of file matrix_cl.hpp.
|
inline |
Definition at line 172 of file matrix_cl.hpp.
|
inline |
Definition at line 174 of file matrix_cl.hpp.
|
inline |
Constructor for the matrix_cl that only allocates the buffer on the OpenCL device.
rows | number of matrix rows, must be greater or equal to 0 |
cols | number of matrix columns, must be greater or equal to 0 |
<code>std::system_error</code> | if the matrices do not have matching dimensions |
Definition at line 204 of file matrix_cl.hpp.
|
inlineexplicit |
Constructor for the matrix_cl that creates a copy of the Eigen matrix on the OpenCL device.
T | type of data in the Eigen matrix |
A | the Eigen matrix |
<code>std::system_error</code> | if the matrices do not have matching dimensions |
Writes the contents of A to the OpenCL buffer starting at the offset 0. CL_TRUE denotes that the call is blocking as we do not want to execute any further kernels on the device until we are sure that the data is finished transfering)
Definition at line 229 of file matrix_cl.hpp.
|
inline |
Add an event to the read event stack.
new_event | The event to be pushed on the event stack. |
Definition at line 110 of file matrix_cl.hpp.
|
inline |
Add an event to the read/write event stack.
new_event | The event to be pushed on the event stack. |
Definition at line 126 of file matrix_cl.hpp.
|
inline |
Add an event to the write event stack.
new_event | The event to be pushed on the event stack. |
Definition at line 118 of file matrix_cl.hpp.
|
inline |
Definition at line 170 of file matrix_cl.hpp.
|
inline |
Clear the read events from the event stacks.
Definition at line 68 of file matrix_cl.hpp.
|
inline |
Clear the write events from the event stacks.
Definition at line 76 of file matrix_cl.hpp.
|
inline |
Clear the write events from the event stacks.
Definition at line 60 of file matrix_cl.hpp.
|
inline |
Definition at line 53 of file matrix_cl.hpp.
Definition at line 259 of file matrix_cl.hpp.
|
inline |
Get the events from the event stacks.
Definition at line 94 of file matrix_cl.hpp.
|
inline |
Get the events from the event stacks.
Definition at line 102 of file matrix_cl.hpp.
|
inline |
Definition at line 51 of file matrix_cl.hpp.
|
inline |
Definition at line 55 of file matrix_cl.hpp.
|
inline |
Write the contents of A into this
starting at the top left of this
A | input matrix |
A_i | the offset row in A |
A_j | the offset column in A |
this_i | the offset row for the matrix to be subset into |
this_j | the offset col for the matrix to be subset into |
nrows | the number of rows in the submatrix |
ncols | the number of columns in the submatrix |
Definition at line 28 of file sub_block.hpp.
|
inline |
Copies a lower/upper triangular of a matrix to it's upper/lower.
triangular_map | Specifies if the copy is lower-to-upper or upper-to-lower triangular. The value must be of type TriangularMap |
<code>std::invalid_argument</code> | if the matrix is not square. |
Definition at line 28 of file triangular_transpose.hpp.
|
inline |
Waits for the read events and clears the read event stack.
Definition at line 146 of file matrix_cl.hpp.
|
inline |
Waits for read and write events to finish and clears the read, write, and read/write event stacks.
Definition at line 159 of file matrix_cl.hpp.
|
inline |
Waits for the write events and clears the read event stack.
Definition at line 134 of file matrix_cl.hpp.
|
inline |
Get the events from the event stacks.
Definition at line 86 of file matrix_cl.hpp.
|
inline |
Stores zeros in the matrix on the OpenCL device.
Supports writing zeroes to the lower and upper triangular or the whole matrix.
triangular_view | Specifies if zeros are assigned to the entire matrix, lower triangular or upper triangular. The value must be of type TriangularViewCL |