Skip to content

Commit d449f68

Browse files
committed
compiles with hacked version of kokkos 4.5.01
1 parent 90b5218 commit d449f68

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ if (PCMS_ENABLE_OMEGA_H)
4848
endif()
4949
#adios2 adds C and Fortran depending on how it was built
5050
find_package(ADIOS2 2.5 REQUIRED)
51-
find_package(Kokkos 3.0 REQUIRED)
51+
find_package(Kokkos 4.4 REQUIRED) #we need kokkos with vendored mdspan
5252

5353
## use pkgconfig since the fftw autoconf install produces
5454
## broken cmake config files

src/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ if (spdlog_FOUND)
8686
target_link_libraries(pcms_core PUBLIC spdlog::spdlog)
8787
endif()
8888

89-
9089
## export the library
9190
set_target_properties(pcms_core PROPERTIES
9291
PUBLIC_HEADER "${PCMS_HEADERS}")

src/pcms/arrays.h

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef PCMS_COUPLING_ARRAYS_H
22
#define PCMS_COUPLING_ARRAYS_H
3-
#include "pcms/external/mdspan.hpp"
3+
#include "mdspan/mdspan.hpp" //from kokkos
4+
#include "mdspan/mdarray.hpp" //from kokkos
45
#include "pcms/types.h"
56
#include "pcms/coordinate.h"
67
#include "pcms/external/span.h"
@@ -14,7 +15,7 @@ namespace detail
1415

1516
template <typename ElementType, typename MemorySpace>
1617
struct memory_space_accessor
17-
: public std::experimental::default_accessor<ElementType>
18+
: public Kokkos::default_accessor<ElementType>
1819
{
1920
using memory_space = MemorySpace;
2021
};
@@ -39,7 +40,7 @@ nonstd::span<typename ArrayType::value_type> GetSpan(ArrayType /* unused */)
3940
template <typename ContainerType, typename ElementType, typename Extents,
4041
typename LayoutPolicy, typename AccessorPolicy>
4142
auto make_mdspan(const ContainerType& /* unused */)
42-
-> std::experimental::mdspan<ElementType, Extents, LayoutPolicy,
43+
-> Kokkos::mdspan<ElementType, Extents, LayoutPolicy,
4344
AccessorPolicy>
4445
{
4546
static_assert(detail::dependent_always_false<ContainerType>::type,
@@ -96,38 +97,38 @@ class ScalarArray
9697
};
9798

9899
template <typename ElementType, typename CoordinateSystem,
99-
typename LayoutPolicy = std::experimental::layout_right,
100+
typename LayoutPolicy = Kokkos::layout_right,
100101
typename Container =
101102
std::vector<CoordinateElement<CoordinateSystem, ElementType>>,
102103
size_t N = 3>
103104

104-
using CoordinateMDArray = std::experimental::mdarray<
105+
using CoordinateMDArray = Kokkos::Experimental::mdarray<
105106
CoordinateElement<CoordinateSystem, ElementType>,
106-
std::experimental::extents<int, std::experimental::dynamic_extent, N>,
107+
Kokkos::extents<int, Kokkos::dynamic_extent, N>,
107108
LayoutPolicy, Container>;
108109

109110
template <typename ElementType,
110-
typename LayoutPolicy = std::experimental::layout_right,
111+
typename LayoutPolicy = Kokkos::layout_right,
111112
typename Container = std::vector<ElementType>>
112-
using MDArray = std::experimental::mdarray<
113+
using MDArray = Kokkos::Experimental::mdarray<
113114
ElementType,
114-
std::experimental::extents<int, std::experimental::dynamic_extent, 1>,
115+
Kokkos::extents<int, Kokkos::dynamic_extent, 1>,
115116
LayoutPolicy, Container>;
116117

117118
template <typename ElementType, typename CoordinateSystem, typename MemorySpace,
118119
size_t N = 1>
119-
using CoordinateArrayView = std::experimental::mdspan<
120+
using CoordinateArrayView = Kokkos::mdspan<
120121
CoordinateElement<ElementType, CoordinateSystem>,
121-
std::experimental::extents<LO, std::experimental::dynamic_extent, N>,
122-
std::experimental::layout_right,
122+
Kokkos::extents<LO, Kokkos::dynamic_extent, N>,
123+
Kokkos::layout_right,
123124
detail::memory_space_accessor<ElementType, MemorySpace>>;
124125

125126
// TODO make_mdspan
126127

127128
template <typename ElementType, typename MemorySpace>
128-
using ScalarArrayView = std::experimental::mdspan<
129-
ElementType, std::experimental::dextents<LO, 1>,
130-
std::experimental::layout_right,
129+
using ScalarArrayView = Kokkos::mdspan<
130+
ElementType, Kokkos::dextents<LO, 1>,
131+
Kokkos::layout_right,
131132
detail::memory_space_accessor<std::remove_reference_t<ElementType>,
132133
MemorySpace>>;
133134

src/pcms/xgc_reverse_classification.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include "pcms/types.h"
66
#include <unordered_map>
77
#include <set>
8-
#include "pcms/external/mdspan.hpp"
8+
#include "mdspan/mdspan.hpp" //from kokkos
99
#include "pcms/arrays.h"
1010
#include "pcms/memory_spaces.h"
1111
//#include <filesystem>

test/test_coordinate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <catch2/catch_approx.hpp>
33
#include <pcms/coordinate.h>
44
#include <pcms/coordinate_systems.h>
5-
#include <pcms/external/mdspan.hpp>
5+
#include "mdspan/mdspan.hpp" //from kokkos
66
#include <pcms/arrays.h>
77

88
using pcms::Cartesian;

0 commit comments

Comments
 (0)