Skip to content

Commit

Permalink
Use a lambda for the gpu::reduce in sum.
Browse files Browse the repository at this point in the history
  • Loading branch information
xavierandrade committed Oct 23, 2024
1 parent da1b882 commit 714271d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/operations/sum.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ typename array_type::element sum(const array_type & phi){
CALI_CXX_MARK_SCOPE("sum(1arg)");
auto init = zero<typename array_type::element>();
if(phi.size() == 0) return init;
return gpu::run(gpu::reduce(phi.size()), init, gpu::array_access<decltype(begin(phi))>{begin(phi)});
return gpu::run(gpu::reduce(phi.size()), init, [ph = begin(phi)] GPU_LAMBDA (auto ii) { return ph[ii]; });
}

template <class ArrayType, class UnaryOp>
Expand Down

0 comments on commit 714271d

Please sign in to comment.