Update Kokkos library in LAMMPS to v3.2

This commit is contained in:
Stan Moore
2020-08-25 20:21:48 -06:00
parent 450fd12d31
commit 4d90c2b74b
1410 changed files with 19364 additions and 71953 deletions

View File

@ -47,6 +47,12 @@
extern "C" void print_fortran_();
struct CountFunctor {
KOKKOS_FUNCTION void operator()(const long i, long& lcount) const {
lcount += (i % 2) == 0;
}
};
int main(int argc, char* argv[]) {
Kokkos::initialize(argc, argv);
Kokkos::DefaultExecutionSpace::print_configuration(std::cout);
@ -66,9 +72,8 @@ int main(int argc, char* argv[]) {
// Compute the number of even integers from 0 to n-1, in parallel.
long count = 0;
Kokkos::parallel_reduce(
n, KOKKOS_LAMBDA(const long i, long& lcount) { lcount += (i % 2) == 0; },
count);
CountFunctor functor;
Kokkos::parallel_reduce(n, functor, count);
double count_time = timer.seconds();
printf(" Parallel: %ld %10.6f\n", count, count_time);