Update Kokkos library in LAMMPS to v3.6.0

This commit is contained in:
Stan Gerald Moore
2022-05-05 11:44:47 -06:00
parent bd4bbbddbe
commit b79c0bc7b4
380 changed files with 41928 additions and 8786 deletions

View File

@ -520,6 +520,7 @@ class TestReduceDynamicView {
// Test result to host pointer:
std::string str("TestKernelReduce");
#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3
if (count % 2 == 0) {
Kokkos::parallel_reduce(nw, functor_type(nw, count),
host_result.data());
@ -528,6 +529,20 @@ class TestReduceDynamicView {
host_result.data());
}
for (unsigned j = 0; j < count; ++j) {
const uint64_t correct = 0 == j % 3 ? nw : nsum;
ASSERT_EQ(host_result(j), (ScalarType)correct);
host_result(j) = 0;
}
#endif
if (count % 2 == 0) {
Kokkos::parallel_reduce(nw, functor_type(nw, count), host_result);
} else {
Kokkos::parallel_reduce(str, nw, functor_type(nw, count), host_result);
}
Kokkos::fence("Fence before accessing result on the host");
for (unsigned j = 0; j < count; ++j) {
const uint64_t correct = 0 == j % 3 ? nw : nsum;
ASSERT_EQ(host_result(j), (ScalarType)correct);
@ -539,10 +554,12 @@ class TestReduceDynamicView {
} // namespace
// FIXME_SYCL
// FIXME_OPENMPTARGET : The feature works with LLVM/13 on NVIDIA
// architectures. The jenkins currently tests with LLVM/12.
#if defined(KOKKOS_ENABLE_OPENMPTARGET) && defined(KOKKOS_COMPILER_CLANG) && \
(KOKKOS_COMPILER_CLANG >= 1300)
#if !defined(KOKKOS_ENABLE_SYCL) && \
(!defined(KOKKOS_ENABLE_OPENMPTARGET) || \
defined(KOKKOS_COMPILER_CLANG) && (KOKKOS_COMPILER_CLANG >= 1300))
TEST(TEST_CATEGORY, int64_t_reduce) {
TestReduce<int64_t, TEST_EXECSPACE>(0);
TestReduce<int64_t, TEST_EXECSPACE>(1000000);
@ -585,9 +602,9 @@ TEST(TEST_CATEGORY, int_combined_reduce) {
Kokkos::RangePolicy<TEST_EXECSPACE>(0, nw),
functor_type(nw), result1, result2, result3);
ASSERT_EQ(nw, result1);
ASSERT_EQ(nsum, result2);
ASSERT_EQ(nsum, result3);
ASSERT_EQ(nw, uint64_t(result1));
ASSERT_EQ(nsum, uint64_t(result2));
ASSERT_EQ(nsum, uint64_t(result3));
}
TEST(TEST_CATEGORY, mdrange_combined_reduce) {
@ -606,9 +623,9 @@ TEST(TEST_CATEGORY, mdrange_combined_reduce) {
{{nw, 1, 1}}),
functor_type(nw), result1, result2, result3);
ASSERT_EQ(nw, result1);
ASSERT_EQ(nsum, result2);
ASSERT_EQ(nsum, result3);
ASSERT_EQ(nw, uint64_t(result1));
ASSERT_EQ(nsum, uint64_t(result2));
ASSERT_EQ(nsum, uint64_t(result3));
}
TEST(TEST_CATEGORY, int_combined_reduce_mixed) {
@ -629,9 +646,9 @@ TEST(TEST_CATEGORY, int_combined_reduce_mixed) {
functor_type(nw), result1_v, result2,
Kokkos::Sum<int64_t, Kokkos::HostSpace>{result3_v});
ASSERT_EQ(nw, result1_v());
ASSERT_EQ(nsum, result2);
ASSERT_EQ(nsum, result3_v());
ASSERT_EQ(int64_t(nw), result1_v());
ASSERT_EQ(int64_t(nsum), result2);
ASSERT_EQ(int64_t(nsum), result3_v());
}
#endif
} // namespace Test