mxnet
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(__ANDROID__) && 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
27 extern "C" {
28 #endif
29 inline int omp_get_thread_num() __GOMP_NOTHROW { return 0; }
30 inline int omp_get_num_threads() __GOMP_NOTHROW { return 1; }
31 inline int omp_get_max_threads() __GOMP_NOTHROW { return 1; }
32 inline int omp_get_num_procs() __GOMP_NOTHROW { return 1; }
33 inline void omp_set_num_threads(int nthread) __GOMP_NOTHROW {}
34 #ifdef __cplusplus
35 }
36 #endif // __cplusplus
37 #endif // _OPENMP
38 
39 // loop variable used in openmp
40 namespace dmlc {
41 #ifdef _MSC_VER
42 typedef int omp_uint;
43 typedef long omp_ulong; // NOLINT(*)
44 #else
45 typedef unsigned omp_uint;
46 typedef unsigned long omp_ulong; // NOLINT(*)
47 #endif
48 } // namespace dmlc
50 #endif // DMLC_OMP_H_
namespace for dmlc
Definition: array_view.h:12
#define __GOMP_NOTHROW
Definition: omp.h:22
header to handle OpenMP compatibility issues