diff options
author | 2023-03-24 15:33:26 -0700 | |
---|---|---|
committer | 2023-03-24 15:33:26 -0700 | |
commit | 9c166ee7f165483b86c5c592bd9d5ec0797965b6 (patch) | |
tree | 727855fd0df16e743436813e582a3332b74e9ee9 /Source/Particles/PhotonParticleContainer.cpp | |
parent | aefd2344320fdda1da9c5e830b94f01d7ae29688 (diff) | |
download | WarpX-9c166ee7f165483b86c5c592bd9d5ec0797965b6.tar.gz WarpX-9c166ee7f165483b86c5c592bd9d5ec0797965b6.tar.zst WarpX-9c166ee7f165483b86c5c592bd9d5ec0797965b6.zip |
Workaround for nvcc (#3782)
Fixes an issue in #3696. CUDA device lambda appears to have a limitation
that explicit by-copy captures in addition to by-copy capture default would
result in invalid device function at runtime.
Diffstat (limited to 'Source/Particles/PhotonParticleContainer.cpp')
-rw-r--r-- | Source/Particles/PhotonParticleContainer.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Source/Particles/PhotonParticleContainer.cpp b/Source/Particles/PhotonParticleContainer.cpp index f867ee0ba..dc4c1b122 100644 --- a/Source/Particles/PhotonParticleContainer.cpp +++ b/Source/Particles/PhotonParticleContainer.cpp @@ -176,15 +176,8 @@ PhotonParticleContainer::PushPX (WarpXParIter& pti, CompileTimeOptions<no_qed ,has_qed>>{}, {exteb_runtime_flag, qed_runtime_flag}, np_to_push, -#ifdef WARPX_QED - [=, getExternalEB=getExternalEB, - evolve_opt=evolve_opt, ux=ux, uy=uy, uz=uz, dt=dt, - p_optical_depth_BW=p_optical_depth_BW] -#else - [=, getExternalEB=getExternalEB] -#endif - AMREX_GPU_DEVICE (long i, auto exteb_control, - [[maybe_unused]] auto qed_control) { + [=] AMREX_GPU_DEVICE (long i, auto exteb_control, + [[maybe_unused]] auto qed_control) { if (do_copy) copyAttribs(i); ParticleReal x, y, z; GetPosition(i, x, y, z); @@ -201,14 +194,21 @@ PhotonParticleContainer::PushPX (WarpXParIter& pti, nox, galerkin_interpolation); } + [[maybe_unused]] auto& getExternalEB_tmp = getExternalEB; // workaround for nvcc if constexpr (exteb_control == has_exteb) { getExternalEB(i, Exp, Eyp, Ezp, Bxp, Byp, Bzp); } #ifdef WARPX_QED + [[maybe_unused]] auto& evolve_opt_tmp = evolve_opt; + [[maybe_unused]] auto p_optical_depth_BW_tmp = p_optical_depth_BW; + [[maybe_unused]] auto ux_tmp = ux; // for nvhpc + [[maybe_unused]] auto uy_tmp = uy; + [[maybe_unused]] auto uz_tmp = uz; + [[maybe_unused]] auto dt_tmp = dt; if constexpr (qed_control == has_qed) { evolve_opt(ux[i], uy[i], uz[i], Exp, Eyp, Ezp, Bxp, Byp, Bzp, - dt, p_optical_depth_BW[i]); + dt, p_optical_depth_BW[i]); } #endif |