aboutsummaryrefslogtreecommitdiff
path: root/src/core/CL/CLUtils.h
diff options
context:
space:
mode:
authorGian Marco Iodice <gianmarco.iodice@arm.com>2022-12-30 16:07:45 +0000
committerGian Marco Iodice <gianmarco.iodice@arm.com>2023-01-10 09:57:51 +0000
commit3cce35dcad8bc8f53a1e6613f719af9ab04feda6 (patch)
treee1015566852ebce4af897db37cf5cb1989c29924 /src/core/CL/CLUtils.h
parentd2d9361a0a338bce478f7d85b4af70d1ed20f26c (diff)
downloadComputeLibrary-3cce35dcad8bc8f53a1e6613f719af9ab04feda6.tar.gz
Extend cl image support to input and output tensors
- Add support for texture image to input and output of direct convolution - Extend T_LOAD2D_INDIRECT macro to read values from cl image storages Resolves COMPMID-5715 Signed-off-by: Gian Marco Iodice <gianmarco.iodice@arm.com> Change-Id: Idb0410f53f6d0763cd9e39895a7cbf9bc826d33a Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/8904 Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Viet-Hoa Do <viet-hoa.do@arm.com> Tested-by: 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.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/core/CL/CLUtils.h b/src/core/CL/CLUtils.h
index d133e4fe6f..b31944c72f 100644
--- a/src/core/CL/CLUtils.h
+++ b/src/core/CL/CLUtils.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2021 Arm Limited.
+ * Copyright (c) 2020-2021, 2023 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -34,6 +34,13 @@ class TensorShape;
class CLBuildOptions;
class ITensorInfo;
+/** OpenCL Image2D types */
+enum class CLImage2DType
+{
+ ReadOnly,
+ WriteOnly
+};
+
/** Create a cl::Image2D object from an OpenCL buffer
*
* @note The following conditions are required to create a OpenCL image object from OpenCL buffer,
@@ -49,10 +56,11 @@ class ITensorInfo;
* @param[in] shape2d 2D tensor shape
* @param[in] data_type DataType to use. Only supported: F32,F16
* @param[in] image_row_pitch Image row pitch (a.k.a. stride Y) to be used in the image2d object
+ * @param[in] image_type Image 2D type (@ref CLImage2DType)
*
* @return cl::Image2D object
*/
-cl::Image2D create_image2d_from_buffer(const cl::Context &ctx, const cl::Buffer &buffer, const TensorShape &shape2d, DataType data_type, size_t image_row_pitch);
+cl::Image2D create_image2d_from_buffer(const cl::Context &ctx, const cl::Buffer &buffer, const TensorShape &shape2d, DataType data_type, size_t image_row_pitch, CLImage2DType image_type);
namespace experimental
{