Update Kokkos library in LAMMPS to v3.5.0

This commit is contained in:
Stan Gerald Moore
2021-11-04 12:45:59 -06:00
parent 515ef7bece
commit 564098e629
396 changed files with 21892 additions and 8508 deletions

View File

@ -10,9 +10,7 @@
#INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/../../algorithms/src")
# FIXME_OPENMPTARGET - the NVIDIA HPC compiler nvc++ in the OpenMPTarget backend does not pass the perf_tests.
IF (KOKKOS_ENABLE_OPENMPTARGET
AND (KOKKOS_CXX_COMPILER_ID STREQUAL PGI
OR KOKKOS_CXX_COMPILER_ID STREQUAL NVHPC))
IF (KOKKOS_ENABLE_OPENMPTARGET AND KOKKOS_CXX_COMPILER_ID STREQUAL NVHPC)
RETURN()
ENDIF()

View File

@ -231,7 +231,7 @@ void run_test_gramschmidt(int exp_beg, int exp_end, int num_trials,
std::cout << label_gramschmidt << " , " << parallel_work_length << " , "
<< min_seconds << " , " << (min_seconds / parallel_work_length)
<< std::endl;
<< ", " << avg_seconds << std::endl;
}
}

View File

@ -280,7 +280,7 @@ void run_test_hexgrad(int exp_beg, int exp_end, int num_trials,
std::cout << label_hexgrad << " , " << parallel_work_length << " , "
<< min_seconds << " , " << (min_seconds / parallel_work_length)
<< std::endl;
<< avg_seconds << std::endl;
}
}

View File

