RAJA
RAJA provides a collection of platform portability abstractions for C++ HPC applications.
Namespaces | Functions
thread.hpp File Reference

RAJA header file defining thread operations. More...

#include "RAJA/config.hpp"
#include "RAJA/util/macros.hpp"
#include "RAJA/policy/thread_auto.hpp"

Go to the source code of this file.

Namespaces

 RAJA
 

Functions

template<typename Policy >
RAJA_INLINE RAJA_HOST_DEVICE int RAJA::get_max_threads ()
 Get maximum number of threads. More...
 
template<typename Policy >
RAJA_INLINE RAJA_HOST_DEVICE int RAJA::get_thread_num ()
 Get current thread number This is based on the OpenMP threading model. Within a parallel team executing a parallel region the threads are numbered 0-N. Returns 0 if called in sequential part of a program or OMP is not active. More...
 

Detailed Description

RAJA header file defining thread operations.

Thread operation functions in the namespace RAJA::thread

The dispatch of all of these is:

int get_thread_num<Policy>() – User facing API

calls

int get_thread_num(Policy{}) – Policy specific implementation

With the exception of the auto_thread policy which then calls the "appropriate" policy implementation.

Current supported policies include:

auto_thread – Attempts to do "the right thing"

omp_thread – Available (and default) when OpenMP is active these are safe inside and outside of OMP parallel regions

seq_thread – Non-thread

The implementation code lives in: RAJA/policy/thread_auto.hpp – for auto_thread RAJA/policy/XXX/thread.hpp – for omp_thread