Update Kokkos library in LAMMPS to v3.2

This commit is contained in:
Stan Moore
2020-08-25 20:21:48 -06:00
parent 450fd12d31
commit 4d90c2b74b
1410 changed files with 19364 additions and 71953 deletions

View File

@ -66,11 +66,11 @@ struct TestViewOperator_LeftAndRight;
template <class DataType, class DeviceType>
struct TestViewOperator_LeftAndRight<DataType, DeviceType, 1> {
typedef typename DeviceType::execution_space execution_space;
typedef typename DeviceType::memory_space memory_space;
typedef typename execution_space::size_type size_type;
using execution_space = typename DeviceType::execution_space;
using memory_space = typename DeviceType::memory_space;
using size_type = typename execution_space::size_type;
typedef int value_type;
using value_type = int;
KOKKOS_INLINE_FUNCTION
static void join(volatile value_type& update,
@ -81,17 +81,16 @@ struct TestViewOperator_LeftAndRight<DataType, DeviceType, 1> {
KOKKOS_INLINE_FUNCTION
static void init(value_type& update) { update = 0; }
typedef Kokkos::View<DataType, Kokkos::LayoutLeft, execution_space,
Kokkos::MemoryTraits<Kokkos::Atomic> >
left_view;
using left_view = Kokkos::View<DataType, Kokkos::LayoutLeft, execution_space,
Kokkos::MemoryTraits<Kokkos::Atomic> >;
typedef Kokkos::View<DataType, Kokkos::LayoutRight, execution_space,
Kokkos::MemoryTraits<Kokkos::Atomic> >
right_view;
using right_view =
Kokkos::View<DataType, Kokkos::LayoutRight, execution_space,
Kokkos::MemoryTraits<Kokkos::Atomic> >;
typedef Kokkos::View<DataType, Kokkos::LayoutStride, execution_space,
Kokkos::MemoryTraits<Kokkos::Atomic> >
stride_view;
using stride_view =
Kokkos::View<DataType, Kokkos::LayoutStride, execution_space,
Kokkos::MemoryTraits<Kokkos::Atomic> >;
left_view left;
right_view right;
@ -123,21 +122,12 @@ struct TestViewOperator_LeftAndRight<DataType, DeviceType, 1> {
for (unsigned i0 = 0; i0 < unsigned(left.extent(0)); ++i0) {
// Below checks that values match, but unable to check the references.
// Should this be able to be checked?
#ifdef KOKKOS_ENABLE_DEPRECATED_CODE
if (left(i0) != left(i0, 0, 0, 0, 0, 0, 0, 0)) {
update |= 3;
}
if (right(i0) != right(i0, 0, 0, 0, 0, 0, 0, 0)) {
update |= 3;
}
#else
if (left(i0) != left.access(i0, 0, 0, 0, 0, 0, 0, 0)) {
update |= 3;
}
if (right(i0) != right.access(i0, 0, 0, 0, 0, 0, 0, 0)) {
update |= 3;
}
#endif
if (left(i0) != left_stride(i0)) {
update |= 4;
}
@ -157,39 +147,36 @@ struct TestViewOperator_LeftAndRight<DataType, DeviceType, 1> {
template <typename T, class DeviceType>
class TestAtomicViewAPI {
public:
typedef DeviceType device;
using device = DeviceType;
enum { N0 = 1000, N1 = 3, N2 = 5, N3 = 7 };
typedef Kokkos::View<T, device> dView0;
typedef Kokkos::View<T*, device> dView1;
typedef Kokkos::View<T * [N1], device> dView2;
typedef Kokkos::View<T * [N1][N2], device> dView3;
typedef Kokkos::View<T * [N1][N2][N3], device> dView4;
typedef Kokkos::View<const T * [N1][N2][N3], device> const_dView4;
typedef Kokkos::View<T****, device, Kokkos::MemoryUnmanaged> dView4_unmanaged;
typedef typename dView0::host_mirror_space host;
using dView0 = Kokkos::View<T, device>;
using dView1 = Kokkos::View<T*, device>;
using dView2 = Kokkos::View<T * [N1], device>;
using dView3 = Kokkos::View<T * [N1][N2], device>;
using dView4 = Kokkos::View<T * [N1][N2][N3], device>;
using const_dView4 = Kokkos::View<const T * [N1][N2][N3], device>;
using dView4_unmanaged = Kokkos::View<T****, device, Kokkos::MemoryUnmanaged>;
using host = typename dView0::host_mirror_space;
typedef Kokkos::View<T, device, Kokkos::MemoryTraits<Kokkos::Atomic> > aView0;
typedef Kokkos::View<T*, device, Kokkos::MemoryTraits<Kokkos::Atomic> >
aView1;
typedef Kokkos::View<T * [N1], device, Kokkos::MemoryTraits<Kokkos::Atomic> >
aView2;
typedef Kokkos::View<T * [N1][N2], device,
Kokkos::MemoryTraits<Kokkos::Atomic> >
aView3;
typedef Kokkos::View<T * [N1][N2][N3], device,
Kokkos::MemoryTraits<Kokkos::Atomic> >
aView4;
typedef Kokkos::View<const T * [N1][N2][N3], device,
Kokkos::MemoryTraits<Kokkos::Atomic> >
const_aView4;
using aView0 = Kokkos::View<T, device, Kokkos::MemoryTraits<Kokkos::Atomic> >;
using aView1 =
Kokkos::View<T*, device, Kokkos::MemoryTraits<Kokkos::Atomic> >;
using aView2 =
Kokkos::View<T * [N1], device, Kokkos::MemoryTraits<Kokkos::Atomic> >;
using aView3 =
Kokkos::View<T * [N1][N2], device, Kokkos::MemoryTraits<Kokkos::Atomic> >;
using aView4 = Kokkos::View<T * [N1][N2][N3], device,
Kokkos::MemoryTraits<Kokkos::Atomic> >;
using const_aView4 = Kokkos::View<const T * [N1][N2][N3], device,
Kokkos::MemoryTraits<Kokkos::Atomic> >;
typedef Kokkos::View<
T****, device, Kokkos::MemoryTraits<Kokkos::Unmanaged | Kokkos::Atomic> >
aView4_unmanaged;
using aView4_unmanaged =
Kokkos::View<T****, device,
Kokkos::MemoryTraits<Kokkos::Unmanaged | Kokkos::Atomic> >;
typedef typename aView0::host_mirror_space host_atomic;
using host_atomic = typename aView0::host_mirror_space;
TestAtomicViewAPI() {
TestViewOperator_LeftAndRight<int[2], device>::testit();
@ -281,7 +268,7 @@ class TestAtomicViewAPI {
unsigned(N0) * unsigned(N1) * unsigned(N2) * unsigned(N3));
}
typedef T DataType[2];
using DataType = T[2];
static void check_auto_conversion_to_const(
const Kokkos::View<const DataType, device,
@ -292,12 +279,10 @@ class TestAtomicViewAPI {
}
static void run_test_const() {
typedef Kokkos::View<DataType, device,
Kokkos::MemoryTraits<Kokkos::Atomic> >
typeX;
typedef Kokkos::View<const DataType, device,
Kokkos::MemoryTraits<Kokkos::Atomic> >
const_typeX;
using typeX =
Kokkos::View<DataType, device, Kokkos::MemoryTraits<Kokkos::Atomic> >;
using const_typeX = Kokkos::View<const DataType, device,
Kokkos::MemoryTraits<Kokkos::Atomic> >;
typeX x("X");
const_typeX xc = x;
@ -315,7 +300,7 @@ class TestAtomicViewAPI {
template <class T, class execution_space>
struct InitFunctor_Seq {
typedef Kokkos::View<T*, execution_space> view_type;
using view_type = Kokkos::View<T*, execution_space>;
view_type input;
const int64_t length;
@ -333,7 +318,7 @@ struct InitFunctor_Seq {
template <class T, class execution_space>
struct InitFunctor_ModTimes {
typedef Kokkos::View<T*, execution_space> view_type;
using view_type = Kokkos::View<T*, execution_space>;
view_type input;
const int64_t length;
@ -357,7 +342,7 @@ struct InitFunctor_ModTimes {
template <class T, class execution_space>
struct InitFunctor_ModShift {
typedef Kokkos::View<T*, execution_space> view_type;
using view_type = Kokkos::View<T*, execution_space>;
view_type input;
const int64_t length;
@ -383,10 +368,9 @@ struct InitFunctor_ModShift {
template <class T, class execution_space>
struct PlusEqualAtomicViewFunctor {
typedef Kokkos::View<T*, execution_space,
Kokkos::MemoryTraits<Kokkos::Atomic> >
atomic_view_type;
typedef Kokkos::View<T*, execution_space> view_type;
using atomic_view_type =
Kokkos::View<T*, execution_space, Kokkos::MemoryTraits<Kokkos::Atomic> >;
using view_type = Kokkos::View<T*, execution_space>;
view_type input;
atomic_view_type even_odd_result;
@ -411,8 +395,8 @@ struct PlusEqualAtomicViewFunctor {
template <class T, class execution_space>
T PlusEqualAtomicView(const int64_t input_length) {
typedef Kokkos::View<T*, execution_space> view_type;
typedef typename view_type::HostMirror host_view_type;
using view_type = Kokkos::View<T*, execution_space>;
using host_view_type = typename view_type::HostMirror;
const int64_t length = input_length;
@ -480,10 +464,9 @@ bool PlusEqualAtomicViewTest(int64_t input_length) {
template <class T, class execution_space>
struct MinusEqualAtomicViewFunctor {
typedef Kokkos::View<T*, execution_space,
Kokkos::MemoryTraits<Kokkos::Atomic> >
atomic_view_type;
typedef Kokkos::View<T*, execution_space> view_type;
using atomic_view_type =
Kokkos::View<T*, execution_space, Kokkos::MemoryTraits<Kokkos::Atomic> >;
using view_type = Kokkos::View<T*, execution_space>;
view_type input;
atomic_view_type even_odd_result;
@ -509,8 +492,8 @@ struct MinusEqualAtomicViewFunctor {
template <class T, class execution_space>
T MinusEqualAtomicView(const int64_t input_length) {
typedef Kokkos::View<T*, execution_space> view_type;
typedef typename view_type::HostMirror host_view_type;
using view_type = Kokkos::View<T*, execution_space>;
using host_view_type = typename view_type::HostMirror;
const int64_t length = input_length;
@ -578,10 +561,9 @@ bool MinusEqualAtomicViewTest(int64_t input_length) {
template <class T, class execution_space>
struct TimesEqualAtomicViewFunctor {
typedef Kokkos::View<T*, execution_space,
Kokkos::MemoryTraits<Kokkos::Atomic> >
atomic_view_type;
typedef Kokkos::View<T*, execution_space> view_type;
using atomic_view_type =
Kokkos::View<T*, execution_space, Kokkos::MemoryTraits<Kokkos::Atomic> >;
using view_type = Kokkos::View<T*, execution_space>;
view_type input;
atomic_view_type result;
@ -602,8 +584,8 @@ struct TimesEqualAtomicViewFunctor {
template <class T, class execution_space>
T TimesEqualAtomicView(const int64_t input_length, const int64_t remainder) {
typedef Kokkos::View<T*, execution_space> view_type;
typedef typename view_type::HostMirror host_view_type;
using view_type = Kokkos::View<T*, execution_space>;
using host_view_type = typename view_type::HostMirror;
const int64_t length = input_length;
@ -669,11 +651,10 @@ bool TimesEqualAtomicViewTest(const int64_t input_length) {
template <class T, class execution_space>
struct DivEqualAtomicViewFunctor {
typedef Kokkos::View<T, execution_space,
Kokkos::MemoryTraits<Kokkos::Atomic> >
atomic_view_type;
typedef Kokkos::View<T*, execution_space> view_type;
typedef Kokkos::View<T, execution_space> scalar_view_type;
using atomic_view_type =
Kokkos::View<T, execution_space, Kokkos::MemoryTraits<Kokkos::Atomic> >;
using view_type = Kokkos::View<T*, execution_space>;
using scalar_view_type = Kokkos::View<T, execution_space>;
view_type input;
atomic_view_type result;
@ -694,9 +675,9 @@ struct DivEqualAtomicViewFunctor {
template <class T, class execution_space>
T DivEqualAtomicView(const int64_t input_length, const int64_t remainder) {
typedef Kokkos::View<T*, execution_space> view_type;
typedef Kokkos::View<T, execution_space> scalar_view_type;
typedef typename scalar_view_type::HostMirror host_scalar_view_type;
using view_type = Kokkos::View<T*, execution_space>;
using scalar_view_type = Kokkos::View<T, execution_space>;
using host_scalar_view_type = typename scalar_view_type::HostMirror;
const int64_t length = input_length;
@ -760,11 +741,10 @@ bool DivEqualAtomicViewTest(const int64_t input_length) {
template <class T, class execution_space>
struct ModEqualAtomicViewFunctor {
typedef Kokkos::View<T, execution_space,
Kokkos::MemoryTraits<Kokkos::Atomic> >
atomic_view_type;
typedef Kokkos::View<T*, execution_space> view_type;
typedef Kokkos::View<T, execution_space> scalar_view_type;
using atomic_view_type =
Kokkos::View<T, execution_space, Kokkos::MemoryTraits<Kokkos::Atomic> >;
using view_type = Kokkos::View<T*, execution_space>;
using scalar_view_type = Kokkos::View<T, execution_space>;
view_type input;
atomic_view_type result;
@ -785,9 +765,9 @@ struct ModEqualAtomicViewFunctor {
template <class T, class execution_space>
T ModEqualAtomicView(const int64_t input_length, const int64_t remainder) {
typedef Kokkos::View<T*, execution_space> view_type;
typedef Kokkos::View<T, execution_space> scalar_view_type;
typedef typename scalar_view_type::HostMirror host_scalar_view_type;
using view_type = Kokkos::View<T*, execution_space>;
using scalar_view_type = Kokkos::View<T, execution_space>;
using host_scalar_view_type = typename scalar_view_type::HostMirror;
const int64_t length = input_length;
@ -855,11 +835,10 @@ bool ModEqualAtomicViewTest(const int64_t input_length) {
template <class T, class execution_space>
struct RSEqualAtomicViewFunctor {
typedef Kokkos::View<T****, execution_space,
Kokkos::MemoryTraits<Kokkos::Atomic> >
atomic_view_type;
typedef Kokkos::View<T*, execution_space> view_type;
typedef Kokkos::View<T****, execution_space> result_view_type;
using atomic_view_type = Kokkos::View<T****, execution_space,
Kokkos::MemoryTraits<Kokkos::Atomic> >;
using view_type = Kokkos::View<T*, execution_space>;
using result_view_type = Kokkos::View<T****, execution_space>;
const view_type input;
atomic_view_type result;
@ -890,9 +869,9 @@ struct RSEqualAtomicViewFunctor {
template <class T, class execution_space>
T RSEqualAtomicView(const int64_t input_length, const int64_t value,
const int64_t remainder) {
typedef Kokkos::View<T*, execution_space> view_type;
typedef Kokkos::View<T****, execution_space> result_view_type;
typedef typename result_view_type::HostMirror host_scalar_view_type;
using view_type = Kokkos::View<T*, execution_space>;
using result_view_type = Kokkos::View<T****, execution_space>;
using host_scalar_view_type = typename result_view_type::HostMirror;
const int64_t length = input_length;
@ -983,11 +962,10 @@ bool RSEqualAtomicViewTest(const int64_t input_length) {
template <class T, class execution_space>
struct LSEqualAtomicViewFunctor {
typedef Kokkos::View<T****, execution_space,
Kokkos::MemoryTraits<Kokkos::Atomic> >
atomic_view_type;
typedef Kokkos::View<T*, execution_space> view_type;
typedef Kokkos::View<T****, execution_space> result_view_type;
using atomic_view_type = Kokkos::View<T****, execution_space,
Kokkos::MemoryTraits<Kokkos::Atomic> >;
using view_type = Kokkos::View<T*, execution_space>;
using result_view_type = Kokkos::View<T****, execution_space>;
view_type input;
atomic_view_type result;
@ -1018,9 +996,9 @@ struct LSEqualAtomicViewFunctor {
template <class T, class execution_space>
T LSEqualAtomicView(const int64_t input_length, const int64_t value,
const int64_t remainder) {
typedef Kokkos::View<T*, execution_space> view_type;
typedef Kokkos::View<T****, execution_space> result_view_type;
typedef typename result_view_type::HostMirror host_scalar_view_type;
using view_type = Kokkos::View<T*, execution_space>;
using result_view_type = Kokkos::View<T****, execution_space>;
using host_scalar_view_type = typename result_view_type::HostMirror;
const int64_t length = input_length;
@ -1111,10 +1089,9 @@ bool LSEqualAtomicViewTest(const int64_t input_length) {
template <class T, class execution_space>
struct AndEqualAtomicViewFunctor {
typedef Kokkos::View<T*, execution_space,
Kokkos::MemoryTraits<Kokkos::Atomic> >
atomic_view_type;
typedef Kokkos::View<T*, execution_space> view_type;
using atomic_view_type =
Kokkos::View<T*, execution_space, Kokkos::MemoryTraits<Kokkos::Atomic> >;
using view_type = Kokkos::View<T*, execution_space>;
view_type input;
atomic_view_type even_odd_result;
@ -1139,8 +1116,8 @@ struct AndEqualAtomicViewFunctor {
template <class T, class execution_space>
T AndEqualAtomicView(const int64_t input_length) {
typedef Kokkos::View<T*, execution_space> view_type;
typedef typename view_type::HostMirror host_view_type;
using view_type = Kokkos::View<T*, execution_space>;
using host_view_type = typename view_type::HostMirror;
const int64_t length = input_length;
@ -1205,10 +1182,9 @@ bool AndEqualAtomicViewTest(int64_t input_length) {
template <class T, class execution_space>
struct OrEqualAtomicViewFunctor {
typedef Kokkos::View<T*, execution_space,
Kokkos::MemoryTraits<Kokkos::Atomic> >
atomic_view_type;
typedef Kokkos::View<T*, execution_space> view_type;
using atomic_view_type =
Kokkos::View<T*, execution_space, Kokkos::MemoryTraits<Kokkos::Atomic> >;
using view_type = Kokkos::View<T*, execution_space>;
view_type input;
atomic_view_type even_odd_result;
@ -1233,8 +1209,8 @@ struct OrEqualAtomicViewFunctor {
template <class T, class execution_space>
T OrEqualAtomicView(const int64_t input_length) {
typedef Kokkos::View<T*, execution_space> view_type;
typedef typename view_type::HostMirror host_view_type;
using view_type = Kokkos::View<T*, execution_space>;
using host_view_type = typename view_type::HostMirror;
const int64_t length = input_length;
@ -1298,10 +1274,9 @@ bool OrEqualAtomicViewTest(int64_t input_length) {
template <class T, class execution_space>
struct XOrEqualAtomicViewFunctor {
typedef Kokkos::View<T*, execution_space,
Kokkos::MemoryTraits<Kokkos::Atomic> >
atomic_view_type;
typedef Kokkos::View<T*, execution_space> view_type;
using atomic_view_type =
Kokkos::View<T*, execution_space, Kokkos::MemoryTraits<Kokkos::Atomic> >;
using view_type = Kokkos::View<T*, execution_space>;
view_type input;
atomic_view_type even_odd_result;
@ -1326,8 +1301,8 @@ struct XOrEqualAtomicViewFunctor {
template <class T, class execution_space>
T XOrEqualAtomicView(const int64_t input_length) {
typedef Kokkos::View<T*, execution_space> view_type;
typedef typename view_type::HostMirror host_view_type;
using view_type = Kokkos::View<T*, execution_space>;
using host_view_type = typename view_type::HostMirror;
const int64_t length = input_length;