Automatic Differentiation
 
Loading...
Searching...
No Matches
stan::math::internal::reduce_sum_impl< ReduceFunction, require_arithmetic_t< ReturnType >, ReturnType, Vec, Args... >::recursive_reducer Struct Reference

Detailed Description

template<typename ReduceFunction, typename ReturnType, typename Vec, typename... Args>
struct stan::math::internal::reduce_sum_impl< ReduceFunction, require_arithmetic_t< ReturnType >, ReturnType, Vec, Args... >::recursive_reducer

This struct is used by the TBB to accumulate partial sums over consecutive ranges of the input.

To distribute the workload, the TBB can split larger partial sums into smaller ones in which case the splitting copy constructor is used. It is designed to meet the Imperative form requirements of tbb::parallel_reduce.

Note
see link here for requirements.

Definition at line 46 of file reduce_sum.hpp.

#include <reduce_sum.hpp>

Public Member Functions

 recursive_reducer (Vec &&vmapped, std::ostream *msgs, Args &&... args)
 
 recursive_reducer (recursive_reducer &other, tbb::split)
 This is the copy operator as required for tbb::parallel_reduce Imperative form.
 
void operator() (const tbb::blocked_range< size_t > &r)
 Compute the value and of ReduceFunction over the range defined by r and accumulate those in member variable sum_.
 
void join (const recursive_reducer &rhs)
 Join reducers.
 

Public Attributes

Vec vmapped_
 
std::stringstream msgs_
 
std::tuple< Args... > args_tuple_
 
return_type_t< Vec, Args... > sum_ {0.0}
 

The documentation for this struct was generated from the following file: