RAJA
RAJA provides a collection of platform portability abstractions for C++ HPC applications.
kernel_name.hpp
Go to the documentation of this file.
1 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
2 // Copyright (c) Lawrence Livermore National Security, LLC and other
3 // RAJA Project Developers. See top-level LICENSE and COPYRIGHT
4 // files for dates and other details. No copyright assignment is required
5 // to contribute to RAJA.
6 //
7 // SPDX-License-Identifier: (BSD-3-Clause)
8 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
9 
10 #ifndef CUDA_KERNELNAME_HPP
11 #define CUDA_KERNELNAME_HPP
12 
13 #if defined(RAJA_CUDA_ACTIVE)
14 
15 #include <cuda.h>
16 
17 #if defined(RAJA_ENABLE_NVTX)
18 #include <nvtx3/nvToolsExt.h>
19 #endif
20 
23 
24 #if defined(RAJA_ENABLE_CALIPER)
26 #endif
27 
28 namespace RAJA
29 {
30 namespace expt
31 {
32 namespace detail
33 {
34 
35 // Init
36 template<typename EXEC_POL>
37 camp::concepts::enable_if<RAJA::type_traits::is_cuda_policy<EXEC_POL>>
38 param_init(EXEC_POL const&,
40  const RAJA::cuda::detail::cudaInfo&)
41 {
42 #if defined(RAJA_ENABLE_NVTX)
43  if (kn.name != nullptr
44 #if defined(RAJA_ENABLE_CALIPER)
45  && RAJA::util::RAJA_caliper_profile == false
46 #endif
47  )
48  {
49  nvtxRangePush(kn.name);
50  }
51 #else
52  RAJA_UNUSED_VAR(kn);
53 #endif
54 }
55 
56 // Combine
57 template<typename EXEC_POL>
58 RAJA_HOST_DEVICE camp::concepts::enable_if<
60 param_combine(EXEC_POL const&, RAJA::detail::Name&)
61 {}
62 
63 // Resolve
64 template<typename EXEC_POL>
65 camp::concepts::enable_if<RAJA::type_traits::is_cuda_policy<EXEC_POL>>
66 param_resolve(EXEC_POL const&,
68  const RAJA::cuda::detail::cudaInfo&)
69 {
70 #if defined(RAJA_ENABLE_NVTX)
71  if (kn.name != nullptr
72 #if defined(RAJA_ENABLE_CALIPER)
73  && RAJA::util::RAJA_caliper_profile == false
74 #endif
75  )
76  {
77  nvtxRangePop();
78  }
79 #else
80  RAJA_UNUSED_VAR(kn);
81 #endif
82 }
83 
84 } // namespace detail
85 } // namespace expt
86 } // namespace RAJA
87 
88 #endif
89 
90 #endif // NEW_REDUCE_CUDA_REDUCE_HPP
Header file defining prototypes for routines used to manage memory for CUDA reductions and other oper...
RAJA_HOST_DEVICE RAJA_INLINE void RAJA_UNUSED_VAR(T &&...) noexcept
Definition: macros.hpp:120
#define RAJA_HOST_DEVICE
Definition: macros.hpp:65
camp::concepts::enable_if< std::is_same< EXEC_POL, RAJA::seq_exec > > param_init(EXEC_POL const &, RAJA::detail::Name &)
Definition: kernel_name.hpp:24
camp::concepts::enable_if< concepts::negate< is_instance_of_Reducer< camp::decay< T > > >, concepts::negate< std::is_same< T, RAJA::detail::Name > > > param_combine(EXEC_POL const &, T &, const T &)
Definition: forall.hpp:97
camp::concepts::enable_if< std::is_same< EXEC_POL, RAJA::seq_exec > > param_resolve(EXEC_POL const &, RAJA::detail::Name &)
Definition: kernel_name.hpp:40
Definition: AlignedRangeIndexSetBuilders.cpp:35
Definition: kernel_name.hpp:21
const char * name
Definition: kernel_name.hpp:26
Definition: PolicyBase.hpp:224