From faacf2bf21d0f90bd13444cc0988de9f582f0053 Mon Sep 17 00:00:00 2001 From: Kacper Stefanski Date: Tue, 14 Nov 2023 21:42:39 +0100 Subject: [PATCH] added a new mhp::copy signature remove ifdef BENCH_SHP in sort --- benchmarks/gbench/common/sort.cpp | 8 ++++---- include/dr/mhp/algorithms/copy.hpp | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/benchmarks/gbench/common/sort.cpp b/benchmarks/gbench/common/sort.cpp index b0b8b68e06..3d6db6bdc5 100644 --- a/benchmarks/gbench/common/sort.cpp +++ b/benchmarks/gbench/common/sort.cpp @@ -21,11 +21,11 @@ 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 + // #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; } diff --git a/include/dr/mhp/algorithms/copy.hpp b/include/dr/mhp/algorithms/copy.hpp index fa53a119a3..feffb73935 100644 --- a/include/dr/mhp/algorithms/copy.hpp +++ b/include/dr/mhp/algorithms/copy.hpp @@ -25,6 +25,12 @@ 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); +} + /// Copy distributed to local void copy(std::size_t root, dr::distributed_contiguous_range auto &&in, std::contiguous_iterator auto out) {