From 1fac03717dab014fd202ea85a8f05b3dd475cb3c Mon Sep 17 00:00:00 2001 From: Giorgio Arena Date: Fri, 30 Apr 2021 15:09:46 +0100 Subject: Fix bug on CLReductionOperation Execution window along the X axis needs to be collapsed on the 3rd axis (rather than the 2nd) since there could be implicit padding added along the Y Resolve COMPMID-4425 Change-Id: I9623a31749b737fea7c623cabdcfbf77cbe8f6dc Signed-off-by: Giorgio Arena Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5551 Comments-Addressed: Arm Jenkins Reviewed-by: TeresaARM Reviewed-by: Georgios Pinitas Tested-by: Arm Jenkins --- src/core/CL/kernels/CLReductionOperationKernel.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/core/CL/kernels/CLReductionOperationKernel.cpp') diff --git a/src/core/CL/kernels/CLReductionOperationKernel.cpp b/src/core/CL/kernels/CLReductionOperationKernel.cpp index 5c80f33802..133a35f513 100644 --- a/src/core/CL/kernels/CLReductionOperationKernel.cpp +++ b/src/core/CL/kernels/CLReductionOperationKernel.cpp @@ -159,13 +159,7 @@ void CLReductionOperationKernel::configure(const CLCompileContext &compile_conte case 0: { build_opts.add_option("-DWIDTH=" + support::cpp11::to_string(width)); - kernel_axis_name = "x"; - - if(is_serial_op) - { - build_opts.add_option_if_else(_input->info()->data_type() == DataType::F16, "-DCOND_DATA_TYPE=short", "-DCOND_DATA_TYPE=int"); - kernel_axis_name = "non_parallel_x"; - } + kernel_axis_name = ((is_serial_op) ? "non_parallel_x" : "x"); } break; case 1: @@ -236,15 +230,15 @@ void CLReductionOperationKernel::run(const Window &window, cl::CommandQueue &que { // Set out window bool has_collapsed = true; - Window window_in = window.collapse_if_possible(window, 1, &has_collapsed); + Window window_in = window.collapse_if_possible(window, 2, &has_collapsed); ARM_COMPUTE_ERROR_ON(!has_collapsed); Window window_out = window_in; window_out.set(0, Window::Dimension()); unsigned int idx = 0; - add_2D_tensor_argument(idx, _input, window_in); - add_2D_tensor_argument(idx, _output, window_out); + add_3D_tensor_argument(idx, _input, window_in); + add_3D_tensor_argument(idx, _output, window_out); enqueue(queue, *this, window_in); } } -- cgit v1.2.1