Update Kokkos library in LAMMPS to v3.3.0
This commit is contained in:
@ -806,7 +806,7 @@ class Random_XorShift64 {
|
||||
const double V = 2.0 * drand() - 1.0;
|
||||
S = U * U + V * V;
|
||||
}
|
||||
return U * std::sqrt(-2.0 * log(S) / S);
|
||||
return U * std::sqrt(-2.0 * std::log(S) / S);
|
||||
}
|
||||
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
@ -1042,7 +1042,7 @@ class Random_XorShift1024 {
|
||||
const double V = 2.0 * drand() - 1.0;
|
||||
S = U * U + V * V;
|
||||
}
|
||||
return U * std::sqrt(-2.0 * log(S) / S);
|
||||
return U * std::sqrt(-2.0 * std::log(S) / S);
|
||||
}
|
||||
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
|
||||
@ -222,12 +222,12 @@ class BinSort {
|
||||
"Kokkos::SortImpl::BinSortFunctor::bin_count", bin_op.max_bins());
|
||||
bin_count_const = bin_count_atomic;
|
||||
bin_offsets =
|
||||
offset_type(ViewAllocateWithoutInitializing(
|
||||
"Kokkos::SortImpl::BinSortFunctor::bin_offsets"),
|
||||
offset_type(view_alloc(WithoutInitializing,
|
||||
"Kokkos::SortImpl::BinSortFunctor::bin_offsets"),
|
||||
bin_op.max_bins());
|
||||
sort_order =
|
||||
offset_type(ViewAllocateWithoutInitializing(
|
||||
"Kokkos::SortImpl::BinSortFunctor::sort_order"),
|
||||
offset_type(view_alloc(WithoutInitializing,
|
||||
"Kokkos::SortImpl::BinSortFunctor::sort_order"),
|
||||
range_end - range_begin);
|
||||
}
|
||||
|
||||
@ -279,8 +279,8 @@ class BinSort {
|
||||
}
|
||||
|
||||
scratch_view_type sorted_values(
|
||||
ViewAllocateWithoutInitializing(
|
||||
"Kokkos::SortImpl::BinSortFunctor::sorted_values"),
|
||||
view_alloc(WithoutInitializing,
|
||||
"Kokkos::SortImpl::BinSortFunctor::sorted_values"),
|
||||
values.rank_dynamic > 0 ? len : KOKKOS_IMPL_CTOR_DEFAULT_ARG,
|
||||
values.rank_dynamic > 1 ? values.extent(1)
|
||||
: KOKKOS_IMPL_CTOR_DEFAULT_ARG,
|
||||
|
||||
@ -24,7 +24,7 @@ KOKKOS_ADD_TEST_LIBRARY(
|
||||
# avoid deprecation warnings from MSVC
|
||||
TARGET_COMPILE_DEFINITIONS(kokkosalgorithms_gtest PUBLIC GTEST_HAS_TR1_TUPLE=0 GTEST_HAS_PTHREAD=0)
|
||||
|
||||
IF(NOT (Kokkos_ENABLE_CUDA AND WIN32))
|
||||
IF((NOT (Kokkos_ENABLE_CUDA AND WIN32)) AND (NOT ("${KOKKOS_CXX_COMPILER_ID}" STREQUAL "Fujitsu")))
|
||||
TARGET_COMPILE_FEATURES(kokkosalgorithms_gtest PUBLIC cxx_std_11)
|
||||
ENDIF()
|
||||
|
||||
|
||||
@ -31,10 +31,10 @@ ifeq ($(KOKKOS_INTERNAL_USE_CUDA), 1)
|
||||
TEST_TARGETS += test-cuda
|
||||
endif
|
||||
|
||||
ifeq ($(KOKKOS_INTERNAL_USE_ROCM), 1)
|
||||
OBJ_ROCM = TestROCm.o UnitTestMain.o gtest-all.o
|
||||
TARGETS += KokkosAlgorithms_UnitTest_ROCm
|
||||
TEST_TARGETS += test-rocm
|
||||
ifeq ($(KOKKOS_INTERNAL_USE_HIP), 1)
|
||||
OBJ_HIP = TestHIP.o UnitTestMain.o gtest-all.o
|
||||
TARGETS += KokkosAlgorithms_UnitTest_HIP
|
||||
TEST_TARGETS += test-hip
|
||||
endif
|
||||
|
||||
ifeq ($(KOKKOS_INTERNAL_USE_PTHREADS), 1)
|
||||
@ -64,8 +64,8 @@ endif
|
||||
KokkosAlgorithms_UnitTest_Cuda: $(OBJ_CUDA) $(KOKKOS_LINK_DEPENDS)
|
||||
$(LINK) $(EXTRA_PATH) $(OBJ_CUDA) $(KOKKOS_LIBS) $(LIB) $(KOKKOS_LDFLAGS) $(LDFLAGS) -o KokkosAlgorithms_UnitTest_Cuda
|
||||
|
||||
KokkosAlgorithms_UnitTest_ROCm: $(OBJ_ROCM) $(KOKKOS_LINK_DEPENDS)
|
||||
$(LINK) $(EXTRA_PATH) $(OBJ_ROCM) $(KOKKOS_LIBS) $(LIB) $(KOKKOS_LDFLAGS) $(LDFLAGS) -o KokkosAlgorithms_UnitTest_ROCm
|
||||
KokkosAlgorithms_UnitTest_HIP: $(OBJ_HIP) $(KOKKOS_LINK_DEPENDS)
|
||||
$(LINK) $(EXTRA_PATH) $(OBJ_HIP) $(KOKKOS_LIBS) $(LIB) $(KOKKOS_LDFLAGS) $(LDFLAGS) -o KokkosAlgorithms_UnitTest_HIP
|
||||
|
||||
KokkosAlgorithms_UnitTest_Threads: $(OBJ_THREADS) $(KOKKOS_LINK_DEPENDS)
|
||||
$(LINK) $(EXTRA_PATH) $(OBJ_THREADS) $(KOKKOS_LIBS) $(LIB) $(KOKKOS_LDFLAGS) $(LDFLAGS) -o KokkosAlgorithms_UnitTest_Threads
|
||||
@ -82,8 +82,8 @@ KokkosAlgorithms_UnitTest_Serial: $(OBJ_SERIAL) $(KOKKOS_LINK_DEPENDS)
|
||||
test-cuda: KokkosAlgorithms_UnitTest_Cuda
|
||||
./KokkosAlgorithms_UnitTest_Cuda
|
||||
|
||||
test-rocm: KokkosAlgorithms_UnitTest_ROCm
|
||||
./KokkosAlgorithms_UnitTest_ROCm
|
||||
test-hip: KokkosAlgorithms_UnitTest_HIP
|
||||
./KokkosAlgorithms_UnitTest_HIP
|
||||
|
||||
test-threads: KokkosAlgorithms_UnitTest_Threads
|
||||
./KokkosAlgorithms_UnitTest_Threads
|
||||
|
||||
@ -1,92 +0,0 @@
|
||||
/*
|
||||
//@HEADER
|
||||
// ************************************************************************
|
||||
//
|
||||
// Kokkos v. 3.0
|
||||
// Copyright (2020) National Technology & Engineering
|
||||
// Solutions of Sandia, LLC (NTESS).
|
||||
//
|
||||
// Under the terms of Contract DE-NA0003525 with NTESS,
|
||||
// the U.S. Government retains certain rights in this software.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// 3. Neither the name of the Corporation nor the names of the
|
||||
// contributors may be used to endorse or promote products derived from
|
||||
// this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE
|
||||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Questions? Contact Christian R. Trott (crtrott@sandia.gov)
|
||||
//
|
||||
// ************************************************************************
|
||||
//@HEADER
|
||||
*/
|
||||
|
||||
#include <Kokkos_Macros.hpp>
|
||||
#ifdef KOKKOS_ENABLE_ROCM
|
||||
|
||||
#include <cstdint>
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include <Kokkos_Core.hpp>
|
||||
|
||||
#include <TestRandom.hpp>
|
||||
#include <TestSort.hpp>
|
||||
|
||||
namespace Test {
|
||||
|
||||
void rocm_test_random_xorshift64(int num_draws) {
|
||||
Impl::test_random<
|
||||
Kokkos::Random_XorShift64_Pool<Kokkos::Experimental::ROCm> >(num_draws);
|
||||
}
|
||||
|
||||
void rocm_test_random_xorshift1024(int num_draws) {
|
||||
Impl::test_random<
|
||||
Kokkos::Random_XorShift1024_Pool<Kokkos::Experimental::ROCm> >(num_draws);
|
||||
}
|
||||
|
||||
#define ROCM_RANDOM_XORSHIFT64(num_draws) \
|
||||
TEST(rocm, Random_XorShift64) { rocm_test_random_xorshift64(num_draws); }
|
||||
|
||||
#define ROCM_RANDOM_XORSHIFT1024(num_draws) \
|
||||
TEST(rocm, Random_XorShift1024) { rocm_test_random_xorshift1024(num_draws); }
|
||||
|
||||
#define ROCM_SORT_UNSIGNED(size) \
|
||||
TEST(rocm, SortUnsigned) { \
|
||||
Impl::test_sort<Kokkos::Experimental::ROCm, unsigned>(size); \
|
||||
}
|
||||
|
||||
ROCM_RANDOM_XORSHIFT64(132141141)
|
||||
ROCM_RANDOM_XORSHIFT1024(52428813)
|
||||
ROCM_SORT_UNSIGNED(171)
|
||||
|
||||
#undef ROCM_RANDOM_XORSHIFT64
|
||||
#undef ROCM_RANDOM_XORSHIFT1024
|
||||
#undef ROCM_SORT_UNSIGNED
|
||||
} // namespace Test
|
||||
#else
|
||||
void KOKKOS_ALGORITHMS_UNITTESTS_TESTROCM_PREVENT_LINK_ERROR() {}
|
||||
#endif /* #ifdef KOKKOS_ENABLE_ROCM */
|
||||
Reference in New Issue
Block a user