Medial Code Documentation
Loading...
Searching...
No Matches
omp.h
Go to the documentation of this file.
1
6#ifndef DMLC_OMP_H_
7#define DMLC_OMP_H_
8
9
10#if defined(_OPENMP)
11#include <omp.h>
12#else
13
14#if defined(__clang__)
15#undef __GOMP_NOTHROW
16#define __GOMP_NOTHROW
17#elif defined(__cplusplus)
18#undef __GOMP_NOTHROW
19#define __GOMP_NOTHROW throw()
20#else
21#undef __GOMP_NOTHROW
22#define __GOMP_NOTHROW __attribute__((__nothrow__))
23#endif
24
26#ifdef __cplusplus
27extern "C" {
28#endif
29inline int omp_get_thread_num() __GOMP_NOTHROW { return 0; }
30inline int omp_get_num_threads() __GOMP_NOTHROW { return 1; }
31inline int omp_get_max_threads() __GOMP_NOTHROW { return 1; }
32inline int omp_get_num_procs() __GOMP_NOTHROW { return 1; }
33inline void omp_set_num_threads(int nthread) __GOMP_NOTHROW {}
34inline int omp_in_parallel() __GOMP_NOTHROW { return 0; }
35#ifdef __cplusplus
36}
37#endif // __cplusplus
38#endif // _OPENMP
39
40// loop variable used in openmp
41namespace dmlc {
42#ifdef _MSC_VER
43typedef int omp_uint;
44typedef long omp_ulong; // NOLINT(*)
45#else
46typedef unsigned omp_uint;
47typedef unsigned long omp_ulong; // NOLINT(*)
48#endif
50} // namespace dmlc
51#endif // DMLC_OMP_H_
namespace for dmlc
Definition array_view.h:12
dmlc::omp_ulong omp_ulong
define unsigned long for openmp loop
Definition base.h:322
header to handle OpenMP compatibility issues