From e1651a55c637708347c9adda4a77f1deffacf7d2 Mon Sep 17 00:00:00 2001 From: Michalis Spyrou Date: Thu, 11 Jul 2019 15:00:49 +0100 Subject: COMPMID-2414 Add add_2D_tensor_argument_if for OpenCL Change-Id: I8675b4b4face0be9416ae6c7a7023234d50fc0cb Signed-off-by: Michalis Spyrou Reviewed-on: https://review.mlplatform.org/c/1524 Comments-Addressed: Arm Jenkins Reviewed-by: Michele Di Giorgio Tested-by: Arm Jenkins --- src/core/CL/kernels/CLSpaceToBatchLayerKernel.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/core/CL/kernels/CLSpaceToBatchLayerKernel.cpp') diff --git a/src/core/CL/kernels/CLSpaceToBatchLayerKernel.cpp b/src/core/CL/kernels/CLSpaceToBatchLayerKernel.cpp index f0391989a7..1492f34f27 100644 --- a/src/core/CL/kernels/CLSpaceToBatchLayerKernel.cpp +++ b/src/core/CL/kernels/CLSpaceToBatchLayerKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 ARM Limited. + * Copyright (c) 2018-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -192,13 +192,12 @@ void CLSpaceToBatchLayerKernel::run(const Window &window, cl::CommandQueue &queu int batch_id = 0; do { - unsigned int idx = 0; + unsigned int idx = 0; + const bool cond = (_paddings != nullptr && _block_shape != nullptr); add_4D_tensor_argument(idx, _input, slice_in); - if(_paddings != nullptr && _block_shape != nullptr) - { - add_2D_tensor_argument(idx, _paddings, padding_slice); - add_1D_tensor_argument(idx, _block_shape, vector_slice); - } + add_2D_tensor_argument_if(cond, idx, _paddings, padding_slice); + add_1D_tensor_argument_if(cond, idx, _block_shape, vector_slice); + add_argument(idx, batch_id); add_3D_tensor_argument(idx, _output, slice_out); enqueue(queue, *this, slice_out); -- cgit v1.2.1