Skip to content

Commit

Permalink
Fix clang compiler issue by removing usage of CTAD inside GPU kernel
Browse files Browse the repository at this point in the history
See merge request gysela-developpers/gyselalibxx!464

--------------------------------------------
  • Loading branch information
tpadioleau committed Apr 22, 2024
1 parent 3c6fe3e commit 6074fcd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/geometryXYVxVy/poisson/chargedensitycalculator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,17 @@ void ChargeDensityCalculator::operator()(DSpanXY rho, DViewSpXYVxVy allfdistribu
std::size_t const nvx = allfdistribu_view.extent(3);
std::size_t const nvy = allfdistribu_view.extent(4);

using TeamHandle = Kokkos::TeamPolicy<>::member_type;

Kokkos::parallel_for(
Kokkos::TeamPolicy<>(nx * ny, Kokkos::AUTO),
KOKKOS_LAMBDA(const Kokkos::TeamPolicy<>::member_type& team) {
KOKKOS_LAMBDA(const TeamHandle& team) {
const int idx = team.league_rank();
const int ix = idx / ny;
const int iy = idx % ny;
double teamSum = 0;
Kokkos::parallel_reduce(
Kokkos::TeamThreadMDRange(team, nsp, nvx, nvy),
Kokkos::TeamThreadMDRange<Kokkos::Rank<3>, TeamHandle>(team, nsp, nvx, nvy),
[&](int isp, int ivx, int ivy, double& sum) {
sum += static_cast<double>(charges(isp)) * coef_view(ivx, ivy)
* allfdistribu_view(isp, ix, iy, ivx, ivy);
Expand Down

0 comments on commit 6074fcd

Please sign in to comment.