28#define omp_sched_monotonic ((omp_sched_t)0x80000000u)
41#define omp_lock_hint_none omp_sync_hint_none
42#define omp_lock_hint_uncontended omp_sync_hint_uncontended
43#define omp_lock_hint_contended omp_sync_hint_contended
44#define omp_lock_hint_nonspeculative omp_sync_hint_nonspeculative
45#define omp_lock_hint_speculative omp_sync_hint_speculative
47#ifdef __CCCC_OMP_THREADED__
61int omp_get_num_threads(
void);
62int omp_get_max_threads(
void);
63int omp_get_thread_num(
void);
64int omp_get_thread_limit(
void);
65int omp_in_parallel(
void);
66int omp_in_final(
void);
67int omp_get_num_procs(
void);
68void omp_set_num_threads(
int n);
69void omp_set_dynamic(
int on);
70int omp_get_dynamic(
void);
71double omp_get_wtime(
void);
72double omp_get_wtick(
void);
74void omp_get_schedule(
omp_sched_t *kind,
int *chunk);
101static inline int omp_get_num_threads(
void) {
return 1; }
103static inline int omp_get_max_threads(
void) {
return 1; }
105static inline int omp_get_thread_num(
void) {
return 0; }
107static inline int omp_get_thread_limit(
void) {
return 1; }
109static inline int omp_in_parallel(
void) {
return 0; }
111static inline int omp_in_final(
void) {
115static inline int omp_get_num_procs(
void) {
116 long n = sysconf(_SC_NPROCESSORS_ONLN);
117 return n > 0 ? (int)n : 1;
120static inline void omp_set_num_threads(
int n) { (void)n; }
122static inline void omp_set_dynamic(
int on) { (void)on; }
124static inline int omp_get_dynamic(
void) {
return 0; }
126static inline int *__omp_schedule_icv(
void) {
132static inline void omp_set_schedule(
omp_sched_t kind,
int chunk) {
133 int k = (int)kind & 0x7fffffff;
135 __omp_schedule_icv()[0] = k;
136 __omp_schedule_icv()[1] = chunk;
140static inline void omp_get_schedule(
omp_sched_t *kind,
int *chunk) {
142 *chunk = __omp_schedule_icv()[1];
146static inline double omp_get_wtime(
void) {
148 clock_gettime(CLOCK_MONOTONIC, &ts);
149 return (
double)ts.tv_sec + (double)ts.tv_nsec * 1e-9;
152static inline double omp_get_wtick(
void) {
return 1e-9; }
155static inline void omp_init_lock(
omp_lock_t *lock) { lock->
held = 0; }
157static inline void omp_destroy_lock(
omp_lock_t *lock) { lock->
held = 0; }
159static inline void omp_set_lock(
omp_lock_t *lock) {
161 fputs(
"omp_set_lock: lock is already held (deadlock)\n", stderr);
167static inline void omp_unset_lock(
omp_lock_t *lock) { lock->
held = 0; }
169static inline int omp_test_lock(
omp_lock_t *lock) {
193 return ++lock->
depth;
omp_sync_hint_t omp_lock_hint_t
Definition omp.h:40
omp_sync_hint_t
Hints for #pragma omp atomic hint(...); or them together, but not contended with uncontended or specu...
Definition omp.h:32
@ omp_sync_hint_uncontended
Definition omp.h:34
@ omp_sync_hint_contended
Definition omp.h:35
@ omp_sync_hint_none
Definition omp.h:33
@ omp_sync_hint_nonspeculative
Definition omp.h:36
@ omp_sync_hint_speculative
Definition omp.h:37
omp_sched_t
Loop schedule kinds for omp_set_schedule() and omp_get_schedule().
Definition omp.h:19
@ omp_sched_dynamic
Definition omp.h:21
@ omp_sched_auto
Definition omp.h:23
@ omp_sched_guided
Definition omp.h:22
@ omp_sched_static
Definition omp.h:20
Simple lock.
Definition omp.h:91
int held
Definition omp.h:92
Nestable lock.
Definition omp.h:96
int depth
Definition omp.h:97