GrPPI  1.0
Generic and Reusable Parallel Pattern Interface
execution_traits.h
Go to the documentation of this file.
1 /*
2  * Copyright 2018 Universidad Carlos III de Madrid
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #ifndef GRPPI_COMMON_EXECUTION_TRAITS_H
17 #define GRPPI_COMMON_EXECUTION_TRAITS_H
18 
19 #include <type_traits>
20 
21 namespace grppi {
22 
27 template <typename E>
28 constexpr bool is_supported() { return false; }
29 
30 template <typename E>
32  std::enable_if_t<is_supported<E>(), int>;
33 
34 template <typename E>
36  std::enable_if_t<!is_supported<E>(), int>;
37 
42 template <typename E>
43 constexpr bool supports_map() { return false; }
44 
49 template <typename E>
50 constexpr bool supports_reduce() { return false; }
51 
56 template <typename E>
57 constexpr bool supports_map_reduce() { return false; }
58 
63 template <typename E>
64 constexpr bool supports_stencil() { return false; }
65 
70 template <typename E>
71 constexpr bool supports_divide_conquer() { return false; }
72 
77 template <typename E>
78 constexpr bool supports_pipeline() { return false; }
79 
80 } // end namespace grppi
81 
82 #endif
Definition: callable_traits.h:21
constexpr bool is_supported()
Determines if an execution policy is supported in the current compilation.
Definition: execution_traits.h:28
constexpr bool supports_reduce()
Determines if an execution policy supports the reduce pattern.
Definition: execution_traits.h:50
std::enable_if_t<!is_supported< E >(), int > requires_execution_not_supported
Definition: execution_traits.h:36
constexpr bool supports_map_reduce()
Determines if an execution policy supports the map-reduce pattern.
Definition: execution_traits.h:57
std::enable_if_t< is_supported< E >(), int > requires_execution_supported
Definition: execution_traits.h:32
constexpr bool supports_stencil()
Determines if an execution policy supports the stencil pattern.
Definition: execution_traits.h:64
constexpr bool supports_pipeline()
Determines if an execution policy supports the pipeline pattern.
Definition: execution_traits.h:78
constexpr bool supports_map()
Determines if an execution policy supports the map pattern.
Definition: execution_traits.h:43
constexpr bool supports_divide_conquer()
Determines if an execution policy supports the divide-conquer pattern.
Definition: execution_traits.h:71