diff options
author | Ioan-Cristian Szabo <ioan-cristian.szabo@arm.com> | 2017-10-27 17:35:40 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:47:18 +0000 |
commit | 91d20d95df35961d3eb5de497007d98576118d19 (patch) | |
tree | 13042e212d65fbf5bd7425079bb72b6bd1e2e84d /tests/SimpleTensor.h | |
parent | 19835e591cb0b66a0f5000ae1505bf299e50337d (diff) | |
download | ComputeLibrary-91d20d95df35961d3eb5de497007d98576118d19.tar.gz |
COMPMID-582: Add validation to channel_extract kernels.
Change-Id: I6413a05f6870a0d04f12d7348269b15297ae8493
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/114696
Tested-by: Jenkins <bsgcomp@arm.com>
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'tests/SimpleTensor.h')
-rw-r--r-- | tests/SimpleTensor.h | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/tests/SimpleTensor.h b/tests/SimpleTensor.h index 902f5b51b5..f3155ffeab 100644 --- a/tests/SimpleTensor.h +++ b/tests/SimpleTensor.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -297,18 +297,33 @@ int SimpleTensor<T>::num_channels() const switch(_format) { case Format::U8: - case Format::S16: case Format::U16: - case Format::S32: + case Format::S16: case Format::U32: + case Format::S32: + case Format::F16: case Format::F32: return 1; + // Because the U and V channels are subsampled + // these formats appear like having only 2 channels: + case Format::YUYV422: + case Format::UYVY422: + return 2; + case Format::UV88: + return 2; case Format::RGB888: return 3; + case Format::RGBA8888: + return 4; case Format::UNKNOWN: return _num_channels; + //Doesn't make sense for planar formats: + case Format::NV12: + case Format::NV21: + case Format::IYUV: + case Format::YUV444: default: - ARM_COMPUTE_ERROR("NOT SUPPORTED!"); + return 0; } } |