1#ifndef STAN_MATH_OPENCL_REV_ARENA_MATRIX_CL_HPP
2#define STAN_MATH_OPENCL_REV_ARENA_MATRIX_CL_HPP
20 template <
typename... Args>
54 template <
typename... Args>
57 new internal::arena_matrix_cl_impl<T>(
std::forward<Args>(args)...)) {}
72 template <
typename Expr,
75 :
impl_(new internal::arena_matrix_cl_impl<T>(
76 std::forward<Expr>(expression))) {}
99 template <matrix_cl_view matrix_view = matrix_cl_view::Entire>
101 impl_->template zeros_strict_tri<matrix_view>();
108#define ARENA_MATRIX_CL_FUNCTION_WRAPPER(function_name) \
109 template <typename... Args> \
110 inline decltype(auto) function_name(Args&&... args) { \
111 return impl_->function_name(std::forward<Args>(args)...); \
118#define ARENA_MATRIX_CL_CONST_FUNCTION_WRAPPER(function_name) \
119 template <typename... Args> \
120 inline decltype(auto) function_name(Args&&... args) const { \
121 return impl_->function_name(std::forward<Args>(args)...); \
144#undef ARENA_MATRIX_CL_FUNCTION_WRAPPER
145#undef ARENA_MATRIX_CL_CONST_FUNCTION_WRAPPER
150 : buffer_cl_(A.impl_->buffer_cl_),
151 rows_(A.impl_->rows_),
152 cols_(A.impl_->cols_),
153 view_(A.impl_->view_),
154 write_events_(A.impl_->write_events_),
155 read_events_(A.impl_->read_events_) {}
160 view_ = a.
impl_->view();
161 rows_ = a.
impl_->rows();
162 cols_ = a.
impl_->cols();
163 this->wait_for_read_write_events();
164 buffer_cl_ = a.
impl_->buffer_cl_;
165 write_events_ = a.
impl_->write_events_;
166 read_events_ = a.
impl_->read_events_;
#define ARENA_MATRIX_CL_FUNCTION_WRAPPER(function_name)
Implements a wrapper for a non-const function in matrix_cl.
#define ARENA_MATRIX_CL_CONST_FUNCTION_WRAPPER(function_name)
Implements a wrapper for a const function in matrix_cl.
typename matrix_cl< T >::type type
matrix_cl< T > eval() const &
Evaluates this.
decltype(auto) read_write_events(Args &&... args) const
decltype(auto) read_events(Args &&... args) const
arena_matrix_cl(arena_matrix_cl< T > &&)=default
decltype(auto) view(Args &&... args) const
decltype(auto) clear_read_write_events(Args &&... args) const
decltype(auto) cols(Args &&... args) const
arena_matrix_cl(const arena_matrix_cl< T > &)=default
decltype(auto) add_read_event(Args &&... args) const
decltype(auto) clear_read_events(Args &&... args) const
arena_matrix_cl(Args &&... args)
General constructor forwards arguments to various matrix_cl constructors.
decltype(auto) wait_for_write_events(Args &&... args) const
decltype(auto) add_write_event(Args &&... args) const
decltype(auto) buffer(Args &&... args) const
decltype(auto) wait_for_read_events(Args &&... args) const
arena_matrix_cl(arena_matrix_cl< T > &)=default
decltype(auto) write_events(Args &&... args) const
internal::arena_matrix_cl_impl< T > * impl_
decltype(auto) wait_for_read_write_events(Args &&... args) const
arena_matrix_cl(Expr &&expression)
Constructor from a kernel generator expression.
decltype(auto) clear_write_events(Args &&... args) const
decltype(auto) rows(Args &&... args) const
arena_matrix_cl< T > & operator=(arena_matrix_cl< T > &&)=default
typename matrix_cl< T >::Scalar Scalar
decltype(auto) size(Args &&... args) const
decltype(auto) add_read_write_event(Args &&... args) const
arena_matrix_cl< T > & operator=(const arena_matrix_cl< T > &)=default
A variant of matrix_cl that schedules its destructor to be called, so it can be used on the AD stack.
A chainable_alloc is an object which is constructed and destructed normally but the memory lifespan i...
typename matrix_cl< T >::type type
arena_matrix_cl_impl(arena_matrix_cl_impl< T > &)=default
arena_matrix_cl_impl(const arena_matrix_cl_impl< T > &)=default
arena_matrix_cl_impl(arena_matrix_cl_impl< T > &&)=default
arena_matrix_cl_impl(Args &&... args)
arena_matrix_cl_impl< T > & operator=(arena_matrix_cl_impl< T > &&)=default
arena_matrix_cl_impl< T > & operator=(const arena_matrix_cl_impl< T > &)=default
typename matrix_cl< T >::Scalar Scalar
Non-templated base class for matrix_cl simplifies checking if something is matrix_cl.
matrix_cl< T > & operator=(matrix_cl< T > &&a)
Move assignment operator.
Represents an arithmetic matrix on the OpenCL device.
require_all_t< is_kernel_expression_and_not_scalar< Types >... > require_all_kernel_expressions_and_none_scalar_t
Enables a template if all given types are non-scalar types that are a valid kernel generator expressi...
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...