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 | 9414f64c231a013664102e2c284b10266c6b4d4e (patch) | |
tree | 5a5ad6a525004634fe6b78cdfc8da71aae762d33 /tests/SimpleTensor.h | |
parent | 6acc6add8412c6d3841a49684610fc5a6526312e (diff) | |
download | ComputeLibrary-9414f64c231a013664102e2c284b10266c6b4d4e.tar.gz |
COMPMID-582: Add validation to channel_extract kernels.
Change-Id: I5022d02f06f9d849dad76e3d9b8e48632c236429
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/121191
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Tested-by: Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'tests/SimpleTensor.h')
-rw-r--r-- | tests/SimpleTensor.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/tests/SimpleTensor.h b/tests/SimpleTensor.h index 3dbb4862f8..f3155ffeab 100644 --- a/tests/SimpleTensor.h +++ b/tests/SimpleTensor.h @@ -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; } } |