aboutsummaryrefslogtreecommitdiff
path: root/src/core/CL/kernels/CLReductionOperationKernel.cpp
diff options
context:
space:
mode:
authorGiorgio Arena <giorgio.arena@arm.com>2021-04-30 15:09:46 +0100
committerGiorgio Arena <giorgio.arena@arm.com>2021-05-04 14:01:10 +0000
commit1fac03717dab014fd202ea85a8f05b3dd475cb3c (patch)
tree2fb08ff6aff8a123808fce1e2ba0328699e64ef6 /src/core/CL/kernels/CLReductionOperationKernel.cpp
parent4fc10b3ae968bcdc8c1aaab358e93f2e1ba328dc (diff)
downloadComputeLibrary-1fac03717dab014fd202ea85a8f05b3dd475cb3c.tar.gz
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 <giorgio.arena@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5551 Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: TeresaARM <teresa.charlinreyes@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/CL/kernels/CLReductionOperationKernel.cpp')
-rw-r--r--src/core/CL/kernels/CLReductionOperationKernel.cpp14
1 files changed, 4 insertions, 10 deletions
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);
}
}