Update Kokkos library in LAMMPS to v3.4.1
This commit is contained in:
@ -5,10 +5,12 @@ KOKKOS_SUBPACKAGE(Algorithms)
|
||||
IF (NOT Kokkos_INSTALL_TESTING)
|
||||
ADD_SUBDIRECTORY(src)
|
||||
ENDIF()
|
||||
|
||||
KOKKOS_ADD_TEST_DIRECTORIES(unit_tests)
|
||||
IF(NOT (KOKKOS_ENABLE_OPENMPTARGET
|
||||
AND (KOKKOS_CXX_COMPILER_ID STREQUAL PGI OR
|
||||
KOKKOS_CXX_COMPILER_ID STREQUAL NVHPC)))
|
||||
KOKKOS_ADD_TEST_DIRECTORIES(unit_tests)
|
||||
ENDIF()
|
||||
|
||||
KOKKOS_SUBPACKAGE_POSTPROCESS()
|
||||
|
||||
|
||||
|
||||
|
||||
@ -687,6 +687,24 @@ struct Random_UniqueIndex<Kokkos::Experimental::SYCL> {
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef KOKKOS_ENABLE_OPENMPTARGET
|
||||
template <>
|
||||
struct Random_UniqueIndex<Kokkos::Experimental::OpenMPTarget> {
|
||||
using locks_view_type = View<int*, Kokkos::Experimental::OpenMPTarget>;
|
||||
KOKKOS_FUNCTION
|
||||
static int get_state_idx(const locks_view_type& locks) {
|
||||
const int team_size = omp_get_num_threads();
|
||||
int i = omp_get_team_num() * team_size + omp_get_thread_num();
|
||||
const int lock_size = locks.extent_int(0);
|
||||
|
||||
while (Kokkos::atomic_compare_exchange(&locks(i), 0, 1)) {
|
||||
i = (i + 1) % lock_size;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
} // namespace Impl
|
||||
|
||||
template <class DeviceType>
|
||||
|
||||
@ -44,7 +44,7 @@ IF(Kokkos_ENABLE_OPENMP)
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
foreach(Tag Threads;Serial;OpenMP;Cuda;HPX;HIP;SYCL)
|
||||
foreach(Tag Threads;Serial;OpenMP;Cuda;HPX;HIP;SYCL;OpenMPTarget)
|
||||
# Because there is always an exception to the rule
|
||||
if(Tag STREQUAL "Threads")
|
||||
set(DEVICE "PTHREAD")
|
||||
|
||||
@ -109,6 +109,16 @@ struct RandomProperties {
|
||||
}
|
||||
};
|
||||
|
||||
// FIXME_OPENMPTARGET: Need this for OpenMPTarget because contra to the standard
|
||||
// llvm requires the binary operator defined not just the +=
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
RandomProperties operator+(const RandomProperties& org,
|
||||
const RandomProperties& add) {
|
||||
RandomProperties val = org;
|
||||
val += add;
|
||||
return val;
|
||||
}
|
||||
|
||||
template <class GeneratorPool, class Scalar>
|
||||
struct test_random_functor {
|
||||
using rnd_type = typename GeneratorPool::generator_type;
|
||||
|
||||
@ -370,7 +370,10 @@ template <class ExecutionSpace, typename KeyType>
|
||||
void test_sort(unsigned int N) {
|
||||
test_1D_sort<ExecutionSpace, KeyType>(N);
|
||||
test_3D_sort<ExecutionSpace, KeyType>(N);
|
||||
// FIXME_OPENMPTARGET: OpenMPTarget doesn't support DynamicView yet.
|
||||
#ifndef KOKKOS_ENABLE_OPENMPTARGET
|
||||
test_dynamic_view_sort<ExecutionSpace, KeyType>(N);
|
||||
#endif
|
||||
test_issue_1160_sort<ExecutionSpace>();
|
||||
}
|
||||
} // namespace Impl
|
||||
|
||||
Reference in New Issue
Block a user