Distributed Ranges
Loading...
Searching...
No Matches
distribution.hpp
1// SPDX-FileCopyrightText: Intel Corporation
2//
3// SPDX-License-Identifier: BSD-3-Clause
4
5#pragma once
6
7#include <dr/mp/halo.hpp>
8
9namespace dr::mp {
10
12public:
13 distribution &halo(std::size_t radius) {
14 halo_bounds_.prev = radius;
15 halo_bounds_.next = radius;
16 return *this;
17 }
18
19 distribution &halo(std::size_t prev, std::size_t next) {
20 halo_bounds_.prev = prev;
21 halo_bounds_.next = next;
22 return *this;
23 }
24
25 auto halo() const { return halo_bounds_; }
26
27 distribution &periodic(bool periodic) {
28 halo_bounds_.periodic = periodic;
29 return *this;
30 }
31
32 auto periodic() const { return halo_bounds_.periodic; }
33
34 distribution &granularity(std::size_t size) {
35 granularity_ = size;
36 return *this;
37 }
38
39 auto granularity() const { return granularity_; }
40
41private:
42 halo_bounds halo_bounds_;
43 std::size_t granularity_ = 1;
44};
45
46} // namespace dr::mp
Definition: distribution.hpp:11
Definition: halo.hpp:362