nndeploy C++ API
0.2.0
nndeploy C++ API
framework
include
nndeploy
thread_pool
parallel_for_api.h
Go to the documentation of this file.
1
#ifndef _NNDEPLOY_THREAD_POOL_PARALLEL_FOR_API_H_
2
#define _NNDEPLOY_THREAD_POOL_PARALLEL_FOR_API_H_
3
4
#include "
nndeploy/thread_pool/parallel.h
"
5
6
namespace
nndeploy
{
7
namespace
thread_pool {
8
9
class
ParallelForApi
{
10
public
:
11
ParallelForApi
() =
default
;
12
13
virtual
~ParallelForApi
() =
default
;
14
15
virtual
void
setThreadNum
(
int
num) = 0;
16
17
virtual
int
getThreadNum
() = 0;
18
19
virtual
int
parallelFor
(
const
base::Range
&range,
20
const
ParallelLoopBody
&body,
21
double
nstripes = -1.0) = 0;
22
};
23
24
std::shared_ptr<ParallelForApi> &
getParallelForApi
(
25
ParallelForApiType
type =
kParallelForApiTypeDefault
);
26
27
}
// namespace thread_pool
28
}
// namespace nndeploy
29
30
#endif
/* _NNDEPLOY_THREAD_POOL_PARALLEL_FOR_API_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::ParallelForApi
Definition:
parallel_for_api.h:9
nndeploy::thread_pool::ParallelForApi::parallelFor
virtual int parallelFor(const base::Range &range, const ParallelLoopBody &body, double nstripes=-1.0)=0
nndeploy::thread_pool::ParallelForApi::~ParallelForApi
virtual ~ParallelForApi()=default
nndeploy::thread_pool::ParallelForApi::ParallelForApi
ParallelForApi()=default
nndeploy::thread_pool::ParallelForApi::getThreadNum
virtual int getThreadNum()=0
nndeploy::thread_pool::ParallelForApi::setThreadNum
virtual void setThreadNum(int num)=0
nndeploy::thread_pool::ParallelLoopBody
Base class for parallel data processors.
Definition:
parallel.h:25
nndeploy::thread_pool::getParallelForApi
std::shared_ptr< ParallelForApi > & getParallelForApi(ParallelForApiType type=kParallelForApiTypeDefault)
nndeploy::thread_pool::ParallelForApiType
ParallelForApiType
Definition:
parallel.h:15
nndeploy::thread_pool::kParallelForApiTypeDefault
@ kParallelForApiTypeDefault
Definition:
parallel.h:16
nndeploy
Definition:
common.h:10
parallel.h
Generated by
1.9.1