diff options
author | Giorgio Arena <giorgio.arena@arm.com> | 2021-09-06 14:32:19 +0100 |
---|---|---|
committer | Giorgio Arena <giorgio.arena@arm.com> | 2021-09-06 16:22:26 +0000 |
commit | 8afe6c7631891601897d7dd5b9ac68375ac01b19 (patch) | |
tree | 2d13f9118a59cef22be841892550dce8c8148650 /arm_compute | |
parent | 2c74f138878c5cffc5a9fceb411a9d1592241080 (diff) | |
download | ComputeLibrary-8afe6c7631891601897d7dd5b9ac68375ac01b19.tar.gz |
OpenCL job chaining support
Resolve COMPMID-4714
Change-Id: I53b74956da10a8d7ffa2c5681f3b7f74acaa3201
Signed-off-by: Giorgio Arena <giorgio.arena@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/6215
Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute')
-rw-r--r-- | arm_compute/runtime/CL/CLScheduler.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/arm_compute/runtime/CL/CLScheduler.h b/arm_compute/runtime/CL/CLScheduler.h index 56852aec6e..37d9e2ad05 100644 --- a/arm_compute/runtime/CL/CLScheduler.h +++ b/arm_compute/runtime/CL/CLScheduler.h @@ -76,14 +76,14 @@ public: /** Schedule the execution of the passed kernel if possible. * * @param[in] kernel Kernel to execute. - * @param[in] flush (Optional) Specifies if the command queue will be flushed after running the kernel. + * @param[in] flush (Optional) Specifies if the command queue will be flushed after running the kernel. This will be ignored if job chaining is enabled. */ void enqueue(ICLKernel &kernel, bool flush = true); /** Schedule the execution of the passed kernel if possible. * * @param[in] kernel Kernel to execute. * @param[in] tensors Vector containing the tensors to operate on. - * @param[in] flush (Optional) Specifies if the command queue will be flushed after running the kernel. + * @param[in] flush (Optional) Specifies if the command queue will be flushed after running the kernel. This will be ignored if job chaining is enabled. */ void enqueue_op(ICLKernel &kernel, ITensorPack &tensors, bool flush = true); @@ -163,6 +163,12 @@ public: */ void tune_kernel_static(ICLKernel &kernel); + /** Enable job chaining. The command queue will only be flushed when @p job_chaining_size kernels have been enqueued. + * + * @param[in] job_chaining_size Kernels to enqueue before flushing + */ + void enable_job_chaining(int job_chaining_size); + bool is_initialised() const; private: @@ -177,6 +183,9 @@ private: ICLTuner *_cl_tuner; CLGEMMHeuristicsHandle *_gemm_heuristics; CLBackendType _backend_type; + bool _job_chaining_enabled; + int _job_chaining_size; + int _job_chaining_count; }; } // namespace arm_compute #endif /* ARM_COMPUTE_CLSCHEDULER_H */ |