diff --git a/benchmarks/gbench/common/sort.cpp b/benchmarks/gbench/common/sort.cpp index b0b8b68e06..52698199cc 100644 --- a/benchmarks/gbench/common/sort.cpp +++ b/benchmarks/gbench/common/sort.cpp @@ -21,11 +21,7 @@ class DRSortFixture : public benchmark::Fixture { a = new xhp::distributed_vector(default_vector_size); std::vector local(default_vector_size); fill_random(local); -#ifdef BENCH_SHP - xhp::copy(local.begin(), local.end(), rng::begin(*a)); -#else xhp::copy(local, rng::begin(*a)); -#endif } void TearDown(::benchmark::State &) { delete a; } diff --git a/include/dr/mhp/algorithms/copy.hpp b/include/dr/mhp/algorithms/copy.hpp index fa53a119a3..6dbd9fe4e6 100644 --- a/include/dr/mhp/algorithms/copy.hpp +++ b/include/dr/mhp/algorithms/copy.hpp @@ -25,6 +25,17 @@ void copy(DI_IN &&first, DI_IN &&last, dr::distributed_iterator auto &&out) { copy(rng::subrange(first, last), out); } +template +void copy(CI_IN &&first, CI_IN &&last, + dr::distributed_contiguous_iterator auto out) { + copy(0, rng::subrange(first, last), out); +} + +template +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) { diff --git a/include/dr/shp/algorithms/copy.hpp b/include/dr/shp/algorithms/copy.hpp index 8d59a4d99d..486228aab5 100644 --- a/include/dr/shp/algorithms/copy.hpp +++ b/include/dr/shp/algorithms/copy.hpp @@ -130,6 +130,11 @@ sycl::event copy_async(InputIt first, InputIt last, OutputIt d_first) { return dr::shp::__detail::combine_events(events); } +template +void copy(InputIt first, OutputIt d_first) { + copy(rng::begin(first), rng::end(first), d_first); +} + template requires __detail::is_syclmemcopyable, std::iter_value_t>