21.02
|
Pool of threads to automatically split a kernel's execution among several threads. More...
#include <SingleThreadScheduler.h>
Public Member Functions | |
SingleThreadScheduler ()=default | |
Constructor. More... | |
void | set_num_threads (unsigned int num_threads) override |
Sets the number of threads the scheduler will use to run the kernels. More... | |
unsigned int | num_threads () const override |
Returns the number of threads that the SingleThreadScheduler has, which is always 1. More... | |
void | schedule (ICPPKernel *kernel, const Hints &hints) override |
Runs the kernel in the same thread as the caller synchronously. More... | |
void | schedule_op (ICPPKernel *kernel, const Hints &hints, const Window &window, ITensorPack &tensors) override |
Runs the kernel in the same thread as the caller synchronously. More... | |
Public Member Functions inherited from IScheduler | |
IScheduler () | |
Default constructor. More... | |
virtual | ~IScheduler ()=default |
Destructor. More... | |
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 function to pin the threads to given logical cores. More... | |
virtual void | run_tagged_workloads (std::vector< Workload > &workloads, const char *tag) |
Execute all the passed workloads. More... | |
CPUInfo & | cpu_info () |
Get CPU info. More... | |
unsigned int | num_threads_hint () const |
Get a hint for the best possible number of execution threads. More... | |
Additional Inherited Members | |
Public Types inherited from IScheduler | |
enum | StrategyHint { STATIC, DYNAMIC } |
Strategies available to split a workload. More... | |
using | BindFunc = std::function< int(int, int)> |
Function to be used and map a given thread id to a logical core id. More... | |
using | Workload = std::function< void(const ThreadInfo &)> |
Signature for the workloads to execute. More... | |
Static Public Attributes inherited from IScheduler | |
static constexpr unsigned int | split_dimensions_all = std::numeric_limits<unsigned>::max() |
When arm_compute::ISchedular::Hints::_split_dimension is initialized with this value then the schedular is free to break down the problem space over as many dimensions as it wishes. More... | |
Pool of threads to automatically split a kernel's execution among several threads.
Definition at line 32 of file SingleThreadScheduler.h.
|
default |
Constructor.
|
overridevirtual |
Returns the number of threads that the SingleThreadScheduler has, which is always 1.
Implements IScheduler.
Definition at line 73 of file SingleThreadScheduler.cpp.
|
overridevirtual |
Runs the kernel in the same thread as the caller synchronously.
[in] | kernel | Kernel to execute. |
[in] | hints | Hints for the scheduler. |
Implements IScheduler.
Definition at line 38 of file SingleThreadScheduler.cpp.
References ThreadInfo::cpu_info, arm_compute::test::validation::info, Window::num_iterations(), ICPPKernel::run(), IScheduler::Hints::split_dimension(), IScheduler::split_dimensions_all, and IKernel::window().
|
overridevirtual |
Runs the kernel in the same thread as the caller synchronously.
[in] | kernel | Kernel to execute. |
[in] | hints | Hints for the scheduler. |
[in] | window | Window to use for kernel execution. |
[in] | tensors | Vector containing the tensors to operate on. |
Implements IScheduler.
Definition at line 56 of file SingleThreadScheduler.cpp.
References ARM_COMPUTE_UNUSED, ThreadInfo::cpu_info, arm_compute::test::validation::info, and ICPPKernel::run_op().
|
overridevirtual |
Sets the number of threads the scheduler will use to run the kernels.
[in] | num_threads | This is ignored for this scheduler as the number of threads is always one. |
Implements IScheduler.
Definition at line 32 of file SingleThreadScheduler.cpp.
References ARM_COMPUTE_ERROR_ON, and ARM_COMPUTE_UNUSED.