Distributed Ranges
Loading...
Searching...
No Matches
include
dr
mp
algorithms
fill.hpp
1
// SPDX-FileCopyrightText: Intel Corporation
2
//
3
// SPDX-License-Identifier: BSD-3-Clause
4
5
#pragma once
6
7
#include <algorithm>
8
#include <execution>
9
#include <type_traits>
10
#include <utility>
11
12
#include <dr/concepts/concepts.hpp>
13
#include <dr/detail/logger.hpp>
14
#include <dr/detail/onedpl_direct_iterator.hpp>
15
#include <dr/detail/ranges_shim.hpp>
16
#include <dr/mp/global.hpp>
17
18
namespace
dr::mp {
19
21
auto
fill(
dr::distributed_contiguous_range
auto
&&dr,
auto
value) {
22
for_each(dr, [=](
auto
&v) { v = value; });
23
return
rng::end(dr);
24
}
25
27
template
<dr::distributed_iterator DI>
28
auto
fill(DI first, DI last,
auto
value) {
29
mp::fill(rng::subrange(first, last), value);
30
return
last;
31
}
32
33
}
// namespace dr::mp
dr::distributed_contiguous_range
Definition:
concepts.hpp:42
Generated by
1.9.6