24 #ifndef ARM_COMPUTE_ISCHEDULER_H 25 #define ARM_COMPUTE_ISCHEDULER_H 78 : _split_dimension(split_dimension), _strategy(strategy), _threshold(
threshold)
89 _split_dimension = split_dimension;
98 return _split_dimension;
109 _strategy = strategy;
130 unsigned int _split_dimension;
135 using Workload = std::function<void(const ThreadInfo &)>;
207 virtual void run_workloads(std::vector<Workload> &workloads) = 0;
220 unsigned int _num_threads_hint = {};
std::function< void(const ThreadInfo &)> Workload
Signature for the workloads to execute.
IScheduler()
Default constructor.
Common interface for all kernels implemented in C++.
virtual void set_num_threads(unsigned int num_threads)=0
Sets the number of threads the scheduler will use to run the kernels.
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.
Scheduler interface to run kernels.
Split the workload evenly among the threads.
static constexpr unsigned int split_dimensions_all
When arm_compute::ISchedular::Hints::_split_dimension is initialized with this value then the schedul...
CPUInfo & cpu_info()
Get CPU info.
virtual void run_tagged_workloads(std::vector< Workload > &workloads, const char *tag)
Execute all the passed workloads.
int threshold() const
Return the granule capping threshold to be used by dynamic scheduling.
Copyright (c) 2017-2021 Arm Limited.
Hints(unsigned int split_dimension, StrategyHint strategy=StrategyHint::STATIC, int threshold=0)
Constructor.
Split the workload dynamically using a bucket system.
std::function< int(int, int)> BindFunc
Function to be used and map a given thread id to a logical core id.
virtual ~IScheduler()=default
Destructor.
StrategyHint strategy() const
Return the prefered strategy to use to split workload.
Hints & set_split_dimension(unsigned int split_dimension)
Set the split_dimension hint.
virtual void schedule(ICPPKernel *kernel, const Hints &hints)=0
Runs the kernel in the same thread as the caller synchronously.
unsigned int num_threads_hint() const
Get a hint for the best possible number of execution threads.
unsigned int split_dimension() const
Return the prefered split dimension.
virtual unsigned int num_threads() const =0
Returns the number of threads that the SingleThreadScheduler has in his 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...
Hints & set_strategy(StrategyHint strategy)
Set the strategy hint.
SimpleTensor< T > threshold(const SimpleTensor< T > &src, T threshold, T false_value, T true_value, ThresholdType type, T upper)
Describe a multidimensional execution window.
StrategyHint
Strategies available to split a workload.