aboutsummaryrefslogtreecommitdiff
path: root/arm_compute
diff options
context:
space:
mode:
authorSang-Hoon Park <sang-hoon.park@arm.com>2021-01-20 18:16:47 +0000
committerGeorgios Pinitas <georgios.pinitas@arm.com>2021-01-21 16:23:55 +0000
commit0094c023038cbb353f60e96d1301b4bb25c9e382 (patch)
tree18d0c8e312c16f82e272b959b9aca92c655a5b15 /arm_compute
parentf47f718e87889b7d501a48e1d86b5d12b2e3f54c (diff)
downloadComputeLibrary-0094c023038cbb353f60e96d1301b4bb25c9e382.tar.gz
Add window parameter to scheduler
To support window configured outside of kernels, the parameter is added to scheduler. The existing operators pass window from kernels to preserve the current behavior. Partial Implements: COMPMID-4003 Change-Id: I4514e12fb5b0c60e4adfc1a51e53a8a5de356a0d Signed-off-by: Sang-Hoon Park <sang-hoon.park@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4892 Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'arm_compute')
-rw-r--r--arm_compute/runtime/CPP/CPPScheduler.h4
-rw-r--r--arm_compute/runtime/IScheduler.h15
-rw-r--r--arm_compute/runtime/OMP/OMPScheduler.h5
-rw-r--r--arm_compute/runtime/SingleThreadScheduler.h5
4 files changed, 20 insertions, 9 deletions
diff --git a/arm_compute/runtime/CPP/CPPScheduler.h b/arm_compute/runtime/CPP/CPPScheduler.h
index 764af818d9..9e8fd4174a 100644
--- a/arm_compute/runtime/CPP/CPPScheduler.h
+++ b/arm_compute/runtime/CPP/CPPScheduler.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2020 Arm Limited.
+ * Copyright (c) 2016-2021 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -52,7 +52,7 @@ public:
void set_num_threads_with_affinity(unsigned int num_threads, BindFunc func) override;
unsigned int num_threads() const override;
void schedule(ICPPKernel *kernel, const Hints &hints) override;
- void schedule_op(ICPPKernel *kernel, const Hints &hints, ITensorPack &tensors) override;
+ void schedule_op(ICPPKernel *kernel, const Hints &hints, const Window &window, ITensorPack &tensors) override;
protected:
/** Will run the workloads in parallel using num_threads
diff --git a/arm_compute/runtime/IScheduler.h b/arm_compute/runtime/IScheduler.h
index 309aee3bb5..d3ba86a67b 100644
--- a/arm_compute/runtime/IScheduler.h
+++ b/arm_compute/runtime/IScheduler.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2020 Arm Limited.
+ * Copyright (c) 2017-2021 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -35,6 +35,7 @@ namespace arm_compute
{
class ICPPKernel;
class ITensor;
+class Window;
/** Scheduler interface to run kernels */
class IScheduler
@@ -168,9 +169,10 @@ public:
*
* @param[in] kernel Kernel to execute.
* @param[in] hints Hints for the scheduler.
+ * @param[in] window Window to use for kernel execution.
* @param[in] tensors Vector containing the tensors to operate on.
*/
- virtual void schedule_op(ICPPKernel *kernel, const Hints &hints, ITensorPack &tensors) = 0;
+ virtual void schedule_op(ICPPKernel *kernel, const Hints &hints, const Window &window, ITensorPack &tensors) = 0;
/** Execute all the passed workloads
*
@@ -205,7 +207,14 @@ protected:
virtual void run_workloads(std::vector<Workload> &workloads) = 0;
CPUInfo _cpu_info;
- void schedule_common(ICPPKernel *kernel, const Hints &hints, ITensorPack &tensors);
+ /** Common scheduler logic to execute the given kernel
+ *
+ * @param[in] kernel Kernel to execute.
+ * @param[in] hints Hints for the scheduler.
+ * @param[in] window Window to use for kernel execution.
+ * @param[in] tensors Vector containing the tensors to operate on.
+ */
+ void schedule_common(ICPPKernel *kernel, const Hints &hints, const Window &window, ITensorPack &tensors);
private:
unsigned int _num_threads_hint = {};
diff --git a/arm_compute/runtime/OMP/OMPScheduler.h b/arm_compute/runtime/OMP/OMPScheduler.h
index 56a31cc076..b522b403a9 100644
--- a/arm_compute/runtime/OMP/OMPScheduler.h
+++ b/arm_compute/runtime/OMP/OMPScheduler.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2020 Arm Limited.
+ * Copyright (c) 2017-2021 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -63,9 +63,10 @@ public:
*
* @param[in] kernel Kernel to execute.
* @param[in] hints Hints for the scheduler.
+ * @param[in] window Window to use for kernel execution.
* @param[in] tensors Vector containing the tensors to operate on.
*/
- void schedule_op(ICPPKernel *kernel, const Hints &hints, ITensorPack &tensors) override;
+ void schedule_op(ICPPKernel *kernel, const Hints &hints, const Window &window, ITensorPack &tensors) override;
protected:
/** Execute all the passed workloads
diff --git a/arm_compute/runtime/SingleThreadScheduler.h b/arm_compute/runtime/SingleThreadScheduler.h
index d45730e499..a9541d15a7 100644
--- a/arm_compute/runtime/SingleThreadScheduler.h
+++ b/arm_compute/runtime/SingleThreadScheduler.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2020 Arm Limited.
+ * Copyright (c) 2017-2021 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -54,9 +54,10 @@ public:
*
* @param[in] kernel Kernel to execute.
* @param[in] hints Hints for the scheduler.
+ * @param[in] window Window to use for kernel execution.
* @param[in] tensors Vector containing the tensors to operate on.
*/
- void schedule_op(ICPPKernel *kernel, const Hints &hints, ITensorPack &tensors) override;
+ void schedule_op(ICPPKernel *kernel, const Hints &hints, const Window &window, ITensorPack &tensors) override;
protected:
/** Will run the workloads sequentially and in order.