From 714271d399ed1ca1733d58ca01c17c66c129111d Mon Sep 17 00:00:00 2001 From: Xavier Andrade Date: Tue, 22 Oct 2024 21:47:06 -0700 Subject: [PATCH] Use a lambda for the gpu::reduce in sum. --- src/operations/sum.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/operations/sum.hpp b/src/operations/sum.hpp index 75346623..58db9f33 100644 --- a/src/operations/sum.hpp +++ b/src/operations/sum.hpp @@ -28,7 +28,7 @@ typename array_type::element sum(const array_type & phi){ CALI_CXX_MARK_SCOPE("sum(1arg)"); auto init = zero(); if(phi.size() == 0) return init; - return gpu::run(gpu::reduce(phi.size()), init, gpu::array_access{begin(phi)}); + return gpu::run(gpu::reduce(phi.size()), init, [ph = begin(phi)] GPU_LAMBDA (auto ii) { return ph[ii]; }); } template