1#ifndef STAN_MATH_OPENCL_PRIM_SUM_HPP
2#define STAN_MATH_OPENCL_PRIM_SUM_HPP
20 require_all_kernel_expressions_and_none_scalar_t<T>* =
nullptr>
21value_type_t<T>
sum(
const T& m) {
22 if (is_matrix_cl<T>::value && m.size() < 1000) {
26 matrix_cl<value_type_t<T>> res;
auto sum_2d(T &&a)
Two dimensional sum - reduction of a kernel generator expression.
auto transpose(Arg &&a)
Transposes a kernel generator expression.
auto from_matrix_cl(const T &src)
Copies the source matrix that is stored on the OpenCL device to the destination Eigen matrix.
auto sum(const std::vector< T > &m)
Return the sum of the entries of the specified standard vector.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...