From 232c45253a84c16fc70eae6406cac5f4048efaca Mon Sep 17 00:00:00 2001 From: Giorgio Arena Date: Thu, 3 Mar 2022 10:09:01 +0000 Subject: Merge kernel prototype patch Resolves: COMPMID-5151 Signed-off-by: Giorgio Arena Change-Id: Ic4024d5cd4819fe917a1d49621f1866ae2e90a37 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/7260 Tested-by: Arm Jenkins Reviewed-by: SiCong Li Comments-Addressed: Arm Jenkins --- arm_compute/runtime/CL/CLScheduler.h | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'arm_compute/runtime/CL/CLScheduler.h') diff --git a/arm_compute/runtime/CL/CLScheduler.h b/arm_compute/runtime/CL/CLScheduler.h index 37d9e2ad05..7ad59782e7 100644 --- a/arm_compute/runtime/CL/CLScheduler.h +++ b/arm_compute/runtime/CL/CLScheduler.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2021 Arm Limited. + * Copyright (c) 2016-2022 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -35,6 +35,20 @@ #include "arm_compute/runtime/CL/CLTypes.h" #include "arm_compute/runtime/CL/ICLTuner.h" +#if defined(ENABLE_EXPERIMENTAL_DYNAMIC_FUSION) +namespace arm_compute +{ +namespace experimental +{ +namespace dynamic_fusion +{ +struct TensorBinding; +struct ClExecutionDescriptor; +} // namespace dynamic_fusion +} // namespace experimental +} // namespace arm_compute +#endif // defined(ENABLE_EXPERIMENTAL_DYNAMIC_FUSION) + namespace arm_compute { class ICLKernel; @@ -87,6 +101,21 @@ public: */ void enqueue_op(ICLKernel &kernel, ITensorPack &tensors, bool flush = true); +#if defined(ENABLE_EXPERIMENTAL_DYNAMIC_FUSION) + + /** Schedule the execution of the passed kernel if possible. + * Use TensorBinding instead of ITensorPack for working with dynamic fusion + * @note Does not support dynamic tuning yet + * + * @param[in] kernel Kernel to execute. + * @param[in] tensors Map containing the tensors to operate on. + * @param[in] exec_desc Execution descriptor + * @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, experimental::dynamic_fusion::TensorBinding &tensors, const experimental::dynamic_fusion::ClExecutionDescriptor &exec_desc, bool flush = true); + +#endif // defined(ENABLE_EXPERIMENTAL_DYNAMIC_FUSION) + /** Initialises the context and command queue to be used by the scheduler. * * @param[in] context A CL context. @@ -173,6 +202,11 @@ public: private: void enqueue_common(ICLKernel &kernel, ITensorPack &tensors, bool flush); + +#if defined(ENABLE_EXPERIMENTAL_DYNAMIC_FUSION) + void enqueue_common(ICLKernel &kernel, experimental::dynamic_fusion::TensorBinding &tensors, const experimental::dynamic_fusion::ClExecutionDescriptor &exec_desc, bool flush); +#endif // defined(ENABLE_EXPERIMENTAL_DYNAMIC_FUSION) + /** Flag to ensure symbols initialisation is happening before Scheduler creation */ static std::once_flag _initialize_symbols; -- cgit v1.2.1