From 6c89ffac750010cb9335794defe8a366c04db937 Mon Sep 17 00:00:00 2001 From: Michalis Spyrou Date: Fri, 24 Jan 2020 12:05:05 +0000 Subject: COMPMID-2819: Fix supported types in DepthwiseReshapeKernel Add support for all types in validation of CLDepthwiseConvolutionLayerReshapeWeightsKernel. Also added a few missing parentheses in reduction_operation.cl. Change-Id: I7371ce6d5e402e9c2faafd7948e4643298bc1ace Signed-off-by: Michalis Spyrou Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/2641 Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins Reviewed-by: Georgios Pinitas --- .../CL/kernels/CLDepthwiseConvolutionLayerReshapeWeightsKernel.h | 4 ++-- src/core/CL/cl_kernels/reduction_operation.cl | 6 +++--- .../CL/kernels/CLDepthwiseConvolutionLayerReshapeWeightsKernel.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arm_compute/core/CL/kernels/CLDepthwiseConvolutionLayerReshapeWeightsKernel.h b/arm_compute/core/CL/kernels/CLDepthwiseConvolutionLayerReshapeWeightsKernel.h index f209629b11..97225c7c33 100644 --- a/arm_compute/core/CL/kernels/CLDepthwiseConvolutionLayerReshapeWeightsKernel.h +++ b/arm_compute/core/CL/kernels/CLDepthwiseConvolutionLayerReshapeWeightsKernel.h @@ -47,7 +47,7 @@ public: /** Initialize the function's source and destination. * - * @param[in] input The input tensor of dimension [IFM, W, H]. Data types supported: QASYMM8/QASYMM8_SIGNED. Data layouts supported: NHWC + * @param[in] input The input tensor of dimension [IFM, W, H]. Data types supported: All. Data layouts supported: NHWC * @param[out] output The output tensor of dimension [W*H*C0, ceil(IFM/C0)]. C0 is the number of channels read by each thread. Data types supported: same as @p weights. * @param[in] info Depthwise convolution information to reshape the input tensor. */ @@ -55,7 +55,7 @@ public: /** Static function to check if given info will lead to a valid configuration of @ref CLDepthwiseConvolutionLayer3x3NHWCKernel * - * @param[in] input The input tensor info of dimension [IFM, W, H]. Data types supported: QASYMM8/QASYMM8_SIGNED. Data layouts supported: NHWC + * @param[in] input The input tensor info of dimension [IFM, W, H]. Data types supported: All. Data layouts supported: NHWC * @param[in] output The output tensor info of dimension [W*H*C0, ceil(IFM/C0)]. C0 is the number of channels read by each thread. Data types supported: same as @p weights. * @param[in] info Depthwise convolution information to reshape the input tensor. * diff --git a/src/core/CL/cl_kernels/reduction_operation.cl b/src/core/CL/cl_kernels/reduction_operation.cl index 79d0d0683e..0c393345e2 100644 --- a/src/core/CL/cl_kernels/reduction_operation.cl +++ b/src/core/CL/cl_kernels/reduction_operation.cl @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2019 ARM Limited. + * Copyright (c) 2016-2020 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -31,8 +31,8 @@ #define ISGREATER(x, y) (x > y) ? 1 : 0 #define ISLESS(x, y) (x < y) ? 1 : 0 #else // !defined(WIDTH) -#define ISGREATER(x, y) select(int16)0, int16) - 1, x > y) -#define ISLESS(x, y) select(int16)0, int16) - 1, x < y) +#define ISGREATER(x, y) select((int16)0, (int16)-1, x > y) +#define ISLESS(x, y) select((int16)0, (int16)-1, x < y) #endif // defined(WIDTH) #endif // defined(FLOAT_DATA_TYPE) diff --git a/src/core/CL/kernels/CLDepthwiseConvolutionLayerReshapeWeightsKernel.cpp b/src/core/CL/kernels/CLDepthwiseConvolutionLayerReshapeWeightsKernel.cpp index ef53e09787..4c927fd3e2 100644 --- a/src/core/CL/kernels/CLDepthwiseConvolutionLayerReshapeWeightsKernel.cpp +++ b/src/core/CL/kernels/CLDepthwiseConvolutionLayerReshapeWeightsKernel.cpp @@ -52,7 +52,7 @@ Status validate_arguments(const ITensorInfo *input, const ITensorInfo *output, c ARM_COMPUTE_RETURN_ERROR_ON(info.c0 != 4); ARM_COMPUTE_RETURN_ERROR_ON(input->dimension(idx_h) != 3); ARM_COMPUTE_RETURN_ERROR_ON(input->dimension(idx_w) != 3); - ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(input, 1, DataType::QASYMM8, DataType::QASYMM8_SIGNED); + ARM_COMPUTE_RETURN_ERROR_ON(input->data_type() == DataType::UNKNOWN); if(output->total_size() != 0) { -- cgit v1.2.1