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_policy_openmp_thread_HPP
21 #define RAJA_policy_openmp_thread_HPP
22 
23 #include "RAJA/config.hpp"
24 
25 #if defined(RAJA_OPENMP_ACTIVE)
26 
27 #include "RAJA/util/macros.hpp"
28 
30 
31 namespace RAJA
32 {
33 
34 template<>
35 RAJA_HOST_DEVICE RAJA_INLINE int get_max_threads(omp_thread)
36 {
37  return omp_get_max_threads();
38 }
39 
40 template<>
41 RAJA_HOST_DEVICE RAJA_INLINE int get_thread_num(omp_thread)
42 {
43  return omp_get_thread_num();
44 }
45 
46 } // namespace RAJA
47 
48 #endif // RAJA_ENABLE_OPENMP
49 #endif // guard
Header file for common RAJA internal macro definitions.
#define RAJA_HOST_DEVICE
Definition: macros.hpp:65
Definition: AlignedRangeIndexSetBuilders.cpp:35
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.