aboutsummaryrefslogtreecommitdiff
path: root/src/core/CL/kernels/CLReductionOperationKernel.cpp
diff options
context:
space:
mode:
authorMichele Di Giorgio <michele.digiorgio@arm.com>2020-02-26 17:47:55 +0000
committerMichele Di Giorgio <michele.digiorgio@arm.com>2020-02-27 07:53:37 +0000
commit0333704d15f68fe18551b00d00839a9efbbe858f (patch)
tree2bf7c0e684d089ff86af675057701fc1faf3aaba /src/core/CL/kernels/CLReductionOperationKernel.cpp
parent0b192e84510c006d87cee3c29f95511ad088b704 (diff)
downloadComputeLibrary-0333704d15f68fe18551b00d00839a9efbbe858f.tar.gz
COMPMID-3223: Fix -14 error code on Firefly for CLReduction
Wrong data type was used for MIN/MAX reduction causing segfaults. This patch also simplifies window calculation for non-parallel reduction. Change-Id: I0abd9e84540801f92b306accd1439ff5df126a9e Signed-off-by: Michele Di Giorgio <michele.digiorgio@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/2792 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/kernels/CLReductionOperationKernel.cpp')
-rw-r--r--src/core/CL/kernels/CLReductionOperationKernel.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/core/CL/kernels/CLReductionOperationKernel.cpp b/src/core/CL/kernels/CLReductionOperationKernel.cpp
index ff824fce33..a0f9a49fff 100644
--- a/src/core/CL/kernels/CLReductionOperationKernel.cpp
+++ b/src/core/CL/kernels/CLReductionOperationKernel.cpp
@@ -87,14 +87,7 @@ std::tuple<Status, Window> validate_and_configure_window(ITensorInfo *input, ITe
{
case 0:
{
- if(is_serial_op)
- {
- AccessWindowHorizontal input_access(input, 0, input->dimension(0));
- AccessWindowHorizontal output_access(output, 0, 1);
- window_changed = update_window_and_padding(win, input_access, output_access);
- output_access.set_valid_region(win, ValidRegion(Coordinates(), output->tensor_shape()));
- }
- else
+ if(!is_serial_op)
{
const unsigned int border_width = ((input->dimension(0) % border_val) != 0) ? border_val - input->dimension(0) % border_val : 0;
AccessWindowStatic input_access(input, 0, 0, input->dimension(0) + border_width, 1);
@@ -269,8 +262,11 @@ void CLReductionOperationKernel::run(const Window &window, cl::CommandQueue &que
Window window_in{ window };
window_in.set(Window::DimX, Window::Dimension(0, _input->info()->dimension(0), _input->info()->dimension(0)));
- Window in_slice = window.first_slice_window_1D();
- Window out_slice = window.first_slice_window_1D();
+ Window out_window{ window };
+ out_window.set(Window::DimX, Window::Dimension(0, 0, 0));
+
+ Window in_slice = window_in.first_slice_window_1D();
+ Window out_slice = out_window.first_slice_window_1D();
do
{
@@ -279,7 +275,7 @@ void CLReductionOperationKernel::run(const Window &window, cl::CommandQueue &que
add_1D_tensor_argument(idx, _output, out_slice);
enqueue(queue, *this, in_slice, lws_hint());
}
- while(window_in.slide_window_slice_1D(in_slice) && window.slide_window_slice_1D(out_slice));
+ while(window_in.slide_window_slice_1D(in_slice) && out_window.slide_window_slice_1D(out_slice));
}
else
{