Update Kokkos library in LAMMPS to v4.5.0

This commit is contained in:
Stan Moore
2024-12-13 09:23:03 -07:00
parent a78aee5731
commit 7f68aeb6d5
617 changed files with 21499 additions and 17255 deletions

View File

@ -14,10 +14,11 @@
//
//@HEADER
#include <Kokkos_Core.hpp>
#include <sstream>
#include <Kokkos_Macros.hpp>
// Suppress "'long double' is treated as 'double' in device code"
// The suppression needs to happen before Kokkos_Complex.hpp is included to be
// effective
#ifdef KOKKOS_COMPILER_NVCC
#ifdef __NVCC_DIAG_PRAGMA_SUPPORT__
#pragma nv_diagnostic push
@ -25,11 +26,14 @@
#else
#ifdef __CUDA_ARCH__
#pragma diagnostic push
#pragma diag_suppress 20208
#pragma diag_suppress 3245
#endif
#endif
#endif
#include <Kokkos_Core.hpp>
#include <sstream>
namespace {
template <typename... Ts>
KOKKOS_FUNCTION constexpr void maybe_unused(Ts &&...) noexcept {}
@ -417,8 +421,8 @@ TEST(TEST_CATEGORY, complex_trivially_copyable) {
using RealType = double;
// clang claims compatibility with gcc 4.2.1 but all versions tested know
// about std::is_trivially_copyable.
ASSERT_TRUE(std::is_trivially_copyable<Kokkos::complex<RealType>>::value ||
!std::is_trivially_copyable<RealType>::value);
ASSERT_TRUE(std::is_trivially_copyable_v<Kokkos::complex<RealType>> ||
!std::is_trivially_copyable_v<RealType>);
}
template <class ExecSpace>
@ -514,21 +518,19 @@ TEST(TEST_CATEGORY, complex_operations_arithmetic_types_overloads) {
static_assert(Kokkos::real(2.f) == 2.f);
static_assert(Kokkos::real(3.) == 3.);
static_assert(Kokkos::real(4.l) == 4.l);
static_assert((std::is_same<decltype(Kokkos::real(1)), double>::value));
static_assert((std::is_same<decltype(Kokkos::real(2.f)), float>::value));
static_assert((std::is_same<decltype(Kokkos::real(3.)), double>::value));
static_assert(
(std::is_same<decltype(Kokkos::real(4.l)), long double>::value));
static_assert((std::is_same_v<decltype(Kokkos::real(1)), double>));
static_assert((std::is_same_v<decltype(Kokkos::real(2.f)), float>));
static_assert((std::is_same_v<decltype(Kokkos::real(3.)), double>));
static_assert((std::is_same_v<decltype(Kokkos::real(4.l)), long double>));
static_assert(Kokkos::imag(1) == 0.);
static_assert(Kokkos::imag(2.f) == 0.f);
static_assert(Kokkos::imag(3.) == 0.);
static_assert(Kokkos::imag(4.l) == 0.l);
static_assert((std::is_same<decltype(Kokkos::imag(1)), double>::value));
static_assert((std::is_same<decltype(Kokkos::imag(2.f)), float>::value));
static_assert((std::is_same<decltype(Kokkos::imag(3.)), double>::value));
static_assert(
(std::is_same<decltype(Kokkos::real(4.l)), long double>::value));
static_assert((std::is_same_v<decltype(Kokkos::imag(1)), double>));
static_assert((std::is_same_v<decltype(Kokkos::imag(2.f)), float>));
static_assert((std::is_same_v<decltype(Kokkos::imag(3.)), double>));
static_assert((std::is_same_v<decltype(Kokkos::real(4.l)), long double>));
// FIXME in principle could be checked at compile time too
ASSERT_EQ(Kokkos::conj(1), Kokkos::complex<double>(1));
@ -538,15 +540,15 @@ TEST(TEST_CATEGORY, complex_operations_arithmetic_types_overloads) {
// power of two.
#ifndef KOKKOS_IMPL_32BIT
ASSERT_EQ(Kokkos::conj(4.l), Kokkos::complex<long double>(4.l));
static_assert((
std::is_same<decltype(Kokkos::conj(1)), Kokkos::complex<double>>::value));
static_assert(
(std::is_same_v<decltype(Kokkos::conj(1)), Kokkos::complex<double>>));
#endif
static_assert((std::is_same<decltype(Kokkos::conj(2.f)),
Kokkos::complex<float>>::value));
static_assert((std::is_same<decltype(Kokkos::conj(3.)),
Kokkos::complex<double>>::value));
static_assert((std::is_same<decltype(Kokkos::conj(4.l)),
Kokkos::complex<long double>>::value));
static_assert(
(std::is_same_v<decltype(Kokkos::conj(2.f)), Kokkos::complex<float>>));
static_assert(
(std::is_same_v<decltype(Kokkos::conj(3.)), Kokkos::complex<double>>));
static_assert((std::is_same_v<decltype(Kokkos::conj(4.l)),
Kokkos::complex<long double>>));
}
template <class ExecSpace>