diff options
author | Jakub Sujak <jakub.sujak@arm.com> | 2023-06-16 09:52:50 +0100 |
---|---|---|
committer | Jakub Sujak <jakub.sujak@arm.com> | 2023-06-26 13:07:05 +0000 |
commit | 8c49f16e5909a9bd5dc6e68638d2e2d8acc2fc66 (patch) | |
tree | 7e6c13c7f4522ea2db1ccdafe7c2858632ee4532 /src/core/CL/CLUtils.h | |
parent | 7d9a78ebfb3553b95421a0da5e2686a3923748db (diff) | |
download | ComputeLibrary-8c49f16e5909a9bd5dc6e68638d2e2d8acc2fc66.tar.gz |
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 <jakub.sujak@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9807
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: SiCong Li <sicong.li@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/CL/CLUtils.h')
-rw-r--r-- | src/core/CL/CLUtils.h | 10 |
1 files changed, 10 insertions, 0 deletions
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, |