Update Kokkos library in LAMMPS to v3.7.0

This commit is contained in:
Stan Gerald Moore
2022-10-04 14:04:40 -06:00
parent dd072f7e08
commit f9f9e44f2d
653 changed files with 41432 additions and 33597 deletions

View File

@ -46,8 +46,9 @@
#define KOKKOS_ALGORITHMS_UNITTESTS_TEST_STD_ALGOS_COMMON_HPP
#include <gtest/gtest.h>
#include <Kokkos_StdAlgorithms.hpp>
#include <TestStdAlgorithmsHelperFunctors.hpp>
#include <std_algorithms/Kokkos_BeginEnd.hpp>
#include <utility>
#include <numeric>
#include <random>
@ -249,6 +250,71 @@ struct std_algorithms_test : public ::testing::Test {
}
};
struct CustomValueType {
KOKKOS_INLINE_FUNCTION
CustomValueType(){};
KOKKOS_INLINE_FUNCTION
CustomValueType(value_type val) : value(val){};
KOKKOS_INLINE_FUNCTION
CustomValueType(const CustomValueType& other) { this->value = other.value; }
KOKKOS_INLINE_FUNCTION
explicit operator value_type() const { return value; }
KOKKOS_INLINE_FUNCTION
value_type& operator()() { return value; }
KOKKOS_INLINE_FUNCTION
const value_type& operator()() const { return value; }
KOKKOS_INLINE_FUNCTION
CustomValueType& operator+=(const CustomValueType& other) {
this->value += other.value;
return *this;
}
KOKKOS_INLINE_FUNCTION
CustomValueType& operator=(const CustomValueType& other) {
this->value = other.value;
return *this;
}
KOKKOS_INLINE_FUNCTION
CustomValueType operator+(const CustomValueType& other) const {
CustomValueType result;
result.value = this->value + other.value;
return result;
}
KOKKOS_INLINE_FUNCTION
CustomValueType operator-(const CustomValueType& other) const {
CustomValueType result;
result.value = this->value - other.value;
return result;
}
KOKKOS_INLINE_FUNCTION
CustomValueType operator*(const CustomValueType& other) const {
CustomValueType result;
result.value = this->value * other.value;
return result;
}
KOKKOS_INLINE_FUNCTION
bool operator==(const CustomValueType& other) const {
return this->value == other.value;
}
private:
friend std::ostream& operator<<(std::ostream& os,
const CustomValueType& custom_value_type) {
return os << custom_value_type.value;
}
value_type value = {};
};
} // namespace stdalgos
} // namespace Test