diff options
author | Gian Marco Iodice <gianmarco.iodice@arm.com> | 2020-06-19 16:56:57 +0100 |
---|---|---|
committer | Gian Marco Iodice <gianmarco.iodice@arm.com> | 2020-06-29 22:06:22 +0000 |
commit | 781cba7f33e056b1ca470ab34eb478177768eaf4 (patch) | |
tree | 58a33f8a3a98904a0463f601e5faaa1ce24c1baf /src/core/CL/kernels/CLGEMMMatrixMultiplyReshapedKernel.cpp | |
parent | c5b6d8822da0fae1807dda46674f68d00db8e321 (diff) | |
download | ComputeLibrary-781cba7f33e056b1ca470ab34eb478177768eaf4.tar.gz |
COMPMID-3322: Add cl_image support for GEMMReshapedOnlyRHS NT
COMPMID-3323: Add cl_image support for GEMMReshapedOnlyRHS T
- Added support for cl_image in CLGEMMMatrixMultiplyReshapedInlyRHSKernel (both NT and T kernels)
- Extended the tests for the validating rhs_info.export_to_cl_image = true
- Updated doxygen documentation in CLGEMMMatrixMultiplyReshapedOnlyRHSKernel.h
Change-Id: If253794323aac072d84a4d8680b9a2339ab7ad92
Signed-off-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3437
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/CL/kernels/CLGEMMMatrixMultiplyReshapedKernel.cpp')
-rw-r--r-- | src/core/CL/kernels/CLGEMMMatrixMultiplyReshapedKernel.cpp | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/src/core/CL/kernels/CLGEMMMatrixMultiplyReshapedKernel.cpp b/src/core/CL/kernels/CLGEMMMatrixMultiplyReshapedKernel.cpp index 22bde635e6..d6ee0b0c4d 100644 --- a/src/core/CL/kernels/CLGEMMMatrixMultiplyReshapedKernel.cpp +++ b/src/core/CL/kernels/CLGEMMMatrixMultiplyReshapedKernel.cpp @@ -38,6 +38,7 @@ #include "arm_compute/core/Window.h" #include "arm_compute/core/utils/helpers/float_ops.h" #include "arm_compute/core/utils/misc/ShapeCalculator.h" +#include "src/core/CL/CLUtils.h" #include "support/StringSupport.h" #include <cstddef> @@ -380,29 +381,14 @@ void CLGEMMMatrixMultiplyReshapedKernel::run(const Window &window, cl::CommandQu const unsigned int total_cross_plane_pad = _output->info()->padding().top + _output->info()->padding().bottom; - cl_mem cl_image; - cl_int err = CL_SUCCESS; cl::Image2D input1_image2d; if(_export_to_cl_image) { - // Create OpenCL image object from OpenCL buffer - const cl_image_format format = { CL_RGBA, CL_FLOAT }; + const TensorShape shape2d(_input1->info()->dimension(0) / 4, _input1->info()->dimension(1) * _input1->info()->dimension(2)); + const size_t image_row_pitch = _input1->info()->strides_in_bytes()[1]; - cl_image_desc desc; - memset(&desc, 0, sizeof(desc)); - desc.image_type = CL_MEM_OBJECT_IMAGE2D; - desc.mem_object = _input1->cl_buffer()(); - desc.image_row_pitch = _input1->info()->strides_in_bytes()[1]; - desc.image_width = _input1->info()->dimension(0) / 4; - desc.image_height = _input1->info()->dimension(1) * _input1->info()->dimension(2); - - cl_image = clCreateImage(CLKernelLibrary::get().context()(), CL_MEM_READ_ONLY, &format, &desc, nullptr, &err); - - ARM_COMPUTE_UNUSED(err); - ARM_COMPUTE_ERROR_ON_MSG(err != CL_SUCCESS, "Error during the creation of CL image from buffer"); - - input1_image2d = cl::Image2D(cl_image); + input1_image2d = create_image2d_from_buffer(CLKernelLibrary::get().context(), _input1->cl_buffer(), shape2d, CL_FLOAT, image_row_pitch); } do |