1#ifndef STAN_MATH_PRIM_FUNCTOR_REDUCE_SUM_STATIC_HPP
2#define STAN_MATH_PRIM_FUNCTOR_REDUCE_SUM_STATIC_HPP
7#include <tbb/task_arena.h>
8#include <tbb/parallel_reduce.h>
9#include <tbb/blocked_range.h>
43template <
typename ReduceFunction,
typename Vec,
44 typename = require_vector_like_t<Vec>,
typename... Args>
53 Args...>()(std::forward<Vec>(vmapped),
false,
55 std::forward<Args>(args)...);
57 if (vmapped.empty()) {
61 return ReduceFunction()(std::forward<Vec>(vmapped), 0, vmapped.size() - 1,
62 msgs, std::forward<Args>(args)...);
typename return_type< Ts... >::type return_type_t
Convenience type for the return type of the specified template parameters.
auto reduce_sum_static(Vec &&vmapped, int grainsize, std::ostream *msgs, Args &&... args)
Call an instance of the function ReduceFunction on every element of an input sequence and sum these t...
void check_positive(const char *function, const char *name, const T_y &y)
Check if y is positive.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
reduce_sum_impl implementation for any autodiff type.
Template metaprogram to calculate the base scalar return type resulting from promoting all the scalar...