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 HIP_KERNELNAME_HPP
11 #define HIP_KERNELNAME_HPP
12 
13 #if defined(RAJA_HIP_ACTIVE)
14 
17 
18 #if defined(RAJA_ENABLE_ROCTX)
19 #include "hip/hip_runtime_api.h"
20 #include "roctx.h"
21 #endif
22 
23 #if defined(RAJA_ENABLE_CALIPER)
25 #endif
26 
27 namespace RAJA
28 {
29 namespace expt
30 {
31 namespace detail
32 {
33 
34 // Init
35 template<typename EXEC_POL>
36 camp::concepts::enable_if<RAJA::type_traits::is_hip_policy<EXEC_POL>>
37 param_init(EXEC_POL const&,
39  const RAJA::hip::detail::hipInfo&)
40 {
41 #if defined(RAJA_ENABLE_ROCTX)
42  if (kn.name != nullptr
43 #if defined(RAJA_ENABLE_CALIPER)
44  && RAJA::util::RAJA_caliper_profile == false
45 #endif
46  )
47  {
48  roctxRangePush(kn.name);
49  }
50 #else
51  RAJA_UNUSED_VAR(kn);
52 #endif
53 }
54 
55 // Combine
56 template<typename EXEC_POL>
57 RAJA_HOST_DEVICE camp::concepts::enable_if<
59 param_combine(EXEC_POL const&, RAJA::detail::Name&)
60 {}
61 
62 // Resolve
63 template<typename EXEC_POL>
64 camp::concepts::enable_if<RAJA::type_traits::is_hip_policy<EXEC_POL>>
65 param_resolve(EXEC_POL const&,
67  const RAJA::hip::detail::hipInfo&)
68 {
69 #if defined(RAJA_ENABLE_ROCTX)
70  if (kn.name != nullptr
71 #if defined(RAJA_ENABLE_CALIPER)
72  && RAJA::util::RAJA_caliper_profile == false
73 #endif
74  )
75  {
76  roctxRangePop();
77  }
78 #else
79  RAJA_UNUSED_VAR(kn);
80 #endif
81 }
82 
83 } // namespace detail
84 } // namespace expt
85 } // namespace RAJA
86 
87 #endif
88 
89 #endif // NEW_REDUCE_HIP_REDUCE_HPP
Header file defining prototypes for routines used to manage memory for HIP reductions and other opera...
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:228