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

◆ to_matrix_cl() [1/5]

template<typename T , require_st_arithmetic< T > * = nullptr>
matrix_cl< scalar_type_t< T > > stan::math::to_matrix_cl ( T &&  src)
inline

Copies the source Eigen matrix, std::vector or scalar to the destination matrix that is stored on the OpenCL device.

The function also accepts matrix_cls in which case it just returns the argument. If a lvalue matrix is passed to this function the caller must make sure that the matrix 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 returned matrix or any matrix that is calculated from that one.

Parameters
srcsource Eigen matrix
Returns
matrix_cl with a copy of the data in the source matrix

Definition at line 45 of file copy.hpp.