jaffarCommon
Loading...
Searching...
No Matches
Macros | Typedefs | Functions
parallel.hpp File Reference

Definitions and utilities for parallel execution. More...

#include <omp.h>
#include <stddef.h>
#include <stdint.h>
Include dependency graph for parallel.hpp:

Go to the source code of this file.

Macros

#define JAFFAR_PARALLEL   _Pragma("omp parallel")
 Macro to initiate a parallel basic block. Uses OpenMP for this.
 
#define JAFFAR_PARALLEL_FOR   _Pragma("omp parallel for")
 Macro to initiate a parallel for basic block. Uses OpenMP for this.
 
#define JAFFAR_MASTER   _Pragma("omp master")
 Macro to initiate a basic block where only the master thread runs.
 
#define JAFFAR_BARRIER   _Pragma("omp barrier")
 Macro to synchronize all workers.
 
#define JAFFAR_CRITICAL   _Pragma("omp critical")
 Macro to mark a critical section.
 

Typedefs

typedef uint32_t jaffarCommon::parallel::threadId_t
 Type definition for thread identifier.
 

Functions

__JAFFAR_COMMON__INLINE__ threadId_t jaffarCommon::parallel::getThreadId ()
 
__JAFFAR_COMMON__INLINE__ size_t jaffarCommon::parallel::getThreadCount ()
 
__JAFFAR_COMMON__INLINE__ void jaffarCommon::parallel::setThreadCount (const size_t threadCount)
 
__JAFFAR_COMMON__INLINE__ size_t jaffarCommon::parallel::getMaxThreadCount ()
 

Detailed Description

Definitions and utilities for parallel execution.

Function Documentation

◆ getMaxThreadCount()

__JAFFAR_COMMON__INLINE__ size_t jaffarCommon::parallel::getMaxThreadCount ( )

Gets the number of maximum possible threads

Returns
The number of maximum possible threads

◆ getThreadCount()

__JAFFAR_COMMON__INLINE__ size_t jaffarCommon::parallel::getThreadCount ( )

Gets the number of currently running threads

Returns
The number of currently running threads

◆ getThreadId()

__JAFFAR_COMMON__INLINE__ threadId_t jaffarCommon::parallel::getThreadId ( )

Gets the id of the currently running thread

Returns
The id of the currently running thread

◆ setThreadCount()

__JAFFAR_COMMON__INLINE__ void jaffarCommon::parallel::setThreadCount ( const size_t  threadCount)

Sets the number of parallel threads

Parameters
[in]threadCountThe number of currently running threads