Skip to content

Commit

Permalink
added a new mhp::copy signature
Browse files Browse the repository at this point in the history
remove ifdef BENCH_SHP in sort
  • Loading branch information
haichangsi committed Nov 15, 2023
1 parent 4848345 commit faacf2b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 4 additions & 4 deletions benchmarks/gbench/common/sort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ class DRSortFixture : public benchmark::Fixture {
a = new xhp::distributed_vector<T>(default_vector_size);
std::vector<T> local(default_vector_size);
fill_random(local);
#ifdef BENCH_SHP
// #ifdef BENCH_SHP
xhp::copy(local.begin(), local.end(), rng::begin(*a));
#else
xhp::copy(local, rng::begin(*a));
#endif
// #else
// xhp::copy(local, rng::begin(*a));
// #endif
}

void TearDown(::benchmark::State &) { delete a; }
Expand Down
6 changes: 6 additions & 0 deletions include/dr/mhp/algorithms/copy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ void copy(DI_IN &&first, DI_IN &&last, dr::distributed_iterator auto &&out) {
copy(rng::subrange(first, last), out);
}

template <std::contiguous_iterator CI_IN>
void copy(CI_IN &&first, CI_IN &&last,
dr::distributed_contiguous_iterator auto out) {
copy(0, rng::subrange(first, last), 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 faacf2b

Please sign in to comment.