aboutsummaryrefslogtreecommitdiff
path: root/src/core/CL/CLHelpers.cpp
diff options
context:
space:
mode:
authorGian Marco Iodice <gianmarco.iodice@arm.com>2020-06-02 12:12:35 +0100
committerGian Marco Iodice <gianmarco.iodice@arm.com>2020-06-02 17:18:29 +0000
commita98dee2da0aef1c53a31045b0c681fb0abc8f8ba (patch)
treeb4f0a130b19c47f19d9e5b326c18cb9cc8e765e2 /src/core/CL/CLHelpers.cpp
parent16bd6dd97fb704e31cd96e404e8c4148fe24d834 (diff)
downloadComputeLibrary-a98dee2da0aef1c53a31045b0c681fb0abc8f8ba.tar.gz
COMPMID-3319: Force padding requirement in CLGEMMReshapeRHSMatrixKernel
Added padding requirement in CLGEMMReshapeRHSMatrixKernel in order to create 2d image from a cl_buffer. Test extended in order to validate the padding requirement Change-Id: I36bcaf3e9299ee186602b4e3456851cc8cda6ce6 Signed-off-by: Gian Marco Iodice <gianmarco.iodice@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3292 Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/CL/CLHelpers.cpp')
-rw-r--r--src/core/CL/CLHelpers.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/core/CL/CLHelpers.cpp b/src/core/CL/CLHelpers.cpp
index 15f45d52d9..44695d00fe 100644
--- a/src/core/CL/CLHelpers.cpp
+++ b/src/core/CL/CLHelpers.cpp
@@ -370,6 +370,27 @@ bool preferred_dummy_work_items_support(const cl::Device &device)
return true;
}
+bool image2d_from_buffer_supported(const cl::Device &device)
+{
+ return device_supports_extension(device, "cl_khr_image2d_from_buffer");
+}
+
+size_t get_cl_image_pitch_alignment(const cl::Device &device)
+{
+ cl_uint pixel_aligment = 0;
+
+ cl_int err = clGetDeviceInfo(device(), CL_DEVICE_IMAGE_PITCH_ALIGNMENT, sizeof(cl_uint), &pixel_aligment, nullptr);
+
+ if(err == CL_SUCCESS)
+ {
+ return pixel_aligment;
+ }
+ else
+ {
+ return 0;
+ }
+}
+
cl::Kernel create_opencl_kernel(CLCoreRuntimeContext *ctx, const std::string &kernel_name, const CLBuildOptions &build_opts)
{
if(ctx && ctx->kernel_library())