From 90dd9974cbd956a002342c4786711583157d6d12 Mon Sep 17 00:00:00 2001 From: Weiqun Zhang Date: Tue, 22 Sep 2020 13:03:07 -0700 Subject: [PATCH] Fix function type for HIP Currently in HIP we do not have a way to do SNFINAE based on whether the function is callable on host or not. So we have to replace the device lambda with host and device lambda. --- Src/Base/AMReX_MultiFab.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/Base/AMReX_MultiFab.cpp b/Src/Base/AMReX_MultiFab.cpp index 2ce916e627e..b7aaf50cabf 100644 --- a/Src/Base/AMReX_MultiFab.cpp +++ b/Src/Base/AMReX_MultiFab.cpp @@ -47,7 +47,7 @@ MultiFab::Dot (const MultiFab& x, int xcomp, #ifdef AMREX_USE_GPU if (Gpu::inLaunchRegion()) { sm = amrex::ReduceSum(x, y, nghost, - [=] AMREX_GPU_DEVICE (Box const& bx, Array4 const& xfab, Array4 const& yfab) -> Real + [=] AMREX_GPU_HOST_DEVICE (Box const& bx, Array4 const& xfab, Array4 const& yfab) -> Real { Real t = 0.0; AMREX_LOOP_4D(bx, numcomp, i, j, k, n,