From 8ac0ec64734c0efbc9eca4b110af173287a3d142 Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Tue, 1 Feb 2022 15:00:40 -0700 Subject: [PATCH] Changes needed to compile LAMMPS with latest Kokkos develop --- src/KOKKOS/nbin_ssa_kokkos.cpp | 2 +- src/KOKKOS/pair_kokkos.h | 26 ++++++++++++------------ src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp | 4 ++-- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/KOKKOS/nbin_ssa_kokkos.cpp b/src/KOKKOS/nbin_ssa_kokkos.cpp index d42b88ab79..114593b6e1 100644 --- a/src/KOKKOS/nbin_ssa_kokkos.cpp +++ b/src/KOKKOS/nbin_ssa_kokkos.cpp @@ -142,7 +142,7 @@ void NBinSSAKokkos::bin_atoms() k_gbincount.sync(); ghosts_per_gbin = 0; NPairSSAKokkosBinIDGhostsFunctor f(*this); - Kokkos::parallel_reduce(Kokkos::RangePolicy(nlocal,nall), f, ghosts_per_gbin); + Kokkos::parallel_reduce(Kokkos::RangePolicy(nlocal,nall), f, ghosts_per_gbin); } // actually bin the ghost atoms diff --git a/src/KOKKOS/pair_kokkos.h b/src/KOKKOS/pair_kokkos.h index 65fffd58ad..8ff364f1e3 100644 --- a/src/KOKKOS/pair_kokkos.h +++ b/src/KOKKOS/pair_kokkos.h @@ -263,7 +263,7 @@ struct PairComputeFunctor { // Loop over neighbors of one atom without coulomb interaction // This function is called in parallel KOKKOS_FUNCTION - void compute_item_team(Kokkos::TeamPolicy<>::member_type team, + void compute_item_team(typename Kokkos::TeamPolicy::member_type team, const NeighListKokkos &list, const NoCoulTag&) const { const int inum = team.league_size(); @@ -319,7 +319,7 @@ struct PairComputeFunctor { // Loop over neighbors of one atom with coulomb interaction // This function is called in parallel KOKKOS_FUNCTION - void compute_item_team(Kokkos::TeamPolicy<>::member_type team, + void compute_item_team(typename Kokkos::TeamPolicy::member_type team, const NeighListKokkos &list, const CoulTag& ) const { const int inum = team.league_size(); @@ -380,7 +380,7 @@ struct PairComputeFunctor { // Loop over neighbors of one atom without coulomb interaction // This function is called in parallel KOKKOS_FUNCTION - EV_FLOAT compute_item_team_ev(Kokkos::TeamPolicy<>::member_type team, + EV_FLOAT compute_item_team_ev(typename Kokkos::TeamPolicy::member_type team, const NeighListKokkos &list, const NoCoulTag&) const { EV_FLOAT ev; @@ -475,7 +475,7 @@ struct PairComputeFunctor { // Loop over neighbors of one atom with coulomb interaction // This function is called in parallel KOKKOS_FUNCTION - EV_FLOAT compute_item_team_ev(Kokkos::TeamPolicy<>::member_type team, + EV_FLOAT compute_item_team_ev(typename Kokkos::TeamPolicy::member_type team, const NeighListKokkos &list, const CoulTag& ) const { EV_FLOAT ev; @@ -684,12 +684,12 @@ struct PairComputeFunctor { } KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::TeamPolicy<>::member_type& team) const { + void operator()(const typename Kokkos::TeamPolicy::member_type& team) const { compute_item_team(team,list,typename DoCoul::type()); } KOKKOS_INLINE_FUNCTION - void operator()(const typename Kokkos::TeamPolicy<>::member_type& team, value_type &energy_virial) const { + void operator()(const typename Kokkos::TeamPolicy::member_type& team, value_type &energy_virial) const { energy_virial += compute_item_team_ev(team,list,typename DoCoul::type()); } }; @@ -711,7 +711,7 @@ EV_FLOAT pair_compute_neighlist (PairStyle* fpair, typename std::enable_if +template int GetTeamSize(FunctorStyle& KOKKOS_GPU_ARG(functor), int KOKKOS_GPU_ARG(inum), int KOKKOS_GPU_ARG(reduce_flag), int team_size, int KOKKOS_GPU_ARG(vector_length)) { @@ -719,9 +719,9 @@ int GetTeamSize(FunctorStyle& KOKKOS_GPU_ARG(functor), int KOKKOS_GPU_ARG(inum), int team_size_max; if (reduce_flag) - team_size_max = Kokkos::TeamPolicy<>(inum,Kokkos::AUTO).team_size_max(functor,Kokkos::ParallelReduceTag()); + team_size_max = Kokkos::TeamPolicy(inum,Kokkos::AUTO).team_size_max(functor,Kokkos::ParallelReduceTag()); else - team_size_max = Kokkos::TeamPolicy<>(inum,Kokkos::AUTO).team_size_max(functor,Kokkos::ParallelForTag()); + team_size_max = Kokkos::TeamPolicy(inum,Kokkos::AUTO).team_size_max(functor,Kokkos::ParallelForTag()); if (team_size*vector_length > team_size_max) team_size = team_size_max/vector_length; @@ -746,14 +746,14 @@ EV_FLOAT pair_compute_neighlist (PairStyle* fpair, typename std::enable_if<(NEIG if (fpair->atom->ntypes > MAX_TYPES_STACKPARAMS) { PairComputeFunctor ff(fpair,list); - atoms_per_team = GetTeamSize(ff, list->inum, (fpair->eflag || fpair->vflag), atoms_per_team, vector_length); - Kokkos::TeamPolicy > policy(list->inum,atoms_per_team,vector_length); + atoms_per_team = GetTeamSize(ff, list->inum, (fpair->eflag || fpair->vflag), atoms_per_team, vector_length); + Kokkos::TeamPolicy > policy(list->inum,atoms_per_team,vector_length); if (fpair->eflag || fpair->vflag) Kokkos::parallel_reduce(policy,ff,ev); else Kokkos::parallel_for(policy,ff); } else { PairComputeFunctor ff(fpair,list); - atoms_per_team = GetTeamSize(ff, list->inum, (fpair->eflag || fpair->vflag), atoms_per_team, vector_length); - Kokkos::TeamPolicy > policy(list->inum,atoms_per_team,vector_length); + atoms_per_team = GetTeamSize(ff, list->inum, (fpair->eflag || fpair->vflag), atoms_per_team, vector_length); + Kokkos::TeamPolicy > policy(list->inum,atoms_per_team,vector_length); if (fpair->eflag || fpair->vflag) Kokkos::parallel_reduce(policy,ff,ev); else Kokkos::parallel_for(policy,ff); } diff --git a/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp b/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp index 1107d39fe9..820e0e4924 100644 --- a/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp +++ b/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp @@ -669,7 +669,7 @@ int PairMultiLucyRXKokkos::pack_forward_comm_kokkos(int n, DAT::tdua d_sendlist = k_sendlist.view(); iswap = iswap_in; v_buf = buf.view(); - Kokkos::parallel_for(Kokkos::RangePolicy(0,n),*this); + Kokkos::parallel_for(Kokkos::RangePolicy(0,n),*this); return n; } @@ -687,7 +687,7 @@ void PairMultiLucyRXKokkos::unpack_forward_comm_kokkos(int n, int fi { first = first_in; v_buf = buf.view(); - Kokkos::parallel_for(Kokkos::RangePolicy(0,n),*this); + Kokkos::parallel_for(Kokkos::RangePolicy(0,n),*this); atomKK->modified(execution_space,DPDRHO_MASK); // needed for auto_sync }