Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ matrix_cl() [6/13]

template<typename T >
template<typename Vec , require_std_vector_vt< is_eigen, Vec > * = nullptr, require_st_same< Vec, T > * = nullptr>
stan::math::matrix_cl< T >::matrix_cl ( Vec &&  A)
inlineexplicit

Constructor for the matrix_cl that creates a copy of a std::vector of Eigen matrices on the OpenCL device.

Each matrix is flattened into one column of the resulting matrix_cl. If a lvalue is passed to this constructor the caller must make sure that the vector does not go out of scope before copying is complete.

That means .wait() must be called on the event associated on copying or any other event that requires completion of this event. This can be done by calling .wait_for_write_events() or .wait_for_read_write_events() on this matrix or any matrix that is calculated from this one.

Parameters
Athe vector of Eigen matrices
Exceptions
<code>std::invalid_argument</code>if the matrices do not have matching dimensions
<code>std::system_error</code>if the memory on the device could not be allocated

Definition at line 248 of file matrix_cl.hpp.