nndeploy C++ API
0.2.0
nndeploy C++ API
framework
include
nndeploy
thread_pool
openmp.h
Go to the documentation of this file.
1
2
#ifndef _NNDEPLOY_THREAD_POOL_OPENMP_H_
3
#define _NNDEPLOY_THREAD_POOL_OPENMP_H_
4
5
#include "
nndeploy/base/macro.h
"
6
7
#ifdef ENABLE_NNDEPLOY_OPENMP
8
9
#include <
openmp.h
>
10
11
#if OpenMP_CXX_VERSION_MAJOR >= 3
12
#define NNDEPLOY_OPENMP_PARALLEL_FOR_COLLAPSE_(t) NNDEPLOY_PRAGMA(NNDEPLOY_OPENMP parallel for collapse(t))
13
#else
14
#define NNDEPLOY_OPENMP_PARALLEL_FOR_COLLAPSE_(t) NNDEPLOY_PRAGMA(NNDEPLOY_OPENMP parallel for)
15
#endif
16
#define NNDEPLOY_OPENMP_PARALLEL_FOR_ NNDEPLOY_PRAGMA(NNDEPLOY_OPENMP parallel for)
17
#define NNDEPLOY_OPENMP_PARALLEL_FOR_GUIDED_ NNDEPLOY_PRAGMA(NNDEPLOY_OPENMP parallel for)
18
#define NNDEPLOY_OPENMP_PARALLEL_FOR_DYNAMIC_ NNDEPLOY_PRAGMA(NNDEPLOY_OPENMP parallel for schedule(dynamic))
19
#define NNDEPLOY_OPENMP_SECTION_ NNDEPLOY_PRAGMA(NNDEPLOY_OPENMP section)
20
#define NNDEPLOY_OPENMP_PARALLEL_SECTIONS_ \
21
NNDEPLOY_PRAGMA(NNDEPLOY_OPENMP parallel sections)
22
#define NNDEPLOY_OPENMP_CORES_ (NNDEPLOY_OPENMP_get_num_procs())
23
#define NNDEPLOY_OPENMP_MAX_THREADS_NUM_ (NNDEPLOY_OPENMP_get_max_threads())
24
#define NNDEPLOY_OPENMP_TID_ (NNDEPLOY_OPENMP_get_thread_num())
25
#define NNDEPLOY_OPENMP_SET_THREADS_(t) (NNDEPLOY_OPENMP_set_num_threads(t))
26
27
#else
28
29
#define NNDEPLOY_OPENMP_PARALLEL_FOR_
30
#define NNDEPLOY_OPENMP_PARALLEL_FOR_GUIDED_
31
#define NNDEPLOY_OPENMP_PARALLEL_FOR_DYNAMIC_
32
#define NNDEPLOY_OPENMP_PARALLEL_FOR_COLLAPSE_(t)
33
#define NNDEPLOY_OPENMP_SECTION_
34
#define NNDEPLOY_OPENMP_PARALLEL_SECTIONS_
35
#define NNDEPLOY_OPENMP_CORES_ (1)
36
#define NNDEPLOY_OPENMP_MAX_THREADS_NUM_ (1)
37
#define NNDEPLOY_OPENMP_TID_ (0)
38
#define NNDEPLOY_OPENMP_SET_THREADS_(t)
39
40
#endif
// _OPENMP
41
42
#endif
// _NNDEPLOY_THREAD_POOL_OPENMP_H_
macro.h
openmp.h
Generated by
1.9.1