Skip to content

Commit

Permalink
Added std::forward calls to rev version of reduce_sum (Issue #1815)
Browse files Browse the repository at this point in the history
  • Loading branch information
bbbales2 committed Apr 7, 2020
1 parent e10b626 commit 7f76760
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion stan/math/rev/functor/reduce_sum.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
#include <stan/math/prim/meta.hpp>
#include <stan/math/prim/functor.hpp>
#include <stan/math/rev/core.hpp>

#include <tbb/task_arena.h>
#include <tbb/parallel_reduce.h>
#include <tbb/blocked_range.h>

#include <algorithm>
#include <tuple>
#include <vector>

Expand Down Expand Up @@ -217,7 +219,7 @@ struct reduce_sum_impl<ReduceFunction, require_var_t<ReturnType>, ReturnType,
partials[i] = 0.0;
}
recursive_reducer worker(num_vars_per_term, num_vars_shared_terms, partials,
vmapped, msgs, args...);
std::forward<Vec>(vmapped), msgs, std::forward<Args>(args)...);

if (auto_partitioning) {
tbb::parallel_reduce(
Expand Down

0 comments on commit 7f76760

Please sign in to comment.