RAJA
RAJA provides a collection of platform portability abstractions for C++ HPC applications.
launch_context_policy.hpp
Go to the documentation of this file.
1 
12 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
13 // Copyright (c) Lawrence Livermore National Security, LLC and other
14 // RAJA Project Developers. See top-level LICENSE and COPYRIGHT
15 // files for dates and other details. No copyright assignment is required
16 // to contribute to RAJA.
17 //
18 // SPDX-License-Identifier: (BSD-3-Clause)
19 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
20 
21 #ifndef RAJA_pattern_context_policy_HPP
22 #define RAJA_pattern_context_policy_HPP
23 
24 #include <type_traits>
25 
26 namespace RAJA
27 {
28 
29 template<typename LaunchContextPolicy>
31 
32 class LaunchContextHostPolicy;
33 
34 namespace detail
35 {
36 
37 template<typename T>
39 
40 template<typename R, typename Arg0, typename... Args>
41 struct first_argument<R(Arg0, Args...)>
42 {
43  using type = Arg0;
44 };
45 
46 template<typename C, typename R, typename Arg0, typename... Args>
47 struct first_argument<R (C::*)(Arg0, Args...)>
48  : first_argument<R(Arg0, Args...)>
49 {};
50 
51 template<typename C, typename R, typename Arg0, typename... Args>
52 struct first_argument<R (C::*)(Arg0, Args...) const>
53  : first_argument<R(Arg0, Args...)>
54 {};
55 
56 template<typename C, typename R, typename Arg0, typename... Args>
57 struct first_argument<R (C::*)(Arg0, Args...) noexcept>
58  : first_argument<R(Arg0, Args...)>
59 {};
60 
61 template<typename C, typename R, typename Arg0, typename... Args>
62 struct first_argument<R (C::*)(Arg0, Args...) const noexcept>
63  : first_argument<R(Arg0, Args...)>
64 {};
65 
66 template<typename T, typename = void>
68 {
69  using type = camp::decay<T>;
70 };
71 
72 template<typename T>
73 struct callable_signature<T, std::void_t<decltype(&camp::decay<T>::operator())>>
74 {
75  using type = decltype(&camp::decay<T>::operator());
76 };
77 
78 template<typename T, typename = void>
80 {
82 };
83 
84 template<typename T>
86  std::void_t<typename first_argument<camp::decay<
87  typename callable_signature<T>::type>>::type>>
88 {
89  using type = camp::decay<
91 };
92 
93 
94 } // namespace detail
95 
96 } // namespace RAJA
97 #endif
Definition: launch_context_policy.hpp:30
void void_t
Definition: forall.hpp:515
Definition: AlignedRangeIndexSetBuilders.cpp:35
Definition: ListSegment.hpp:416
decltype(&camp::decay< T >::operator()) type
Definition: launch_context_policy.hpp:75
Definition: launch_context_policy.hpp:68
camp::decay< T > type
Definition: launch_context_policy.hpp:69
Arg0 type
Definition: launch_context_policy.hpp:43
Definition: launch_context_policy.hpp:38
camp::decay< typename first_argument< typename callable_signature< T >::type >::type > type
Definition: launch_context_policy.hpp:90
Definition: launch_context_policy.hpp:80