@ -205,7 +205,7 @@ TEST(default_exec, overlap_range_policy) {
double time_end = timer.seconds();
if (SpaceInstance<TEST_EXECSPACE>::overlap()) {
ASSERT_TRUE((time_end > 1.5 * time_overlap));
ASSERT_GT(time_end, 1.5 * time_overlap);
}
printf("Time RangePolicy: NonOverlap: %lf Time Overlap: %lf\n", time_end,
time_overlap);
@ -238,7 +238,7 @@ TEST(default_exec, overlap_range_policy) {
double time_not_fenced = timer.seconds();
Kokkos::fence();
if (SpaceInstance<TEST_EXECSPACE>::overlap()) {
ASSERT_TRUE(time_fenced > 2.0 * time_not_fenced);
ASSERT_GT(time_fenced, 2.0 * time_not_fenced);
}
timer.reset();
@ -280,7 +280,7 @@ TEST(default_exec, overlap_range_policy) {
ASSERT_EQ(h_result2(), h_result());
if (SpaceInstance<TEST_EXECSPACE>::overlap()) {
ASSERT_TRUE(time_overlapped_reduce < 1.5 * time_no_overlapped_reduce);
ASSERT_LT(time_overlapped_reduce, 1.5 * time_no_overlapped_reduce);
}
printf("Time RangePolicy Reduce: NonOverlap: %lf Time Overlap: %lf\n",
time_no_overlapped_reduce, time_overlapped_reduce);
@ -378,7 +378,7 @@ TEST(default_exec, overlap_mdrange_policy) {
double time_end = timer.seconds();
if (SpaceInstance<TEST_EXECSPACE>::overlap()) {
ASSERT_TRUE((time_end > 1.5 * time_overlap));
ASSERT_GT(time_end, 1.5 * time_overlap);
}
printf("Time MDRangePolicy: NonOverlap: %lf Time Overlap: %lf\n", time_end,
time_overlap);
@ -413,7 +413,7 @@ TEST(default_exec, overlap_mdrange_policy) {
double time_not_fenced = timer.seconds();
Kokkos::fence();
if (SpaceInstance<TEST_EXECSPACE>::overlap()) {
ASSERT_TRUE(time_fenced > 2.0 * time_not_fenced);
ASSERT_GT(time_fenced, 2.0 * time_not_fenced);
}
timer.reset();
@ -459,7 +459,7 @@ TEST(default_exec, overlap_mdrange_policy) {
ASSERT_EQ(h_result2(), h_result());
if (SpaceInstance<TEST_EXECSPACE>::overlap()) {
ASSERT_TRUE(time_overlapped_reduce < 1.5 * time_no_overlapped_reduce);
ASSERT_LT(time_overlapped_reduce, 1.5 * time_no_overlapped_reduce);
}
printf("Time MDRangePolicy Reduce: NonOverlap: %lf Time Overlap: %lf\n",
time_no_overlapped_reduce, time_overlapped_reduce);
@ -548,7 +548,7 @@ TEST(default_exec, overlap_team_policy) {
double time_end = timer.seconds();
if (SpaceInstance<TEST_EXECSPACE>::overlap()) {
ASSERT_TRUE((time_end > 1.5 * time_overlap));
ASSERT_GT(time_end, 1.5 * time_overlap);
}
printf("Time TeamPolicy: NonOverlap: %lf Time Overlap: %lf\n", time_end,
time_overlap);
@ -581,7 +581,7 @@ TEST(default_exec, overlap_team_policy) {
double time_not_fenced = timer.seconds();
Kokkos::fence();
if (SpaceInstance<TEST_EXECSPACE>::overlap()) {
ASSERT_TRUE(time_fenced > 2.0 * time_not_fenced);
ASSERT_GT(time_fenced, 2.0 * time_not_fenced);
}
timer.reset();
Kokkos::parallel_reduce(
@ -622,7 +622,7 @@ TEST(default_exec, overlap_team_policy) {
ASSERT_EQ(h_result2(), h_result());
if (SpaceInstance<TEST_EXECSPACE>::overlap()) {
ASSERT_TRUE(time_overlapped_reduce < 1.5 * time_no_overlapped_reduce);
ASSERT_LT(time_overlapped_reduce, 1.5 * time_no_overlapped_reduce);
}
printf("Time TeamPolicy Reduce: NonOverlap: %lf Time Overlap: %lf\n",
time_no_overlapped_reduce, time_overlapped_reduce);

View File

@ -120,7 +120,8 @@ void run_allocateview_tests(int N, int R) {
{
Kokkos::Timer timer;
for (int r = 0; r < R; r++) {
double* a_ptr = (double*)Kokkos::kokkos_malloc("A", sizeof(double) * N8);
double* a_ptr =
static_cast<double*>(Kokkos::kokkos_malloc("A", sizeof(double) * N8));
Kokkos::parallel_for(
N8, KOKKOS_LAMBDA(const int& i) { a_ptr[i] = 0.0; });
Kokkos::fence();

View File

@ -47,10 +47,18 @@
namespace Test {
TEST(default_exec, ViewResize_Rank8) {
// FIXME_SYCL Avoid running out of resources on the CUDA GPU used in the CI
#ifdef KOKKOS_ENABLE_SYCL
printf("Resize View Performance for LayoutLeft:\n");
run_resizeview_tests8<Kokkos::LayoutLeft>(9, 1);
printf("Resize View Performance for LayoutRight:\n");
run_resizeview_tests8<Kokkos::LayoutRight>(9, 1);
#else
printf("Resize View Performance for LayoutLeft:\n");
run_resizeview_tests8<Kokkos::LayoutLeft>(10, 1);
printf("Resize View Performance for LayoutRight:\n");
run_resizeview_tests8<Kokkos::LayoutRight>(10, 1);
#endif
}
} // namespace Test

View File

@ -47,7 +47,7 @@
#include <cstdlib>
#include <Kokkos_Core.hpp>
#include <impl/Kokkos_Timer.hpp>
#include <Kokkos_Timer.hpp>
using exec_space = Kokkos::DefaultExecutionSpace;
@ -401,7 +401,7 @@ template <class T>
void Loop(int loop, int test, const char* type_name) {
LoopVariant<T>(loop, test);
Kokkos::Impl::Timer timer;
Kokkos::Timer timer;
T res = LoopVariant<T>(loop, test);
double time = timer.seconds();

View File

@ -12,13 +12,13 @@
#include <typeinfo>
#include <Kokkos_Core.hpp>
#include <impl/Kokkos_Timer.hpp>
#include <Kokkos_Timer.hpp>
using exec_space = Kokkos::DefaultExecutionSpace;
template <typename T>
void test(const int length) {
Kokkos::Impl::Timer timer;
Kokkos::Timer timer;
using vector = Kokkos::View<T*, exec_space>;

View File

@ -48,7 +48,7 @@
#include <limits>
#include <Kokkos_Core.hpp>
#include <impl/Kokkos_Timer.hpp>
#include <Kokkos_Timer.hpp>
using ExecSpace = Kokkos::DefaultExecutionSpace;
using MemorySpace = Kokkos::DefaultExecutionSpace::memory_space;
@ -100,7 +100,7 @@ struct TestFunctor {
const unsigned size_alloc = chunk * (1 + (j % chunk_span));
ptrs(j) = (uintptr_t)pool.allocate(size_alloc);
ptrs(j) = reinterpret_cast<uintptr_t>(pool.allocate(size_alloc));
if (ptrs(j)) ++update;
}
@ -129,7 +129,7 @@ struct TestFunctor {
const unsigned size_alloc = chunk * (1 + (j % chunk_span));
pool.deallocate((void*)ptrs(j), size_alloc);
pool.deallocate(reinterpret_cast<void*>(ptrs(j)), size_alloc);
}
}
@ -153,9 +153,9 @@ struct TestFunctor {
for (unsigned k = 0; k < repeat_inner; ++k) {
const unsigned size_alloc = chunk * (1 + (j % chunk_span));
pool.deallocate((void*)ptrs(j), size_alloc);
pool.deallocate(reinterpret_cast<void*>(ptrs(j)), size_alloc);
ptrs(j) = (uintptr_t)pool.allocate(size_alloc);
ptrs(j) = reinterpret_cast<uintptr_t>(pool.allocate(size_alloc));
if (0 == ptrs(j)) update++;
}
@ -266,7 +266,7 @@ int main(int argc, char* argv[]) {
TestFunctor functor(total_alloc_size, min_superblock_size, number_alloc,
fill_stride, chunk_span, repeat_inner);
Kokkos::Impl::Timer timer;
Kokkos::Timer timer;
if (!functor.test_fill()) {
Kokkos::abort("fill ");

View File

@ -56,7 +56,7 @@ int main() { return 0; }
#include <cstdlib>
#include <limits>
#include <impl/Kokkos_Timer.hpp>
#include <Kokkos_Timer.hpp>
using ExecSpace = Kokkos::DefaultExecutionSpace;
@ -220,7 +220,7 @@ int main(int argc, char* argv[]) {
double time_sum = 0;
for (int i = 0; i < test_repeat_outer; ++i) {
Kokkos::Impl::Timer timer;
Kokkos::Timer timer;
Functor::FutureType ftmp =
Kokkos::host_spawn(Kokkos::TaskSingle(sched), Functor(fib_input));