RAJA
RAJA provides a collection of platform portability abstractions for C++ HPC applications.
thread.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_pattern_thread_HPP
21 #define RAJA_pattern_thread_HPP
22 
23 #include "RAJA/config.hpp"
24 
25 #include "RAJA/util/macros.hpp"
26 
28 
29 namespace RAJA
30 {
76 template<typename Policy>
78 {
79  return RAJA::get_max_threads(Policy {});
80 }
81 
89 template<typename Policy>
91 {
92  return RAJA::get_thread_num(Policy {});
93 }
94 
95 } // namespace RAJA
96 
97 #endif
Header file for common RAJA internal macro definitions.
#define RAJA_HOST_DEVICE
Definition: macros.hpp:65
Definition: AlignedRangeIndexSetBuilders.cpp:35
Policy
Definition: PolicyBase.hpp:32
RAJA_INLINE RAJA_HOST_DEVICE int get_max_threads()
Get maximum number of threads.
Definition: thread.hpp:77
RAJA_INLINE RAJA_HOST_DEVICE int get_thread_num()
Get current thread number This is based on the OpenMP threading model. Within a parallel team executi...
Definition: thread.hpp:90
RAJA header file defining automatic thread operations.