GrPPI  0.2
Generic and Reusable Parallel Pattern Interface
sequential_execution.h
Go to the documentation of this file.
1 
21 #ifndef GRPPI_SEQ_SEQUENTIAL_EXECUTION_H
22 #define GRPPI_SEQ_SEQUENTIAL_EXECUTION_H
23 
24 #include <type_traits>
25 
26 namespace grppi {
27 
32 
33 public:
34 
37 
42  void set_concurrency_degree(int n) const noexcept {}
43 
48  int concurrency_degree() const noexcept { return 1; }
49 
54  void enable_ordering() const noexcept {}
55 
60  void disable_ordering() const noexcept {}
61 
66  bool is_ordered() const noexcept { return true; }
67 };
68 
70 template <typename E>
71 constexpr bool is_sequential_execution() {
72  return std::is_same<E, sequential_execution>::value;
73 }
74 
75 template <typename E>
76 constexpr bool is_supported();
77 
78 template <>
80  return true;
81 }
82 
83 } // end namespace grppi
84 
85 #endif
Definition: callable_traits.h:24
sequential_execution()
Default constructor.
Definition: sequential_execution.h:36
constexpr bool is_supported()
Metafunction that determines if type E is supported in the current build.
constexpr bool is_sequential_execution()
Determine if a type is a sequential execution policy.
Definition: sequential_execution.h:71
constexpr bool is_supported< sequential_execution >()
Definition: sequential_execution.h:79
void set_concurrency_degree(int n) const noexcept
Set number of grppi threads.
Definition: sequential_execution.h:42
void disable_ordering() const noexcept
Disable ordering.
Definition: sequential_execution.h:60
Sequential execution policy.
Definition: sequential_execution.h:31
int concurrency_degree() const noexcept
Get number of grppi trheads.
Definition: sequential_execution.h:48
bool is_ordered() const noexcept
Is execution ordered.
Definition: sequential_execution.h:66
void enable_ordering() const noexcept
Enable ordering.
Definition: sequential_execution.h:54