Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 1 | /* |
Michele Di Giorgio | ca0ffa6 | 2020-02-17 16:21:48 +0000 | [diff] [blame] | 2 | * Copyright (c) 2017-2020 ARM Limited. |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: MIT |
| 5 | * |
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | * of this software and associated documentation files (the "Software"), to |
| 8 | * deal in the Software without restriction, including without limitation the |
| 9 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 10 | * sell copies of the Software, and to permit persons to whom the Software is |
| 11 | * furnished to do so, subject to the following conditions: |
| 12 | * |
| 13 | * The above copyright notice and this permission notice shall be included in all |
| 14 | * copies or substantial portions of the Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 22 | * SOFTWARE. |
| 23 | */ |
| 24 | #include "arm_compute/runtime/CL/CLMultiImage.h" |
| 25 | #include "arm_compute/runtime/CL/CLTensor.h" |
| 26 | #include "arm_compute/runtime/CL/CLTensorAllocator.h" |
| 27 | #include "arm_compute/runtime/CL/functions/CLColorConvert.h" |
| 28 | #include "tests/CL/CLAccessor.h" |
| 29 | #include "tests/datasets/ShapeDatasets.h" |
| 30 | #include "tests/framework/Asserts.h" |
| 31 | #include "tests/framework/Macros.h" |
| 32 | #include "tests/validation/Validation.h" |
| 33 | #include "tests/validation/fixtures/ColorConvertFixture.h" |
| 34 | |
| 35 | namespace arm_compute |
| 36 | { |
| 37 | namespace test |
| 38 | { |
| 39 | namespace validation |
| 40 | { |
| 41 | namespace |
| 42 | { |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 43 | constexpr AbsoluteTolerance<uint8_t> tolerance_nv(2); |
Michele Di Giorgio | ca0ffa6 | 2020-02-17 16:21:48 +0000 | [diff] [blame] | 44 | constexpr AbsoluteTolerance<uint8_t> tolerance_u8(1); |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 45 | |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 46 | // Input data sets |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame] | 47 | const auto RGBDataset = framework::dataset::make("FormatType", { Format::RGB888, Format::RGBA8888 }); |
| 48 | const auto YUYVDataset = framework::dataset::make("FormatType", { Format::YUYV422, Format::UYVY422 }); |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 49 | |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame] | 50 | const auto ColorConvert_RGBA_to_RGB = combine(framework::dataset::make("FormatType", { Format::RGBA8888 }), |
| 51 | framework::dataset::make("FormatType", { Format::RGB888 })); |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 52 | |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame] | 53 | const auto ColorConvert_RGB_to_RGBA = combine(framework::dataset::make("FormatType", { Format::RGB888 }), |
| 54 | framework::dataset::make("FormatType", { Format::RGBA8888 })); |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 55 | |
Manuel Bottini | acaf21d | 2018-09-26 17:38:19 +0100 | [diff] [blame] | 56 | const auto ColorConvert_RGB_to_U8 = combine(framework::dataset::make("FormatType", { Format::RGB888 }), |
| 57 | framework::dataset::make("FormatType", { Format::U8 })); |
| 58 | |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame] | 59 | const auto ColorConvert_YUYV_to_RGBDataset = combine(YUYVDataset, |
| 60 | RGBDataset); |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 61 | |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame] | 62 | const auto ColorConvert_YUVPlanar_to_RGBDataset = combine(framework::dataset::make("FormatType", { Format::IYUV, Format::NV12, Format::NV21 }), |
| 63 | RGBDataset); |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 64 | |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame] | 65 | const auto ColorConvert_RGBDataset_to_NVDataset = combine(RGBDataset, |
| 66 | framework::dataset::make("FormatType", { Format::NV12, Format::IYUV, Format::YUV444 })); |
| 67 | |
| 68 | const auto ColorConvert_YUYVDataset_to_NVDataset = combine(YUYVDataset, |
| 69 | framework::dataset::make("FormatType", { Format::NV12, Format::IYUV })); |
| 70 | |
| 71 | const auto ColorConvert_NVDataset_to_YUVDataset = combine(framework::dataset::make("FormatType", { Format::NV12, Format::NV21 }), |
| 72 | framework::dataset::make("FormatType", { Format::IYUV, Format::YUV444 })); |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 73 | |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 74 | inline void validate_configuration(const TensorShape &shape, Format src_format, Format dst_format) |
| 75 | { |
| 76 | const unsigned int src_num_planes = num_planes_from_format(src_format); |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 77 | const unsigned int dst_num_planes = num_planes_from_format(dst_format); |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 78 | |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 79 | TensorShape input = adjust_odd_shape(shape, src_format); |
| 80 | input = adjust_odd_shape(input, src_format); |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 81 | |
| 82 | // Create tensors |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 83 | CLMultiImage ref_src = create_multi_image<CLMultiImage>(input, src_format); |
| 84 | CLMultiImage ref_dst = create_multi_image<CLMultiImage>(input, dst_format); |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 85 | |
| 86 | // Create and Configure function |
| 87 | CLColorConvert color_convert; |
| 88 | |
| 89 | if(1U == src_num_planes) |
| 90 | { |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 91 | const CLTensor *src_plane = ref_src.cl_plane(0); |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 92 | |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 93 | if(1U == dst_num_planes) |
| 94 | { |
| 95 | CLTensor *dst_plane = ref_dst.cl_plane(0); |
| 96 | color_convert.configure(src_plane, dst_plane); |
| 97 | } |
| 98 | else |
| 99 | { |
| 100 | color_convert.configure(src_plane, &ref_dst); |
| 101 | } |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 102 | } |
| 103 | else |
| 104 | { |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 105 | if(1U == dst_num_planes) |
| 106 | { |
| 107 | CLTensor *dst_plane = ref_dst.cl_plane(0); |
| 108 | color_convert.configure(&ref_src, dst_plane); |
| 109 | } |
| 110 | else |
| 111 | { |
| 112 | color_convert.configure(&ref_src, &ref_dst); |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | for(unsigned int plane_idx = 0; plane_idx < src_num_planes; ++plane_idx) |
| 117 | { |
| 118 | const CLTensor *src_plane = ref_src.cl_plane(plane_idx); |
| 119 | |
| 120 | ARM_COMPUTE_EXPECT(src_plane->info()->is_resizable(), framework::LogLevel::ERRORS); |
| 121 | } |
| 122 | for(unsigned int plane_idx = 0; plane_idx < dst_num_planes; ++plane_idx) |
| 123 | { |
| 124 | const CLTensor *dst_plane = ref_dst.cl_plane(plane_idx); |
| 125 | |
| 126 | ARM_COMPUTE_EXPECT(dst_plane->info()->is_resizable(), framework::LogLevel::ERRORS); |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 127 | } |
| 128 | } |
| 129 | } // namespace |
| 130 | |
| 131 | TEST_SUITE(CL) |
| 132 | TEST_SUITE(ColorConvert) |
| 133 | |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 134 | template <typename T> |
| 135 | using CLColorConvertFixture = ColorConvertValidationFixture<CLMultiImage, CLTensor, CLAccessor, CLColorConvert, T>; |
| 136 | |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 137 | TEST_SUITE(Configuration) |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 138 | DATA_TEST_CASE(RGBA, framework::DatasetMode::ALL, combine(datasets::Small2DShapes(), ColorConvert_RGBA_to_RGB), |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 139 | shape, src_format, dst_format) |
| 140 | { |
| 141 | validate_configuration(shape, src_format, dst_format); |
| 142 | } |
| 143 | |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 144 | DATA_TEST_CASE(RGB, framework::DatasetMode::ALL, combine(datasets::Small2DShapes(), ColorConvert_RGB_to_RGBA), |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 145 | shape, src_format, dst_format) |
| 146 | { |
| 147 | validate_configuration(shape, src_format, dst_format); |
| 148 | } |
| 149 | |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 150 | DATA_TEST_CASE(RGBtoU8, framework::DatasetMode::ALL, combine(datasets::Small2DShapes(), ColorConvert_RGB_to_U8), |
Manuel Bottini | acaf21d | 2018-09-26 17:38:19 +0100 | [diff] [blame] | 151 | shape, src_format, dst_format) |
| 152 | { |
| 153 | validate_configuration(shape, src_format, dst_format); |
| 154 | } |
| 155 | |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 156 | DATA_TEST_CASE(YUV, framework::DatasetMode::ALL, combine(datasets::Small2DShapes(), ColorConvert_YUYV_to_RGBDataset), |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 157 | shape, src_format, dst_format) |
| 158 | { |
| 159 | validate_configuration(shape, src_format, dst_format); |
| 160 | } |
| 161 | |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 162 | DATA_TEST_CASE(YUVPlanar, framework::DatasetMode::ALL, combine(datasets::Small2DShapes(), ColorConvert_YUVPlanar_to_RGBDataset), |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 163 | shape, src_format, dst_format) |
| 164 | { |
| 165 | validate_configuration(shape, src_format, dst_format); |
| 166 | } |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 167 | |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 168 | DATA_TEST_CASE(NV, framework::DatasetMode::ALL, combine(datasets::Small2DShapes(), ColorConvert_RGBDataset_to_NVDataset), |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 169 | shape, src_format, dst_format) |
| 170 | { |
| 171 | validate_configuration(shape, src_format, dst_format); |
| 172 | } |
| 173 | |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 174 | DATA_TEST_CASE(YUYVtoNV, framework::DatasetMode::ALL, combine(datasets::Small2DShapes(), ColorConvert_YUYVDataset_to_NVDataset), |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 175 | shape, src_format, dst_format) |
| 176 | { |
| 177 | validate_configuration(shape, src_format, dst_format); |
| 178 | } |
| 179 | |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 180 | DATA_TEST_CASE(NVtoYUV, framework::DatasetMode::ALL, combine(datasets::Small2DShapes(), ColorConvert_NVDataset_to_YUVDataset), |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 181 | shape, src_format, dst_format) |
| 182 | { |
| 183 | validate_configuration(shape, src_format, dst_format); |
| 184 | } |
| 185 | TEST_SUITE_END() |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 186 | |
| 187 | TEST_SUITE(RGBA) |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame] | 188 | FIXTURE_DATA_TEST_CASE(RunSmall, CLColorConvertFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), ColorConvert_RGBA_to_RGB)) |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 189 | { |
| 190 | // Validate output |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 191 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 192 | { |
| 193 | validate(CLAccessor(*_target.cl_plane(plane_idx)), _reference[plane_idx]); |
| 194 | } |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 195 | } |
| 196 | |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame] | 197 | FIXTURE_DATA_TEST_CASE(RunLarge, CLColorConvertFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(), ColorConvert_RGBA_to_RGB)) |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 198 | { |
| 199 | // Validate output |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 200 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 201 | { |
| 202 | validate(CLAccessor(*_target.cl_plane(plane_idx)), _reference[plane_idx]); |
| 203 | } |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 204 | } |
| 205 | TEST_SUITE_END() |
| 206 | |
| 207 | TEST_SUITE(RGB) |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame] | 208 | FIXTURE_DATA_TEST_CASE(RunSmall, CLColorConvertFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), ColorConvert_RGB_to_RGBA)) |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 209 | { |
| 210 | // Validate output |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 211 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 212 | { |
| 213 | validate(CLAccessor(*_target.cl_plane(plane_idx)), _reference[plane_idx]); |
| 214 | } |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 215 | } |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame] | 216 | FIXTURE_DATA_TEST_CASE(RunLarge, CLColorConvertFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(), ColorConvert_RGB_to_RGBA)) |
| 217 | { |
| 218 | // Validate output |
| 219 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 220 | { |
| 221 | validate(CLAccessor(*_target.cl_plane(plane_idx)), _reference[plane_idx]); |
| 222 | } |
| 223 | } |
| 224 | TEST_SUITE_END() |
| 225 | |
Manuel Bottini | acaf21d | 2018-09-26 17:38:19 +0100 | [diff] [blame] | 226 | TEST_SUITE(RGBtoU8) |
| 227 | FIXTURE_DATA_TEST_CASE(RunSmall, CLColorConvertFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), ColorConvert_RGB_to_U8)) |
| 228 | { |
| 229 | // Validate output |
| 230 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 231 | { |
Michele Di Giorgio | ca0ffa6 | 2020-02-17 16:21:48 +0000 | [diff] [blame] | 232 | validate(CLAccessor(*_target.cl_plane(plane_idx)), _reference[plane_idx], tolerance_u8); |
Manuel Bottini | acaf21d | 2018-09-26 17:38:19 +0100 | [diff] [blame] | 233 | } |
| 234 | } |
| 235 | FIXTURE_DATA_TEST_CASE(RunLarge, CLColorConvertFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(), ColorConvert_RGB_to_U8)) |
| 236 | { |
| 237 | // Validate output |
| 238 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 239 | { |
Michele Di Giorgio | ca0ffa6 | 2020-02-17 16:21:48 +0000 | [diff] [blame] | 240 | validate(CLAccessor(*_target.cl_plane(plane_idx)), _reference[plane_idx], tolerance_u8); |
Manuel Bottini | acaf21d | 2018-09-26 17:38:19 +0100 | [diff] [blame] | 241 | } |
| 242 | } |
| 243 | TEST_SUITE_END() |
| 244 | |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame] | 245 | TEST_SUITE(YUV) |
| 246 | FIXTURE_DATA_TEST_CASE(RunSmall, CLColorConvertFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), ColorConvert_YUYV_to_RGBDataset)) |
| 247 | { |
| 248 | // Validate output |
| 249 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 250 | { |
| 251 | validate(CLAccessor(*_target.cl_plane(plane_idx)), _reference[plane_idx]); |
| 252 | } |
| 253 | } |
| 254 | FIXTURE_DATA_TEST_CASE(RunLarge, CLColorConvertFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(), ColorConvert_YUYV_to_RGBDataset)) |
| 255 | { |
| 256 | // Validate output |
| 257 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 258 | { |
| 259 | validate(CLAccessor(*_target.cl_plane(plane_idx)), _reference[plane_idx]); |
| 260 | } |
| 261 | } |
| 262 | TEST_SUITE_END() |
| 263 | |
| 264 | TEST_SUITE(YUVPlanar) |
| 265 | FIXTURE_DATA_TEST_CASE(RunSmall, CLColorConvertFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), ColorConvert_YUVPlanar_to_RGBDataset)) |
| 266 | { |
| 267 | // Validate output |
| 268 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 269 | { |
| 270 | validate(CLAccessor(*_target.cl_plane(plane_idx)), _reference[plane_idx]); |
| 271 | } |
| 272 | } |
| 273 | FIXTURE_DATA_TEST_CASE(RunLarge, CLColorConvertFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(), ColorConvert_YUVPlanar_to_RGBDataset)) |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 274 | { |
| 275 | // Validate output |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 276 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 277 | { |
| 278 | validate(CLAccessor(*_target.cl_plane(plane_idx)), _reference[plane_idx]); |
| 279 | } |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 280 | } |
| 281 | TEST_SUITE_END() |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 282 | |
| 283 | TEST_SUITE(NV) |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame] | 284 | FIXTURE_DATA_TEST_CASE(RunSmall, CLColorConvertFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), ColorConvert_RGBDataset_to_NVDataset)) |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 285 | { |
| 286 | // Validate output |
| 287 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 288 | { |
| 289 | validate(CLAccessor(*_target.cl_plane(plane_idx)), _reference[plane_idx], tolerance_nv); |
| 290 | } |
| 291 | } |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame] | 292 | FIXTURE_DATA_TEST_CASE(RunLarge, CLColorConvertFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(), ColorConvert_RGBDataset_to_NVDataset)) |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 293 | { |
| 294 | // Validate output |
| 295 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 296 | { |
| 297 | validate(CLAccessor(*_target.cl_plane(plane_idx)), _reference[plane_idx], tolerance_nv); |
| 298 | } |
| 299 | } |
| 300 | TEST_SUITE_END() |
| 301 | |
| 302 | TEST_SUITE(YUYVtoNV) |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame] | 303 | FIXTURE_DATA_TEST_CASE(RunSmall, CLColorConvertFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), ColorConvert_YUYVDataset_to_NVDataset)) |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 304 | { |
| 305 | // Validate output |
| 306 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 307 | { |
| 308 | validate(CLAccessor(*_target.cl_plane(plane_idx)), _reference[plane_idx]); |
| 309 | } |
| 310 | } |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame] | 311 | FIXTURE_DATA_TEST_CASE(RunLarge, CLColorConvertFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(), ColorConvert_YUYVDataset_to_NVDataset)) |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 312 | { |
| 313 | // Validate output |
| 314 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 315 | { |
| 316 | validate(CLAccessor(*_target.cl_plane(plane_idx)), _reference[plane_idx]); |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | TEST_SUITE_END() |
| 321 | |
| 322 | TEST_SUITE(NVtoYUV) |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame] | 323 | FIXTURE_DATA_TEST_CASE(RunSmall, CLColorConvertFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), ColorConvert_NVDataset_to_YUVDataset)) |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 324 | { |
| 325 | // Validate output |
| 326 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 327 | { |
| 328 | validate(CLAccessor(*_target.cl_plane(plane_idx)), _reference[plane_idx]); |
| 329 | } |
| 330 | } |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame] | 331 | FIXTURE_DATA_TEST_CASE(RunLarge, CLColorConvertFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(), ColorConvert_NVDataset_to_YUVDataset)) |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 332 | { |
| 333 | // Validate output |
| 334 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 335 | { |
| 336 | validate(CLAccessor(*_target.cl_plane(plane_idx)), _reference[plane_idx]); |
| 337 | } |
| 338 | } |
| 339 | |
| 340 | TEST_SUITE_END() |
| 341 | |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 342 | TEST_SUITE_END() |
| 343 | TEST_SUITE_END() |
| 344 | } // namespace validation |
| 345 | } // namespace test |
| 346 | } // namespace arm_compute |