From 8c49f16e5909a9bd5dc6e68638d2e2d8acc2fc66 Mon Sep 17 00:00:00 2001 From: Jakub Sujak Date: Fri, 16 Jun 2023 09:52:50 +0100 Subject: Add helpers to set CKW tensor components as OpenCL kernel arguments * Define ckw::TensorStorage. The tensor storage represents the type of tensor memory object. * Add helper functions for setting the CKW TensorComponent and TensorStorage as OpenCL kernel arguments. * Refactor CL Image2D method for simpler image object creation. Resolves: COMPMID-5784 Change-Id: I2d37d06783c1dc55f3b5692b44eb49b151f2401c Signed-off-by: Jakub Sujak Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9807 Tested-by: Arm Jenkins Reviewed-by: SiCong Li Comments-Addressed: Arm Jenkins Benchmark: Arm Jenkins --- src/core/CL/CLUtils.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/core/CL/CLUtils.h') diff --git a/src/core/CL/CLUtils.h b/src/core/CL/CLUtils.h index b31944c72f..35dbee723e 100644 --- a/src/core/CL/CLUtils.h +++ b/src/core/CL/CLUtils.h @@ -33,6 +33,7 @@ namespace arm_compute class TensorShape; class CLBuildOptions; class ITensorInfo; +class ICLTensor; /** OpenCL Image2D types */ enum class CLImage2DType @@ -41,6 +42,15 @@ enum class CLImage2DType WriteOnly }; +/** Create a cl::Image2D object from a tensor + * + * @param[in] tensor Tensor from which to construct Image 2D object + * @param[in] image_type Image 2D type (@ref CLImage2DType) + * + * @return cl::Image2D object + */ +cl::Image2D create_image2d_from_tensor(const ICLTensor *tensor, CLImage2DType image_type); + /** Create a cl::Image2D object from an OpenCL buffer * * @note The following conditions are required to create a OpenCL image object from OpenCL buffer, -- cgit v1.2.1