Update Kokkos library in LAMMPS to v4.2

This commit is contained in:
Stan Gerald Moore
2023-11-21 15:02:12 -07:00
parent 33dcfb5390
commit 3306b95589
493 changed files with 41548 additions and 15629 deletions

View File

@ -56,7 +56,8 @@ struct SomeCorrelation {
// With each team run a parallel_for with its threads
Kokkos::parallel_for(
Kokkos::TeamThreadRange(thread, data.extent(1)), [=](const int& j) {
Kokkos::TeamThreadRange(thread, data.extent(1)),
[=, *this](const int& j) {
int tsum;
// Run a vector loop reduction over the inner dimension of data
// Count how many values are multiples of 4
@ -64,7 +65,7 @@ struct SomeCorrelation {
// broadcast to all vector lanes
Kokkos::parallel_reduce(
Kokkos::ThreadVectorRange(thread, data.extent(2)),
[=](const int& k, int& vsum) {
[=, *this](const int& k, int& vsum) {
vsum += (data(i, j, k) % 4 == 0) ? 1 : 0;
},
tsum);
@ -103,7 +104,7 @@ struct SomeCorrelation {
// Add with one thread and vectorlane of the team the team_sum to the global
// value
Kokkos::single(Kokkos::PerTeam(thread),
[=]() { Kokkos::atomic_add(&gsum(), team_sum); });
[=, *this]() { Kokkos::atomic_add(&gsum(), team_sum); });
}
// The functor needs to define how much shared memory it requests given a