RAJA
RAJA provides a collection of platform portability abstractions for C++ HPC applications.
policy.hpp
Go to the documentation of this file.
1 
11 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
12 // Copyright (c) Lawrence Livermore National Security, LLC and other
13 // RAJA Project Developers. See top-level LICENSE and COPYRIGHT
14 // files for dates and other details. No copyright assignment is required
15 // to contribute to RAJA.
16 //
17 // SPDX-License-Identifier: (BSD-3-Clause)
18 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
19 
20 #ifndef policy_sequential_HPP
21 #define policy_sequential_HPP
22 
24 
25 namespace RAJA
26 {
27 namespace sequential
28 {
29 
30 enum struct multi_reduce_algorithm : int
31 {
32  left_fold
33 };
34 
35 template<multi_reduce_algorithm t_multi_algorithm>
37 {
38  static constexpr multi_reduce_algorithm algorithm = t_multi_algorithm;
39  static constexpr bool consistent =
41 };
42 
43 } // namespace sequential
44 
45 namespace policy
46 {
47 namespace sequential
48 {
49 
50 //
52 //
53 // Execution policies
54 //
56 //
57 
61 
63  Pattern::region,
64  Launch::sync,
65  Platform::host>
66 {};
67 
69  Pattern::region,
70  Launch::sync,
71  Platform::host>
72 {};
73 
74 struct seq_exec : make_policy_pattern_launch_platform_t<Policy::sequential,
75  Pattern::forall,
76  Launch::undefined,
77  Platform::host>
78 {};
79 
84 
88 struct seq_work : make_policy_pattern_launch_platform_t<Policy::sequential,
89  Pattern::workgroup_exec,
90  Launch::sync,
91  Platform::host>
92 {};
93 
102  Pattern::reduce,
103  Launch::undefined,
104  Platform::host>
105 {};
106 
108 template<typename tuning>
110  Policy::sequential,
111  Pattern::multi_reduce,
112  Launch::undefined,
113  Platform::host,
114  std::conditional_t<tuning::consistent,
115  reduce::ordered,
116  reduce::unordered>>
117 {};
118 
127 {};
128 
130 {};
131 
132 template<RAJA::sequential::multi_reduce_algorithm algorithm>
135 
136 // Policies for RAJA::MultiReduce* objects with specific behaviors.
137 // - left_fold policies combine new values into a single value.
140 
141 // Policy for RAJA::MultiReduce* objects that gives the
142 // same answer every time when used in the same way
144 
145 } // namespace sequential
146 } // namespace policy
147 
157 
158 
159 } // namespace RAJA
160 
161 #endif
Header file for basic RAJA policy mechanics.
seq_multi_reduce_tuning< RAJA::sequential::multi_reduce_algorithm::left_fold > seq_multi_reduce_left_fold
Definition: policy.hpp:139
seq_exec seq_segit
Definition: policy.hpp:83
seq_multi_reduce_left_fold seq_multi_reduce
Definition: policy.hpp:143
multi_reduce_algorithm
Definition: policy.hpp:31
Definition: AlignedRangeIndexSetBuilders.cpp:35
Definition: PolicyBase.hpp:75
Definition: policy.hpp:127
Definition: policy.hpp:78
Definition: policy.hpp:105
Definition: policy.hpp:66
Definition: policy.hpp:130
Definition: policy.hpp:92
Definition: policy.hpp:37
static constexpr multi_reduce_algorithm algorithm
Definition: policy.hpp:38
static constexpr bool consistent
Definition: policy.hpp:39