diff options
author | Pablo Marquez Tello <pablo.tello@arm.com> | 2023-05-05 15:02:32 +0100 |
---|---|---|
committer | Pablo Marquez Tello <pablo.tello@arm.com> | 2023-06-06 13:36:13 +0000 |
commit | 48c0ed9d6298dfcc2bf37ac85c168fc7d41ee803 (patch) | |
tree | 13b4338bb175a759e03a3cbe88ceb755d4a6a8cd /src/cpu/kernels | |
parent | 74921eee924625426429044decefe3673561b174 (diff) | |
download | ComputeLibrary-48c0ed9d6298dfcc2bf37ac85c168fc7d41ee803.tar.gz |
Fix ScaleKernel validate method.
* Validate returns an error if the number of channels of the input tensor is
not 1. With this change we generate an error if scale is called with any of
these formats:
Format::UV88, Format::RGB888, Format::RGBA8888,Format::YUV444,
Format::YUYV422, Format::NV12, Format::NV21,Format::IYUV,
Format::UYVY422
* Resolves ARMCL-631
Change-Id: If9d8b9d95332994920def55d8faae9dbf4213f79
Signed-off-by: Pablo Marquez Tello <pablo.tello@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9579
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Viet-Hoa Do <viet-hoa.do@arm.com>
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/cpu/kernels')
-rw-r--r-- | src/cpu/kernels/CpuScaleKernel.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cpu/kernels/CpuScaleKernel.cpp b/src/cpu/kernels/CpuScaleKernel.cpp index b8bb5ad18a..4f01c794cf 100644 --- a/src/cpu/kernels/CpuScaleKernel.cpp +++ b/src/cpu/kernels/CpuScaleKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2022 Arm Limited. + * Copyright (c) 2016-2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -136,10 +136,10 @@ Status validate_arguments(const ITensorInfo *src, const ITensorInfo *dx, const I const auto *uk = CpuScaleKernel::get_implementation(ScaleKernelDataTypeISASelectorData{ src->data_type(), CPUInfo::get().get_isa(), info.interpolation_policy }); ARM_COMPUTE_RETURN_ERROR_ON(uk == nullptr || uk->ukernel == nullptr); - ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(dst); ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(src, dst); ARM_COMPUTE_RETURN_ERROR_ON(dst == src); + ARM_COMPUTE_RETURN_ERROR_ON(src->num_channels()!=1); ARM_COMPUTE_RETURN_ERROR_ON(info.sampling_policy != SamplingPolicy::CENTER && info.sampling_policy != SamplingPolicy::TOP_LEFT); ARM_COMPUTE_UNUSED(info.constant_border_value); ARM_COMPUTE_RETURN_ERROR_ON_MSG(info.use_padding, "Padding is not supported"); |