mxnet
3rdparty
dmlc-core
include
dmlc
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
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_
dmlc
namespace for dmlc
Definition:
array_view.h:12
omp.h
header to handle OpenMP compatibility issues
__GOMP_NOTHROW
#define __GOMP_NOTHROW
Definition:
omp.h:22
Generated on Thu Jan 5 2023 03:47:39 for mxnet by
1.8.17