18#ifndef DT_SYSTEM_OPENMP_H
19#define DT_SYSTEM_OPENMP_H
28#ifndef dt_omp_nontemporal
32#if (__clang__+0 >= 10 || __GNUC__ >= 9)
33# define dt_omp_nontemporal(...) nontemporal(__VA_ARGS__)
36# define dt_omp_nontemporal(var, ...)
41#define OMP_PRAGMA(x) _Pragma(#x)
64#define __OMP_PARALLEL__(...) OMP_PRAGMA(omp parallel default(firstprivate) __VA_ARGS__)
65#define __OMP_PARALLEL_FOR__(...) OMP_PRAGMA(omp parallel for default(firstprivate) schedule(static) __VA_ARGS__)
66#define __OMP_PARALLEL_FOR_SIMD__(...) OMP_PRAGMA(omp parallel for simd default(firstprivate) schedule(simd:static) __VA_ARGS__)
67#define __OMP_FOR_SIMD__(...) OMP_PRAGMA(omp for simd schedule(simd:static) __VA_ARGS__)
68#define __OMP_FOR__(...) OMP_PRAGMA(omp for schedule(static) __VA_ARGS__)
69#define __OMP_SIMD__(...) OMP_PRAGMA(omp simd __VA_ARGS__)
70#define __OMP_DECLARE_SIMD__(...) OMP_PRAGMA(omp declare simd __VA_ARGS__)
82#define __OMP_PARALLEL_FOR_CPP__(...) OMP_PRAGMA(omp parallel for default(none) schedule(static) __VA_ARGS__)
86#define dt_omp_in_parallel() (omp_in_parallel() != 0)
90# define omp_get_max_threads() 1
91# define omp_get_thread_num() 0
92# define dt_omp_in_parallel() 0
94#define __OMP_PARALLEL__(...)
95#define __OMP_PARALLEL_FOR__(...)
96#define __OMP_PARALLEL_FOR_SIMD__(...)
97#define __OMP_FOR_SIMD__(...)
98#define __OMP_FOR__(...)
99#define __OMP_SIMD__(...)
100#define __OMP_DECLARE_SIMD__(...)
102#define __OMP_PARALLEL_FOR_CPP__(...)
106#if defined(__x86_64__) || defined(__i386__)
107#include <immintrin.h>
144#if defined(__x86_64__) || defined(__i386__)
162#define dt_omploop_sfence()
164#define dt_omploop_sfence() dt_sfence()
int dt_get_num_openmp_threads(void)
Number of OpenMP threads the application decided to use.
static int dt_get_thread_num()
Index of the calling thread within its parallel region, 0 outside one.
#define omp_get_thread_num()