22 #ifndef RAJA_resource_HPP
23 #define RAJA_resource_HPP
25 #include "camp/resource.hpp"
26 #if defined(RAJA_CUDA_ACTIVE)
29 #if defined(RAJA_HIP_ACTIVE)
32 #if defined(RAJA_SYCL_ACTIVE)
44 using namespace camp::resources;
49 using type = camp::resources::Host;
55 using type = camp::resources::Host;
58 template<
typename ExecPol>
62 template<
typename ExecPol>
68 #if defined(RAJA_CUDA_ACTIVE)
70 struct get_resource_from_platform<Platform::
cuda>
72 using type = camp::resources::Cuda;
75 template<
typename IterationMapping,
76 typename IterationGetter,
80 struct get_resource<::RAJA::policy::cuda::cuda_exec_explicit<IterationMapping,
86 using type = camp::resources::Cuda;
89 template<
bool Async,
int num_threads,
size_t BLOCKS_PER_SM>
90 struct get_resource<::RAJA::policy::cuda::cuda_launch_explicit_t<Async,
94 using type = camp::resources::Cuda;
97 template<
typename ISetIter,
98 typename IterationMapping,
99 typename IterationGetter,
100 typename Concretizer,
101 size_t BLOCKS_PER_SM,
105 ::RAJA::policy::cuda::cuda_exec_explicit<IterationMapping,
111 using type = camp::resources::Cuda;
115 #if defined(RAJA_HIP_ACTIVE)
117 struct get_resource_from_platform<Platform::
hip>
119 using type = camp::resources::Hip;
122 template<
typename IterationMapping,
123 typename IterationGetter,
124 typename Concretizer,
127 ::RAJA::policy::hip::
128 hip_exec<IterationMapping, IterationGetter, Concretizer, Async>>
130 using type = camp::resources::Hip;
133 template<
bool Async,
int num_threads>
134 struct get_resource<::RAJA::policy::hip::hip_launch_t<Async, num_threads>>
136 using type = camp::resources::Hip;
139 template<
typename ISetIter,
140 typename IterationMapping,
141 typename IterationGetter,
142 typename Concretizer,
144 struct get_resource<ExecPolicy<
146 ::RAJA::policy::hip::
147 hip_exec<IterationMapping, IterationGetter, Concretizer, Async>>>
149 using type = camp::resources::Hip;
153 #if defined(RAJA_SYCL_ACTIVE)
155 struct get_resource_from_platform<Platform::
sycl>
157 using type = camp::resources::Sycl;
160 template<
size_t BlockSize,
bool Async>
161 struct get_resource<::RAJA::policy::sycl::sycl_exec<BlockSize, Async>>
163 using type = camp::resources::Sycl;
166 template<
bool Async,
int num_threads>
167 struct get_resource<::RAJA::policy::sycl::sycl_launch_t<Async, num_threads>>
169 using type = camp::resources::Sycl;
172 template<
typename ISetIter,
size_t BlockSize,
bool Async>
174 ExecPolicy<ISetIter, ::RAJA::policy::sycl::sycl_exec<BlockSize, Async>>>
176 using type = camp::resources::Sycl;
180 #if defined(RAJA_ENABLE_TARGET_OPENMP)
182 struct get_resource_from_platform<Platform::omp_target>
184 using type = camp::resources::Omp;
190 using type = camp::resources::Omp;
193 template<
size_t ThreadsPerTeam>
197 using type = camp::resources::Omp;
200 template<
typename ISetIter>
204 using type = camp::resources::Omp;
207 template<
typename ISetIter,
size_t ThreadsPerTeam>
208 struct get_resource<ExecPolicy<
212 using type = camp::resources::Omp;
218 namespace type_traits
227 #if defined(RAJA_CUDA_ACTIVE)
229 struct is_resource<resources::Cuda> : std::true_type
232 #if defined(RAJA_HIP_ACTIVE)
234 struct is_resource<resources::Hip> : std::true_type
237 #if defined(RAJA_SYCL_ACTIVE)
239 struct is_resource<resources::Sycl> : std::true_type
242 #if defined(RAJA_ENABLE_TARGET_OPENMP)
244 struct is_resource<resources::Omp> : std::true_type
Header file containing RAJA CUDA policy definitions.
Header file containing RAJA HIP policy definitions.
constexpr resource_from_pol_t< ExecPol > get_default_resource()
Definition: resource.hpp:63
typename get_resource_from_platform< detail::get_platform< ExecPol >::value >::type resource_from_pol_t
Definition: resource.hpp:60
Definition: AlignedRangeIndexSetBuilders.cpp:35
Header file containing RAJA sequential policy definitions.
Definition: policy.hpp:57
Definition: policy.hpp:49
Definition: resource.hpp:48
camp::resources::Host type
Definition: resource.hpp:49
Definition: resource.hpp:222
Header file containing RAJA SYCL policy definitions.