Skip to content

Commit

Permalink
kokkos#253 fix remaining uses of std::experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
nmm0 committed Apr 21, 2023
1 parent 69eafa4 commit 08b5968
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions benchmarks/fill.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ T&& _repeated_with(T&& v) noexcept { return std::forward<T>(v); }

template <class T, class SizeT, class... Rest, class RNG, class Dist>
void _do_fill_random(
std::experimental::mdspan<T, std::experimental::extents<SizeT>, Rest...> s,
md::mdspan<T, md::extents<SizeT>, Rest...> s,
RNG& gen,
Dist& dist
)
Expand All @@ -69,20 +69,20 @@ void _do_fill_random(

template <class T, class SizeT, size_t E, size_t... Es, class... Rest, class RNG, class Dist>
void _do_fill_random(
std::experimental::mdspan<T, std::experimental::extents<SizeT, E, Es...>, Rest...> s,
md::mdspan<T, md::extents<SizeT, E, Es...>, Rest...> s,
RNG& gen,
Dist& dist
)
{
for(SizeT i = 0; i < s.extent(0); ++i) {
_do_fill_random(std::experimental::submdspan(s, i, _repeated_with<decltype(Es)>(std::experimental::full_extent)...), gen, dist);
_do_fill_random(mdex::submdspan(s, i, _repeated_with<decltype(Es)>(md::full_extent)...), gen, dist);
}
}

} // end namespace _impl

template <class T, class E, class... Rest>
void fill_random(std::experimental::mdspan<T, E, Rest...> s, long long seed = 1234) {
void fill_random(md::mdspan<T, E, Rest...> s, long long seed = 1234) {
std::mt19937 gen(seed);
auto val_dist = std::uniform_int_distribution<>(0, 127);
_impl::_do_fill_random(s, gen, val_dist);
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/stencil/openmp/stencil_3d_openmp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ BENCHMARK_CAPTURE(BM_Raw_OpenMP_Stencil_3D_left, size_400_400_400, int(), 400, 4

template <class MDSpan>
typename MDSpan::value_type*** make_3d_ptr_array(MDSpan s) {
static_assert(std::is_same<typename MDSpan::layout_type,std::experimental::layout_right>::value,"Creating MD Ptr only works from mdspan with layout_right");
static_assert(std::is_same<typename MDSpan::layout_type,md::layout_right>::value,"Creating MD Ptr only works from mdspan with layout_right");
using value_type = typename MDSpan::value_type;
value_type*** ptr= new value_type**[s.extent(0)];
for(index_type i = 0; i<s.extent(0); i++) {
Expand Down
8 changes: 4 additions & 4 deletions benchmarks/sum/sum_submdspan_right.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
using index_type = int;

template <class T, size_t... Es>
using lmdspan = md::mdspan<T, std::experimental::extents<index_type, Es...>, md::layout_left>;
using lmdspan = md::mdspan<T, md::extents<index_type, Es...>, md::layout_left>;
template <class T, size_t... Es>
using rmdspan = md::mdspan<T, std::experimental::extents<index_type, Es...>, md::layout_right>;
using rmdspan = md::mdspan<T, md::extents<index_type, Es...>, md::layout_right>;

//================================================================================

Expand Down Expand Up @@ -120,7 +120,7 @@ template <class T, class... Rest>
MDSPAN_FORCE_INLINE_FUNCTION
_MDSPAN_CONSTEXPR_14 void _do_sum_submdspan(
T& sum,
md::mdspan<T, std::experimental::extents<index_type>, Rest...> s
md::mdspan<T, md::extents<index_type>, Rest...> s
)
{
sum += s();
Expand All @@ -130,7 +130,7 @@ template <class T, size_t E, size_t... Es, class... Rest>
MDSPAN_FORCE_INLINE_FUNCTION
_MDSPAN_CONSTEXPR_14 void _do_sum_submdspan(
T& sum,
md::mdspan<T, std::experimental::extents<index_type, E, Es...>, Rest...> s
md::mdspan<T, md::extents<index_type, E, Es...>, Rest...> s
)
{
for(index_type i = 0; i < s.extent(0); ++i) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ BENCHMARK_CAPTURE(BM_Raw_OpenMP_TinyMatrixSum_left, size_1000000_3_3, int(), 100

template <class MDSpan>
typename MDSpan::value_type*** make_3d_ptr_array(MDSpan s) {
static_assert(std::is_same<typename MDSpan::layout_type,std::experimental::layout_right>::value,"Creating MD Ptr only works from mdspan with layout_right");
static_assert(std::is_same<typename MDSpan::layout_type,md::layout_right>::value,"Creating MD Ptr only works from mdspan with layout_right");
using value_type = typename MDSpan::value_type;
using index_type = typename MDSpan::index_type;

Expand Down
12 changes: 6 additions & 6 deletions comp_bench/cbench_submdspan.cpp.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@

int test(int* data) {
#if defined(METABENCH)
auto sub0 = std::experimental::mdspan<int,
std::experimental::extents<
auto sub0 = md::mdspan<int,
md::extents<
<%= (["2"] * n).join(", ") %>
>
>(data);
<% (32/n).times do |k| %>
auto <%= "sub0_#{k}" %> = std::experimental::mdspan<int,
std::experimental::extents<
auto <%= "sub0_#{k}" %> = md::mdspan<int,
md::extents<
<%= (["#{k+2}"] * n).join(", ") %>
>
>(data);
<% n.times do |i| %>
auto <%= "sub#{i+1}_#{k}" %> = std::experimental::submdspan(
auto <%= "sub#{i+1}_#{k}" %> = mdex::submdspan(
<%= "sub#{i}_#{k}" %>,
1
<%= ", std::experimental::full_extent" * (n - i - 1) %>
<%= ", md::full_extent" * (n - i - 1) %>
);
<% end %>
<% end %>
Expand Down

0 comments on commit 08b5968

Please sign in to comment.