23.11
|
Go to the documentation of this file.
24 #ifndef ARM_COMPUTE_ISCHEDULER_H
25 #define ARM_COMPUTE_ISCHEDULER_H
98 return _split_dimension;
130 unsigned int _split_dimension{};
207 virtual void run_workloads(std::vector<Workload> &workloads) = 0;
229 std::size_t adjust_num_of_windows(
const Window &window,
230 std::size_t split_dimension,
231 std::size_t init_num_windows,
236 unsigned int _num_threads_hint = {};
IScheduler()
Default constructor.
std::function< void(const ThreadInfo &)> Workload
Signature for the workloads to execute.
StrategyHint strategy() const
Return the prefered strategy to use to split workload.
virtual void schedule_op(ICPPKernel *kernel, const Hints &hints, const Window &window, ITensorPack &tensors)=0
Runs the kernel in the same thread as the caller synchronously.
@ STATIC
Split the workload evenly among the threads.
CPUInfo & cpu_info()
Get CPU info.
virtual void set_num_threads(unsigned int num_threads)=0
Sets the number of threads the scheduler will use to run the kernels.
static constexpr unsigned int split_dimensions_all
When arm_compute::ISchedular::Hints::_split_dimension is initialized with this value then the schedul...
virtual void run_tagged_workloads(std::vector< Workload > &workloads, const char *tag)
Execute all the passed workloads.
Hints & set_split_dimension(unsigned int split_dimension)
Set the split_dimension hint.
std::function< int(int, int)> BindFunc
Function to be used and map a given thread id to a logical core id.
@ DYNAMIC
Split the workload dynamically using a bucket system.
unsigned int split_dimension() const
Return the prefered split dimension.
virtual ~IScheduler()=default
Destructor.
Common interface for all kernels implemented in C++.
Hints(unsigned int split_dimension, StrategyHint strategy=StrategyHint::STATIC, int threshold=0)
Constructor.
int threshold() const
Return the granule capping threshold to be used by dynamic scheduling.
virtual void schedule(ICPPKernel *kernel, const Hints &hints)=0
Runs the kernel in the same thread as the caller synchronously.
Information about executing thread and CPU.
Hints & set_strategy(StrategyHint strategy)
Set the strategy hint.
Scheduler interface to run kernels.
Describe a multidimensional execution window.
Copyright (c) 2017-2023 Arm Limited.
virtual unsigned int num_threads() const =0
Returns the number of threads that the SingleThreadScheduler has in its pool.
virtual void set_num_threads_with_affinity(unsigned int num_threads, BindFunc func)
Sets the number of threads the scheduler will use to run the kernels but also using a binding functio...
unsigned int num_threads_hint() const
Get a hint for the best possible number of execution threads.
StrategyHint
Strategies available to split a workload.