From 1fbb8120aa4f5ea2e73393421611ffea803a05b4 Mon Sep 17 00:00:00 2001 From: Anthony Barbier Date: Mon, 19 Feb 2018 19:36:02 +0000 Subject: Revert "COMPMID-582: Add validation to channel_extract kernels." This reverts commit 9a0875951d43dda035f32d2e0728cf59d80cb4d3. Change-Id: I6af0bc64c656f91cf1e0357f8760defa08f2e78d Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/121190 Reviewed-by: Anthony Barbier Tested-by: Anthony Barbier --- tests/validation/CL/ChannelExtract.cpp | 153 ----------------- tests/validation/NEON/ChannelExtract.cpp | 153 ----------------- tests/validation/fixtures/ChannelExtractFixture.h | 192 ---------------------- tests/validation/reference/ChannelExtract.cpp | 76 --------- tests/validation/reference/ChannelExtract.h | 43 ----- 5 files changed, 617 deletions(-) delete mode 100644 tests/validation/CL/ChannelExtract.cpp delete mode 100644 tests/validation/NEON/ChannelExtract.cpp delete mode 100644 tests/validation/fixtures/ChannelExtractFixture.h delete mode 100644 tests/validation/reference/ChannelExtract.cpp delete mode 100644 tests/validation/reference/ChannelExtract.h (limited to 'tests/validation') diff --git a/tests/validation/CL/ChannelExtract.cpp b/tests/validation/CL/ChannelExtract.cpp deleted file mode 100644 index 1248a2072d..0000000000 --- a/tests/validation/CL/ChannelExtract.cpp +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright (c) 2017-2018 ARM Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#include "arm_compute/core/Types.h" -#include "arm_compute/runtime/CL/CLMultiImage.h" -#include "arm_compute/runtime/CL/CLTensor.h" -#include "arm_compute/runtime/CL/CLTensorAllocator.h" -#include "arm_compute/runtime/CL/functions/CLChannelExtract.h" -#include "tests/CL/CLAccessor.h" -#include "tests/PaddingCalculator.h" -#include "tests/datasets/ConvertPolicyDataset.h" -#include "tests/datasets/ShapeDatasets.h" -#include "tests/framework/Asserts.h" -#include "tests/framework/Macros.h" -#include "tests/framework/datasets/Datasets.h" -#include "tests/validation/Validation.h" -#include "tests/validation/fixtures/ChannelExtractFixture.h" - -namespace arm_compute -{ -namespace test -{ -namespace validation -{ -namespace -{ -// Input data sets -const auto ChannelExtractRGBADataset = combine(framework::dataset::make("FormatType", { Format::RGBA8888 }), - framework::dataset::make("ChannelType", { Channel::R, Channel::G, Channel::B, Channel::A })); -const auto ChannelExtractYUVDataset = combine(framework::dataset::make("FormatType", { Format::YUYV422, Format::UYVY422 }), - framework::dataset::make("ChannelType", { Channel::Y, Channel::U, Channel::V })); -const auto ChannelExtractYUVPlanarDataset = combine(framework::dataset::make("FormatType", { Format::IYUV, Format::YUV444, Format::NV12, Format::NV21 }), - framework::dataset::make("ChannelType", { Channel::Y, Channel::U, Channel::V })); - -inline void validate_configuration(const TensorShape &shape, Format format, Channel channel) -{ - const unsigned int num_planes = num_planes_from_format(format); - - TensorShape dst_shape = adjust_odd_shape(shape, format); - dst_shape = calculate_subsampled_shape(dst_shape, format, channel); - - // Create tensors - CLMultiImage ref_src = create_multi_image(shape, format); - CLTensor dst = create_tensor(dst_shape, Format::U8); - - // Create and Configure function - CLChannelExtract channel_extract; - - if(1U == num_planes) - { - const CLTensor *plane_src = ref_src.cl_plane(0); - - channel_extract.configure(plane_src, channel, &dst); - } - else - { - channel_extract.configure(&ref_src, channel, &dst); - } - - // TODO(bsgcomp): Add validation for padding and shape (COMPMID-659) -} -} // namespace - -TEST_SUITE(CL) -TEST_SUITE(ChannelExtract) - -template -using CLChannelExtractFixture = ChannelExtractValidationFixture; - -TEST_SUITE(Configuration) -DATA_TEST_CASE(RGBA, framework::DatasetMode::ALL, combine(concat(datasets::Small2DShapes(), datasets::Large2DShapes()), ChannelExtractRGBADataset), - shape, format, channel) -{ - validate_configuration(shape, format, channel); -} -DATA_TEST_CASE(YUV, framework::DatasetMode::ALL, combine(concat(datasets::Small2DShapes(), datasets::Large2DShapes()), ChannelExtractYUVDataset), - shape, format, channel) -{ - validate_configuration(shape, format, channel); -} - -DATA_TEST_CASE(YUVPlanar, framework::DatasetMode::ALL, combine(concat(datasets::Small2DShapes(), datasets::Large2DShapes()), ChannelExtractYUVPlanarDataset), - shape, format, channel) -{ - validate_configuration(shape, format, channel); -} -TEST_SUITE_END() - -TEST_SUITE(RGBA) -FIXTURE_DATA_TEST_CASE(RunSmall, CLChannelExtractFixture, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), ChannelExtractRGBADataset)) -{ - // Validate output - validate(CLAccessor(_target), _reference); -} -FIXTURE_DATA_TEST_CASE(RunLarge, CLChannelExtractFixture, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(), ChannelExtractRGBADataset)) -{ - // Validate output - validate(CLAccessor(_target), _reference); -} -TEST_SUITE_END() - -TEST_SUITE(YUV) -FIXTURE_DATA_TEST_CASE(RunSmall, CLChannelExtractFixture, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), ChannelExtractYUVDataset)) -{ - // Validate output - validate(CLAccessor(_target), _reference); -} -FIXTURE_DATA_TEST_CASE(RunLarge, CLChannelExtractFixture, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(), ChannelExtractYUVDataset)) -{ - // Validate output - validate(CLAccessor(_target), _reference); -} -TEST_SUITE_END() - -TEST_SUITE(YUVPlanar) -FIXTURE_DATA_TEST_CASE(RunSmall, CLChannelExtractFixture, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), ChannelExtractYUVPlanarDataset)) -{ - // Validate output - validate(CLAccessor(_target), _reference); -} -FIXTURE_DATA_TEST_CASE(RunLarge, CLChannelExtractFixture, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(), ChannelExtractYUVPlanarDataset)) -{ - // Validate output - validate(CLAccessor(_target), _reference); -} -TEST_SUITE_END() - -TEST_SUITE_END() -TEST_SUITE_END() - -} // namespace validation -} // namespace test -} // namespace arm_compute diff --git a/tests/validation/NEON/ChannelExtract.cpp b/tests/validation/NEON/ChannelExtract.cpp deleted file mode 100644 index 4d8599a21d..0000000000 --- a/tests/validation/NEON/ChannelExtract.cpp +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright (c) 2017-2018 ARM Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#include "arm_compute/core/Types.h" -#include "arm_compute/runtime/MultiImage.h" -#include "arm_compute/runtime/NEON/functions/NEChannelExtract.h" -#include "arm_compute/runtime/Tensor.h" -#include "arm_compute/runtime/TensorAllocator.h" -#include "tests/NEON/Accessor.h" -#include "tests/PaddingCalculator.h" -#include "tests/datasets/ConvertPolicyDataset.h" -#include "tests/datasets/ShapeDatasets.h" -#include "tests/framework/Asserts.h" -#include "tests/framework/Macros.h" -#include "tests/framework/datasets/Datasets.h" -#include "tests/validation/Validation.h" -#include "tests/validation/fixtures/ChannelExtractFixture.h" - -namespace arm_compute -{ -namespace test -{ -namespace validation -{ -namespace -{ -// Input data sets -const auto ChannelExtractRGBADataset = combine(framework::dataset::make("FormatType", { Format::RGBA8888 }), - framework::dataset::make("ChannelType", { Channel::R, Channel::G, Channel::B, Channel::A })); -const auto ChannelExtractYUVDataset = combine(framework::dataset::make("FormatType", { Format::YUYV422, Format::UYVY422 }), - framework::dataset::make("ChannelType", { Channel::Y, Channel::U, Channel::V })); -const auto ChannelExtractYUVPlanarDataset = combine(framework::dataset::make("FormatType", { Format::IYUV, Format::YUV444, Format::NV12, Format::NV21 }), - framework::dataset::make("ChannelType", { Channel::Y, Channel::U, Channel::V })); - -inline void validate_configuration(const TensorShape &shape, Format format, Channel channel) -{ - const unsigned int num_planes = num_planes_from_format(format); - - TensorShape dst_shape = adjust_odd_shape(shape, format); - dst_shape = calculate_subsampled_shape(dst_shape, format, channel); - - // Create tensors - MultiImage ref_src = create_multi_image(shape, format); - Tensor dst = create_tensor(dst_shape, Format::U8); - - // Create and Configure function - NEChannelExtract channel_extract; - - if(1U == num_planes) - { - const Tensor *plane_src = ref_src.plane(0); - - channel_extract.configure(plane_src, channel, &dst); - } - else - { - channel_extract.configure(&ref_src, channel, &dst); - } - - // TODO(bsgcomp): Add validation for padding and shape (COMPMID-659) -} -} // namespace - -TEST_SUITE(NEON) -TEST_SUITE(ChannelExtract) - -template -using NEChannelExtractFixture = ChannelExtractValidationFixture; - -TEST_SUITE(Configuration) -DATA_TEST_CASE(RGBA, framework::DatasetMode::ALL, combine(concat(datasets::Small2DShapes(), datasets::Large2DShapes()), ChannelExtractRGBADataset), - shape, format, channel) -{ - validate_configuration(shape, format, channel); -} -DATA_TEST_CASE(YUV, framework::DatasetMode::ALL, combine(concat(datasets::Small2DShapes(), datasets::Large2DShapes()), ChannelExtractYUVDataset), - shape, format, channel) -{ - validate_configuration(shape, format, channel); -} - -DATA_TEST_CASE(YUVPlanar, framework::DatasetMode::ALL, combine(concat(datasets::Small2DShapes(), datasets::Large2DShapes()), ChannelExtractYUVPlanarDataset), - shape, format, channel) -{ - validate_configuration(shape, format, channel); -} -TEST_SUITE_END() - -TEST_SUITE(RGBA) -FIXTURE_DATA_TEST_CASE(RunSmall, NEChannelExtractFixture, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), ChannelExtractRGBADataset)) -{ - // Validate output - validate(Accessor(_target), _reference); -} -FIXTURE_DATA_TEST_CASE(RunLarge, NEChannelExtractFixture, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(), ChannelExtractRGBADataset)) -{ - // Validate output - validate(Accessor(_target), _reference); -} -TEST_SUITE_END() - -TEST_SUITE(YUV) -FIXTURE_DATA_TEST_CASE(RunSmall, NEChannelExtractFixture, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), ChannelExtractYUVDataset)) -{ - // Validate output - validate(Accessor(_target), _reference); -} -FIXTURE_DATA_TEST_CASE(RunLarge, NEChannelExtractFixture, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(), ChannelExtractYUVDataset)) -{ - // Validate output - validate(Accessor(_target), _reference); -} -TEST_SUITE_END() - -TEST_SUITE(YUVPlanar) -FIXTURE_DATA_TEST_CASE(RunSmall, NEChannelExtractFixture, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), ChannelExtractYUVPlanarDataset)) -{ - // Validate output - validate(Accessor(_target), _reference); -} -FIXTURE_DATA_TEST_CASE(RunLarge, NEChannelExtractFixture, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(), ChannelExtractYUVPlanarDataset)) -{ - // Validate output - validate(Accessor(_target), _reference); -} -TEST_SUITE_END() - -TEST_SUITE_END() -TEST_SUITE_END() - -} // namespace validation -} // namespace test -} // namespace arm_compute diff --git a/tests/validation/fixtures/ChannelExtractFixture.h b/tests/validation/fixtures/ChannelExtractFixture.h deleted file mode 100644 index c3c2e17d09..0000000000 --- a/tests/validation/fixtures/ChannelExtractFixture.h +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Copyright (c) 2017-2018 ARM Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef ARM_COMPUTE_TEST_CHANNEL_EXTRACT_FIXTURE -#define ARM_COMPUTE_TEST_CHANNEL_EXTRACT_FIXTURE - -#include "arm_compute/core/TensorShape.h" -#include "arm_compute/core/Types.h" -#include "tests/AssetsLibrary.h" -#include "tests/Globals.h" -#include "tests/IAccessor.h" -#include "tests/framework/Asserts.h" -#include "tests/framework/Fixture.h" -#include "tests/validation/Helpers.h" -#include "tests/validation/reference/ChannelExtract.h" - -namespace arm_compute -{ -namespace test -{ -namespace validation -{ -template -class ChannelExtractValidationFixture : public framework::Fixture -{ -public: - template - void setup(TensorShape shape, Format format, Channel channel) - { - shape = adjust_odd_shape(shape, format); - - _target = compute_target(shape, format, channel); - _reference = compute_reference(shape, format, channel); - } - -protected: - template - void fill(U &&tensor, int i) - { - library->fill_tensor_uniform(tensor, i); - } - - std::vector> create_tensor_planes_reference(const TensorShape &shape, Format format) - { - TensorShape input = adjust_odd_shape(shape, format); - - std::vector> tensor_planes; - - switch(format) - { - case Format::RGB888: - case Format::RGBA8888: - case Format::YUYV422: - case Format::UYVY422: - { - tensor_planes.emplace_back(input, format); - break; - } - case Format::NV12: - case Format::NV21: - { - const TensorShape shape_uv88 = calculate_subsampled_shape(shape, Format::UV88); - - tensor_planes.emplace_back(input, Format::U8); - tensor_planes.emplace_back(shape_uv88, Format::UV88); - break; - } - case Format::IYUV: - { - const TensorShape shape_sub2 = calculate_subsampled_shape(shape, Format::IYUV); - - tensor_planes.emplace_back(input, Format::U8); - tensor_planes.emplace_back(shape_sub2, Format::U8); - tensor_planes.emplace_back(shape_sub2, Format::U8); - break; - } - case Format::YUV444: - tensor_planes.emplace_back(input, Format::U8); - tensor_planes.emplace_back(input, Format::U8); - tensor_planes.emplace_back(input, Format::U8); - break; - default: - ARM_COMPUTE_ERROR("Not supported"); - break; - } - - return tensor_planes; - } - - TensorType compute_target(const TensorShape &shape, Format format, Channel channel) - { - const unsigned int num_planes = num_planes_from_format(format); - - TensorShape dst_shape = calculate_subsampled_shape(shape, format, channel); - - // Create tensors - MultiImageType ref_src = create_multi_image(shape, format); - TensorType dst = create_tensor(dst_shape, Format::U8); - - // Create and configure function - FunctionType channel_extract; - - if(1U == num_planes) - { - const TensorType *plane_src = static_cast(ref_src.plane(0)); - - channel_extract.configure(plane_src, channel, &dst); - } - else - { - channel_extract.configure(&ref_src, channel, &dst); - } - - for(unsigned int plane_idx = 0; plane_idx < num_planes; ++plane_idx) - { - const TensorType *src_plane = static_cast(ref_src.plane(plane_idx)); - - ARM_COMPUTE_EXPECT(src_plane->info()->is_resizable(), framework::LogLevel::ERRORS); - } - - ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS); - - // Allocate tensors - ref_src.allocate(); - dst.allocator()->allocate(); - - for(unsigned int plane_idx = 0; plane_idx < num_planes; ++plane_idx) - { - const TensorType *src_plane = static_cast(ref_src.plane(plane_idx)); - - ARM_COMPUTE_EXPECT(!src_plane->info()->is_resizable(), framework::LogLevel::ERRORS); - } - - ARM_COMPUTE_EXPECT(!dst.info()->is_resizable(), framework::LogLevel::ERRORS); - - // Fill tensor planes - for(unsigned int plane_idx = 0; plane_idx < num_planes; ++plane_idx) - { - TensorType *src_plane = static_cast(ref_src.plane(plane_idx)); - - fill(AccessorType(*src_plane), plane_idx); - } - - // Compute function - channel_extract.run(); - - return dst; - } - - SimpleTensor compute_reference(const TensorShape &shape, Format format, Channel channel) - { - const unsigned int num_planes = num_planes_from_format(format); - - // Create reference - std::vector> ref_src = create_tensor_planes_reference(shape, format); - - // Fill references - for(unsigned int plane_idx = 0; plane_idx < num_planes; ++plane_idx) - { - fill(ref_src[plane_idx], plane_idx); - } - - return reference::channel_extract(shape, ref_src, format, channel); - } - - TensorType _target{}; - SimpleTensor _reference{}; -}; -} // namespace validation -} // namespace test -} // namespace arm_compute -#endif /* ARM_COMPUTE_TEST_CHANNEL_EXTRACT_FIXTURE */ diff --git a/tests/validation/reference/ChannelExtract.cpp b/tests/validation/reference/ChannelExtract.cpp deleted file mode 100644 index 595bb13098..0000000000 --- a/tests/validation/reference/ChannelExtract.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2017-2018 ARM Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#include "ChannelExtract.h" - -#include "arm_compute/core/Types.h" -#include "tests/validation/FixedPoint.h" -#include "tests/validation/Helpers.h" - -namespace arm_compute -{ -namespace test -{ -namespace validation -{ -namespace reference -{ -template -SimpleTensor channel_extract(const TensorShape &shape, const std::vector> &tensor_planes, Format format, Channel channel) -{ - // Find plane and channel index - const unsigned int plane_idx = plane_idx_from_channel(format, channel); - const unsigned int channel_idx = channel_idx_from_format(format, channel); - - // Create dst and get src tensor - SimpleTensor src = tensor_planes[plane_idx]; - SimpleTensor dst{ calculate_subsampled_shape(shape, format, channel), Format::U8 }; - - // Single planar formats with subsampling require a double horizontal step - const int step_x = ((Format::YUYV422 == format || Format::UYVY422 == format) && Channel::Y != channel) ? 2 : 1; - const int width = dst.shape().x(); - const int height = dst.shape().y(); - - // Loop over each pixel and extract channel - for(int y = 0; y < height; ++y) - { - for(int x = 0; x < width; ++x) - { - const Coordinates src_coord{ x * step_x, y }; - const Coordinates dst_coord{ x, y }; - - const auto *src_pixel = reinterpret_cast(src(src_coord)); - auto *dst_pixel = reinterpret_cast(dst(dst_coord)); - - dst_pixel[0] = src_pixel[channel_idx]; - } - } - - return dst; -} - -template SimpleTensor channel_extract(const TensorShape &shape, const std::vector> &tensor_planes, Format format, Channel channel); -} // namespace reference -} // namespace validation -} // namespace test -} // namespace arm_compute diff --git a/tests/validation/reference/ChannelExtract.h b/tests/validation/reference/ChannelExtract.h deleted file mode 100644 index ac7aefbdee..0000000000 --- a/tests/validation/reference/ChannelExtract.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2017-2018 ARM Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef __ARM_COMPUTE_TEST_CHANNEL_EXTRACT_H__ -#define __ARM_COMPUTE_TEST_CHANNEL_EXTRACT_H__ - -#include "tests/SimpleTensor.h" - -namespace arm_compute -{ -namespace test -{ -namespace validation -{ -namespace reference -{ -template -SimpleTensor channel_extract(const TensorShape &shape, const std::vector> &tensor_planes, Format format, Channel channel); -} // namespace reference -} // namespace validation -} // namespace test -} // namespace arm_compute -#endif /* __ARM_COMPUTE_TEST_CHANNEL_EXTRACT_H__ */ -- cgit v1.2.1