nndeploy C++ API
0.2.0
nndeploy C++ API
framework
include
nndeploy
thread_pool
parallel.h
Go to the documentation of this file.
1
#ifndef _NNDEPLOY_THREAD_POOL_PARALLEL_H_
2
#define _NNDEPLOY_THREAD_POOL_PARALLEL_H_
3
4
#include "
nndeploy/base/common.h
"
5
#include "
nndeploy/base/glic_stl_include.h
"
6
#include "
nndeploy/base/log.h
"
7
#include "
nndeploy/base/macro.h
"
8
#include "
nndeploy/base/object.h
"
9
#include "
nndeploy/base/status.h
"
10
#include "
nndeploy/base/type.h
"
11
12
namespace
nndeploy
{
13
namespace
thread_pool {
14
15
enum
ParallelForApiType
:
int
{
16
kParallelForApiTypeDefault
= 0x0000,
17
};
18
19
extern
NNDEPLOY_CC_API
std::string
parallelForApiTypeToString
(
ParallelForApiType
type);
20
extern
NNDEPLOY_CC_API
ParallelForApiType
stringToParallelForApiType
(
const
std::string &src);
21
25
class
NNDEPLOY_CC_API
ParallelLoopBody
{
26
public
:
27
virtual
~ParallelLoopBody
() {}
28
virtual
void
operator()
(
const
base::Range
&range)
const
= 0;
29
};
30
31
extern
NNDEPLOY_CC_API
int
defaultNumberOfThreads
();
32
33
extern
NNDEPLOY_CC_API
void
setThreadNum
(
int
num);
34
35
extern
NNDEPLOY_CC_API
int
getThreadNum
();
36
40
extern
NNDEPLOY_CC_API
void
parallelFor
(
const
base::Range
&range,
41
const
ParallelLoopBody
&body,
42
double
nstripes = -1.0);
43
44
}
// namespace thread_pool
45
}
// namespace nndeploy
46
47
#endif
/* _NNDEPLOY_THREAD_POOL_PARALLEL_H_ */
nndeploy::base::Range
Template class specifying a continuous subsequence (slice) of a sequence. The class is used to specif...
Definition:
type.h:403
nndeploy::thread_pool::ParallelLoopBody
Base class for parallel data processors.
Definition:
parallel.h:25
nndeploy::thread_pool::ParallelLoopBody::operator()
virtual void operator()(const base::Range &range) const =0
nndeploy::thread_pool::ParallelLoopBody::~ParallelLoopBody
virtual ~ParallelLoopBody()
Definition:
parallel.h:27
common.h
type.h
glic_stl_include.h
log.h
macro.h
NNDEPLOY_CC_API
#define NNDEPLOY_CC_API
api
Definition:
macro.h:29
nndeploy::thread_pool::defaultNumberOfThreads
int defaultNumberOfThreads()
nndeploy::thread_pool::stringToParallelForApiType
ParallelForApiType stringToParallelForApiType(const std::string &src)
nndeploy::thread_pool::getThreadNum
int getThreadNum()
nndeploy::thread_pool::parallelFor
void parallelFor(const base::Range &range, const ParallelLoopBody &body, double nstripes=-1.0)
Parallel data processor.
nndeploy::thread_pool::ParallelForApiType
ParallelForApiType
Definition:
parallel.h:15
nndeploy::thread_pool::kParallelForApiTypeDefault
@ kParallelForApiTypeDefault
Definition:
parallel.h:16
nndeploy::thread_pool::parallelForApiTypeToString
std::string parallelForApiTypeToString(ParallelForApiType type)
nndeploy::thread_pool::setThreadNum
void setThreadNum(int num)
nndeploy
Definition:
common.h:10
object.h
status.h
Generated by
1.9.1