Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 1 | /* |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 2 | * Copyright (c) 2017-2019 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); |
| 44 | |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 45 | // Input data sets |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame] | 46 | const auto RGBDataset = framework::dataset::make("FormatType", { Format::RGB888, Format::RGBA8888 }); |
| 47 | const auto YUYVDataset = framework::dataset::make("FormatType", { Format::YUYV422, Format::UYVY422 }); |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 48 | |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame] | 49 | const auto ColorConvert_RGBA_to_RGB = combine(framework::dataset::make("FormatType", { Format::RGBA8888 }), |
| 50 | framework::dataset::make("FormatType", { Format::RGB888 })); |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 51 | |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame] | 52 | const auto ColorConvert_RGB_to_RGBA = combine(framework::dataset::make("FormatType", { Format::RGB888 }), |
| 53 | framework::dataset::make("FormatType", { Format::RGBA8888 })); |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 54 | |
Manuel Bottini | acaf21d | 2018-09-26 17:38:19 +0100 | [diff] [blame] | 55 | const auto ColorConvert_RGB_to_U8 = combine(framework::dataset::make("FormatType", { Format::RGB888 }), |
| 56 | framework::dataset::make("FormatType", { Format::U8 })); |
| 57 | |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame] | 58 | const auto ColorConvert_YUYV_to_RGBDataset = combine(YUYVDataset, |
| 59 | RGBDataset); |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 60 | |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame] | 61 | const auto ColorConvert_YUVPlanar_to_RGBDataset = combine(framework::dataset::make("FormatType", { Format::IYUV, Format::NV12, Format::NV21 }), |
| 62 | RGBDataset); |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 63 | |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame] | 64 | const auto ColorConvert_RGBDataset_to_NVDataset = combine(RGBDataset, |
| 65 | framework::dataset::make("FormatType", { Format::NV12, Format::IYUV, Format::YUV444 })); |
| 66 | |
| 67 | const auto ColorConvert_YUYVDataset_to_NVDataset = combine(YUYVDataset, |
| 68 | framework::dataset::make("FormatType", { Format::NV12, Format::IYUV })); |
| 69 | |
| 70 | const auto ColorConvert_NVDataset_to_YUVDataset = combine(framework::dataset::make("FormatType", { Format::NV12, Format::NV21 }), |
| 71 | framework::dataset::make("FormatType", { Format::IYUV, Format::YUV444 })); |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 72 | |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 73 | inline void validate_configuration(const TensorShape &shape, Format src_format, Format dst_format) |
| 74 | { |
| 75 | const unsigned int src_num_planes = num_planes_from_format(src_format); |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 76 | const unsigned int dst_num_planes = num_planes_from_format(dst_format); |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 77 | |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 78 | TensorShape input = adjust_odd_shape(shape, src_format); |
| 79 | input = adjust_odd_shape(input, src_format); |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 80 | |
| 81 | // Create tensors |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 82 | CLMultiImage ref_src = create_multi_image<CLMultiImage>(input, src_format); |
| 83 | CLMultiImage ref_dst = create_multi_image<CLMultiImage>(input, dst_format); |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 84 | |
| 85 | // Create and Configure function |
| 86 | CLColorConvert color_convert; |
| 87 | |
| 88 | if(1U == src_num_planes) |
| 89 | { |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 90 | const CLTensor *src_plane = ref_src.cl_plane(0); |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 91 | |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 92 | if(1U == dst_num_planes) |
| 93 | { |
| 94 | CLTensor *dst_plane = ref_dst.cl_plane(0); |
| 95 | color_convert.configure(src_plane, dst_plane); |
| 96 | } |
| 97 | else |
| 98 | { |
| 99 | color_convert.configure(src_plane, &ref_dst); |
| 100 | } |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 101 | } |
| 102 | else |
| 103 | { |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 104 | if(1U == dst_num_planes) |
| 105 | { |
| 106 | CLTensor *dst_plane = ref_dst.cl_plane(0); |
| 107 | color_convert.configure(&ref_src, dst_plane); |
| 108 | } |
| 109 | else |
| 110 | { |
| 111 | color_convert.configure(&ref_src, &ref_dst); |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | for(unsigned int plane_idx = 0; plane_idx < src_num_planes; ++plane_idx) |
| 116 | { |
| 117 | const CLTensor *src_plane = ref_src.cl_plane(plane_idx); |
| 118 | |
| 119 | ARM_COMPUTE_EXPECT(src_plane->info()->is_resizable(), framework::LogLevel::ERRORS); |
| 120 | } |
| 121 | for(unsigned int plane_idx = 0; plane_idx < dst_num_planes; ++plane_idx) |
| 122 | { |
| 123 | const CLTensor *dst_plane = ref_dst.cl_plane(plane_idx); |
| 124 | |
| 125 | ARM_COMPUTE_EXPECT(dst_plane->info()->is_resizable(), framework::LogLevel::ERRORS); |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 126 | } |
| 127 | } |
| 128 | } // namespace |
| 129 | |
| 130 | TEST_SUITE(CL) |
| 131 | TEST_SUITE(ColorConvert) |
| 132 | |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 133 | template <typename T> |
| 134 | using CLColorConvertFixture = ColorConvertValidationFixture<CLMultiImage, CLTensor, CLAccessor, CLColorConvert, T>; |
| 135 | |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 136 | TEST_SUITE(Configuration) |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 137 | 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] | 138 | shape, src_format, dst_format) |
| 139 | { |
| 140 | validate_configuration(shape, src_format, dst_format); |
| 141 | } |
| 142 | |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 143 | 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] | 144 | shape, src_format, dst_format) |
| 145 | { |
| 146 | validate_configuration(shape, src_format, dst_format); |
| 147 | } |
| 148 | |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 149 | 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] | 150 | shape, src_format, dst_format) |
| 151 | { |
| 152 | validate_configuration(shape, src_format, dst_format); |
| 153 | } |
| 154 | |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 155 | 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] | 156 | shape, src_format, dst_format) |
| 157 | { |
| 158 | validate_configuration(shape, src_format, dst_format); |
| 159 | } |
| 160 | |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 161 | 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] | 162 | shape, src_format, dst_format) |
| 163 | { |
| 164 | validate_configuration(shape, src_format, dst_format); |
| 165 | } |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 166 | |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 167 | 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] | 168 | shape, src_format, dst_format) |
| 169 | { |
| 170 | validate_configuration(shape, src_format, dst_format); |
| 171 | } |
| 172 | |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 173 | 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] | 174 | shape, src_format, dst_format) |
| 175 | { |
| 176 | validate_configuration(shape, src_format, dst_format); |
| 177 | } |
| 178 | |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 179 | 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] | 180 | shape, src_format, dst_format) |
| 181 | { |
| 182 | validate_configuration(shape, src_format, dst_format); |
| 183 | } |
| 184 | TEST_SUITE_END() |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 185 | |
| 186 | TEST_SUITE(RGBA) |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame] | 187 | 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] | 188 | { |
| 189 | // Validate output |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 190 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 191 | { |
| 192 | validate(CLAccessor(*_target.cl_plane(plane_idx)), _reference[plane_idx]); |
| 193 | } |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 194 | } |
| 195 | |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame] | 196 | 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] | 197 | { |
| 198 | // Validate output |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 199 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 200 | { |
| 201 | validate(CLAccessor(*_target.cl_plane(plane_idx)), _reference[plane_idx]); |
| 202 | } |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 203 | } |
| 204 | TEST_SUITE_END() |
| 205 | |
| 206 | TEST_SUITE(RGB) |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame] | 207 | 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] | 208 | { |
| 209 | // Validate output |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 210 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 211 | { |
| 212 | validate(CLAccessor(*_target.cl_plane(plane_idx)), _reference[plane_idx]); |
| 213 | } |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 214 | } |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame] | 215 | FIXTURE_DATA_TEST_CASE(RunLarge, CLColorConvertFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(), ColorConvert_RGB_to_RGBA)) |
| 216 | { |
| 217 | // Validate output |
| 218 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 219 | { |
| 220 | validate(CLAccessor(*_target.cl_plane(plane_idx)), _reference[plane_idx]); |
| 221 | } |
| 222 | } |
| 223 | TEST_SUITE_END() |
| 224 | |
Manuel Bottini | acaf21d | 2018-09-26 17:38:19 +0100 | [diff] [blame] | 225 | TEST_SUITE(RGBtoU8) |
| 226 | FIXTURE_DATA_TEST_CASE(RunSmall, CLColorConvertFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), ColorConvert_RGB_to_U8)) |
| 227 | { |
| 228 | // Validate output |
| 229 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 230 | { |
| 231 | validate(CLAccessor(*_target.cl_plane(plane_idx)), _reference[plane_idx]); |
| 232 | } |
| 233 | } |
| 234 | FIXTURE_DATA_TEST_CASE(RunLarge, CLColorConvertFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(), ColorConvert_RGB_to_U8)) |
| 235 | { |
| 236 | // Validate output |
| 237 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 238 | { |
| 239 | validate(CLAccessor(*_target.cl_plane(plane_idx)), _reference[plane_idx]); |
| 240 | } |
| 241 | } |
| 242 | TEST_SUITE_END() |
| 243 | |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame] | 244 | TEST_SUITE(YUV) |
| 245 | FIXTURE_DATA_TEST_CASE(RunSmall, CLColorConvertFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), ColorConvert_YUYV_to_RGBDataset)) |
| 246 | { |
| 247 | // Validate output |
| 248 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 249 | { |
| 250 | validate(CLAccessor(*_target.cl_plane(plane_idx)), _reference[plane_idx]); |
| 251 | } |
| 252 | } |
| 253 | FIXTURE_DATA_TEST_CASE(RunLarge, CLColorConvertFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(), ColorConvert_YUYV_to_RGBDataset)) |
| 254 | { |
| 255 | // Validate output |
| 256 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 257 | { |
| 258 | validate(CLAccessor(*_target.cl_plane(plane_idx)), _reference[plane_idx]); |
| 259 | } |
| 260 | } |
| 261 | TEST_SUITE_END() |
| 262 | |
| 263 | TEST_SUITE(YUVPlanar) |
| 264 | FIXTURE_DATA_TEST_CASE(RunSmall, CLColorConvertFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), ColorConvert_YUVPlanar_to_RGBDataset)) |
| 265 | { |
| 266 | // Validate output |
| 267 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 268 | { |
| 269 | validate(CLAccessor(*_target.cl_plane(plane_idx)), _reference[plane_idx]); |
| 270 | } |
| 271 | } |
| 272 | 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] | 273 | { |
| 274 | // Validate output |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 275 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 276 | { |
| 277 | validate(CLAccessor(*_target.cl_plane(plane_idx)), _reference[plane_idx]); |
| 278 | } |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 279 | } |
| 280 | TEST_SUITE_END() |
Sanghoon Lee | dec32a9 | 2018-06-29 10:52:57 +0100 | [diff] [blame] | 281 | |
| 282 | TEST_SUITE(NV) |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame] | 283 | 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] | 284 | { |
| 285 | // Validate output |
| 286 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 287 | { |
| 288 | validate(CLAccessor(*_target.cl_plane(plane_idx)), _reference[plane_idx], tolerance_nv); |
| 289 | } |
| 290 | } |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame] | 291 | 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] | 292 | { |
| 293 | // Validate output |
| 294 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 295 | { |
| 296 | validate(CLAccessor(*_target.cl_plane(plane_idx)), _reference[plane_idx], tolerance_nv); |
| 297 | } |
| 298 | } |
| 299 | TEST_SUITE_END() |
| 300 | |
| 301 | TEST_SUITE(YUYVtoNV) |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame] | 302 | 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] | 303 | { |
| 304 | // Validate output |
| 305 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 306 | { |
| 307 | validate(CLAccessor(*_target.cl_plane(plane_idx)), _reference[plane_idx]); |
| 308 | } |
| 309 | } |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame] | 310 | 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] | 311 | { |
| 312 | // Validate output |
| 313 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 314 | { |
| 315 | validate(CLAccessor(*_target.cl_plane(plane_idx)), _reference[plane_idx]); |
| 316 | } |
| 317 | } |
| 318 | |
| 319 | TEST_SUITE_END() |
| 320 | |
| 321 | TEST_SUITE(NVtoYUV) |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame] | 322 | 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] | 323 | { |
| 324 | // Validate output |
| 325 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 326 | { |
| 327 | validate(CLAccessor(*_target.cl_plane(plane_idx)), _reference[plane_idx]); |
| 328 | } |
| 329 | } |
Sanghoon Lee | c7b82f1 | 2018-07-06 13:27:27 +0100 | [diff] [blame] | 330 | 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] | 331 | { |
| 332 | // Validate output |
| 333 | for(unsigned int plane_idx = 0; plane_idx < _dst_num_planes; ++plane_idx) |
| 334 | { |
| 335 | validate(CLAccessor(*_target.cl_plane(plane_idx)), _reference[plane_idx]); |
| 336 | } |
| 337 | } |
| 338 | |
| 339 | TEST_SUITE_END() |
| 340 | |
Sanghoon Lee | 1fad27a | 2018-04-05 10:57:57 +0100 | [diff] [blame] | 341 | TEST_SUITE_END() |
| 342 | TEST_SUITE_END() |
| 343 | } // namespace validation |
| 344 | } // namespace test |
| 345 | } // namespace arm_compute |