RAJA
RAJA provides a collection of platform portability abstractions for C++ HPC applications.
OmpSyncThreads.hpp
Go to the documentation of this file.
1 
11 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
12 // Copyright (c) Lawrence Livermore National Security, LLC and other
13 // RAJA Project Developers. See top-level LICENSE and COPYRIGHT
14 // files for dates and other details. No copyright assignment is required
15 // to contribute to RAJA.
16 //
17 // SPDX-License-Identifier: (BSD-3-Clause)
18 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
19 
20 #ifndef RAJA_policy_openmp_kernel_ompsyncthreads_HPP
21 #define RAJA_policy_openmp_kernel_ompsyncthreads_HPP
22 
23 #include "RAJA/config.hpp"
24 
25 #if defined(RAJA_ENABLE_OPENMP)
26 
28 
29 #include "RAJA/util/macros.hpp"
30 #include "RAJA/util/types.hpp"
31 
33 
34 namespace RAJA
35 {
36 
37 namespace statement
38 {
39 struct OmpSyncThreads : public internal::Statement<camp::nil>
40 {};
41 
42 } // namespace statement
43 
44 namespace internal
45 {
46 
47 
48 // Statement executor to synchronize omp threads inside a kernel region
49 template<typename Types>
50 struct StatementExecutor<statement::OmpSyncThreads, Types>
51 {
52 
53  template<typename Data>
54  static RAJA_INLINE void exec(Data&&)
55  {
56 #pragma omp barrier
57  }
58 };
59 
60 
61 } // namespace internal
62 } // namespace RAJA
63 
64 
65 #endif // closing endif for RAJA_ENABLE_OPENMP guard
66 
67 #endif // closing endif for header file include guard
Header file for common RAJA internal macro definitions.
Definition: AlignedRangeIndexSetBuilders.cpp:35
Header file containing RAJA OpenMP policy definitions.
Header file for loop kernel internals.
Header file for RAJA type definitions.