RAJA
RAJA provides a collection of platform portability abstractions for C++ HPC applications.
Sync.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 
22 #ifndef RAJA_policy_hip_kernel_Sync_HPP
23 #define RAJA_policy_hip_kernel_Sync_HPP
24 
25 #include "RAJA/config.hpp"
26 
27 #if defined(RAJA_ENABLE_HIP)
28 
29 #include <cassert>
30 #include <climits>
31 
32 #include "camp/camp.hpp"
33 
34 #include "RAJA/pattern/kernel.hpp"
35 
36 #include "RAJA/util/macros.hpp"
37 #include "RAJA/util/types.hpp"
38 
39 namespace RAJA
40 {
41 namespace statement
42 {
43 
47 struct HipSyncThreads : public internal::Statement<camp::nil>
48 {};
49 
53 struct HipSyncWarp : public internal::Statement<camp::nil>
54 {};
55 
56 } // namespace statement
57 
58 namespace internal
59 {
60 
61 template<typename Data, typename Types>
62 struct HipStatementExecutor<Data, statement::HipSyncThreads, Types>
63 {
64 
65  static inline RAJA_DEVICE void exec(Data&, bool) { __syncthreads(); }
66 
67  static inline LaunchDims calculateDimensions(
68  Data const& RAJA_UNUSED_ARG(data))
69  {
70  return LaunchDims();
71  }
72 };
73 
74 template<typename Data, typename Types>
75 struct HipStatementExecutor<Data, statement::HipSyncWarp, Types>
76 {
77 
78  static inline RAJA_DEVICE
79  // not currently supported
80  void
81  exec(Data&, bool)
82  {}
83 
84  static inline LaunchDims calculateDimensions(
85  Data const& RAJA_UNUSED_ARG(data))
86  {
87  return LaunchDims();
88  }
89 };
90 
91 
92 } // namespace internal
93 } // namespace RAJA
94 
95 #endif // closing endif for RAJA_ENABLE_HIP guard
96 
97 #endif // closing endif for header file include guard
Header file for common RAJA internal macro definitions.
#define RAJA_UNUSED_ARG(x)
Definition: macros.hpp:97
#define RAJA_DEVICE
Definition: macros.hpp:66
Definition: AlignedRangeIndexSetBuilders.cpp:35
RAJA header file containing user interface for RAJA::kernel.
Header file for RAJA type definitions.