1#ifndef STAN_MATH_OPENCL_REV_TO_ARENA_HPP
2#define STAN_MATH_OPENCL_REV_TO_ARENA_HPP
24template <
typename T, require_matrix_cl_t<T>* =
nullptr>
26 arena_t<T> res(a.buffer(), a.rows(), a.cols(), a.view());
27 for (cl::Event
e : a.read_events()) {
28 res.add_read_event(
e);
30 for (cl::Event
e : a.write_events()) {
31 res.add_write_event(
e);
static constexpr double e()
Return the base of the natural logarithm.
arena_t< T > to_arena(const T &a)
Converts given argument into a type that either has any dynamic allocation on AD stack or schedules i...
typename internal::arena_type_impl< std::decay_t< T > >::type arena_t
Determines a type that can be used in place of T that does any dynamic allocations on the AD stack.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...