Skip to content

Commit

Permalink
add a ranges contiguous_range mhp::copy signature
Browse files Browse the repository at this point in the history
  • Loading branch information
haichangsi committed Nov 28, 2023
1 parent f93f73b commit 840910b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions benchmarks/gbench/common/sort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class DRSortFixture : public benchmark::Fixture {
std::vector<T> local(default_vector_size);
fill_random(local);
// #ifdef BENCH_SHP
xhp::copy(local.begin(), local.end(), rng::begin(*a));
// xhp::copy(local.begin(), local.end(), rng::begin(*a));
// #else
// xhp::copy(local, rng::begin(*a));
xhp::copy(local, rng::begin(*a));
// #endif
}

Expand Down
5 changes: 5 additions & 0 deletions include/dr/mhp/algorithms/copy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ void copy(CI_IN &&first, CI_IN &&last,
copy(0, rng::subrange(first, last), out);
}

template <rng::contiguous_range CR_IN>
void copy(CR_IN &&in, dr::distributed_contiguous_iterator auto out) {
copy(0, in, out);
}

/// Copy distributed to local
void copy(std::size_t root, dr::distributed_contiguous_range auto &&in,
std::contiguous_iterator auto out) {
Expand Down

0 comments on commit 840910b

Please sign in to comment.