diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Utils.h | 61 | ||||
-rw-r--r-- | tests/datasets/ShapeDatasets.h | 16 | ||||
-rw-r--r-- | tests/validation/CPP/GaussianPyramidHalf.cpp | 66 | ||||
-rw-r--r-- | tests/validation/CPP/GaussianPyramidHalf.h | 43 | ||||
-rw-r--r-- | tests/validation/CPP/Scale.cpp | 21 | ||||
-rw-r--r-- | tests/validation/CPP/Scale.h | 2 | ||||
-rw-r--r-- | tests/validation/NEON/GaussianPyramid.cpp | 112 | ||||
-rw-r--r-- | tests/validation/fixtures/GaussianPyramidHalfFixture.h | 125 |
8 files changed, 437 insertions, 9 deletions
diff --git a/tests/Utils.h b/tests/Utils.h index 70def45ec7..df1d7a543a 100644 --- a/tests/Utils.h +++ b/tests/Utils.h @@ -216,6 +216,67 @@ inline ValidRegion shape_to_valid_region(TensorShape shape, bool border_undefine return ValidRegion(std::move(anchor), std::move(shape)); } +/** Create a valid region for Gaussian Pyramid Half based on tensor shape and valid region at level "i - 1" and border mode + * + * @note The border size is 2 in case of Gaussian Pyramid Half + * + * @param[in] shape Shape used at level "i - 1" of Gaussian Pyramid Half + * @param[in] valid_region Valid region used at level "i - 1" of Gaussian Pyramid Half + * @param[in] border_undefined (Optional) Boolean indicating if the border mode is undefined. + * + * return The valid region for the level "i" of Gaussian Pyramid Half + */ +inline ValidRegion shape_to_valid_region_gaussian_pyramid_half(TensorShape shape, ValidRegion valid_region, bool border_undefined = false) +{ + constexpr int border_size = 2; + Coordinates anchor; + anchor.set_num_dimensions(shape.num_dimensions()); + + // Compute tensor shape for level "i" of Gaussian Pyramid Half + // dst_width = (src_width + 1) * 0.5f + // dst_height = (src_height + 1) * 0.5f + TensorShape dst_shape = shape; + dst_shape.set(0, (shape[0] + 1) * 0.5f); + dst_shape.set(1, (shape[1] + 1) * 0.5f); + + if(border_undefined) + { + ARM_COMPUTE_ERROR_ON(shape.num_dimensions() < 2); + + // Compute the left and top invalid borders + float invalid_border_left = static_cast<float>(valid_region.anchor.x() + border_size) / 2.0f; + float invalid_border_top = static_cast<float>(valid_region.anchor.y() + border_size) / 2.0f; + + // For the new anchor point we can have 2 cases: + // 1) If the width/height of the tensor shape is odd, we have to take the ceil value of (valid_region.anchor.x() + border_size) / 2.0f or (valid_region.anchor.y() + border_size / 2.0f + // 2) If the width/height of the tensor shape is even, we have to take the floor value of (valid_region.anchor.x() + border_size) / 2.0f or (valid_region.anchor.y() + border_size) / 2.0f + // In this manner we should be able to propagate correctly the valid region along all levels of the pyramid + invalid_border_left = (shape[0] % 2) ? std::ceil(invalid_border_left) : std::floor(invalid_border_left); + invalid_border_top = (shape[1] % 2) ? std::ceil(invalid_border_top) : std::floor(invalid_border_top); + + // Set the anchor point + anchor.set(0, static_cast<int>(invalid_border_left)); + anchor.set(1, static_cast<int>(invalid_border_top)); + + // Compute shape + // Calculate the right and bottom invalid borders at the previous level of the pyramid + const float prev_invalid_border_right = static_cast<float>(shape[0] - (valid_region.anchor.x() + valid_region.shape[0])); + const float prev_invalid_border_bottom = static_cast<float>(shape[1] - (valid_region.anchor.y() + valid_region.shape[1])); + + // Calculate the right and bottom invalid borders at the current level of the pyramid + const float invalid_border_right = std::ceil((prev_invalid_border_right + static_cast<float>(border_size)) / 2.0f); + const float invalid_border_bottom = std::ceil((prev_invalid_border_bottom + static_cast<float>(border_size)) / 2.0f); + + const int valid_shape_x = std::max(0, static_cast<int>(dst_shape.x()) - static_cast<int>(invalid_border_left) - static_cast<int>(invalid_border_right)); + const int valid_shape_y = std::max(0, static_cast<int>(dst_shape.y()) - static_cast<int>(invalid_border_top) - static_cast<int>(invalid_border_bottom)); + + dst_shape.set(0, valid_shape_x); + dst_shape.set(1, valid_shape_y); + } + + return ValidRegion(std::move(anchor), std::move(dst_shape)); +} + /** Write the value after casting the pointer according to @p data_type. * * @warning The type of the value must match the specified data type. diff --git a/tests/datasets/ShapeDatasets.h b/tests/datasets/ShapeDatasets.h index 45f5d1c9ff..3dc4566e18 100644 --- a/tests/datasets/ShapeDatasets.h +++ b/tests/datasets/ShapeDatasets.h @@ -135,6 +135,22 @@ public: } }; +/** Data set containing medium 2D tensor shapes. */ +class Medium2DShapes final : public ShapeDataset +{ +public: + Medium2DShapes() + : ShapeDataset("Shape", + { + TensorShape{ 42U, 37U }, + TensorShape{ 57U, 60U }, + TensorShape{ 128U, 64U }, + TensorShape{ 83U, 72U } + }) + { + } +}; + /** Data set containing large tensor shapes. */ class LargeShapes final : public ShapeDataset { diff --git a/tests/validation/CPP/GaussianPyramidHalf.cpp b/tests/validation/CPP/GaussianPyramidHalf.cpp new file mode 100644 index 0000000000..18d3daa288 --- /dev/null +++ b/tests/validation/CPP/GaussianPyramidHalf.cpp @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2017 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 "GaussianPyramidHalf.h" + +#include "arm_compute/core/Helpers.h" + +#include "Gaussian5x5.h" +#include "Scale.h" +#include "Utils.h" + +namespace arm_compute +{ +namespace test +{ +namespace validation +{ +namespace reference +{ +template <typename T> +std::vector<SimpleTensor<T>> gaussian_pyramid_half(const SimpleTensor<T> &src, BorderMode border_mode, uint8_t constant_border_value, size_t num_levels) +{ + std::vector<SimpleTensor<T>> dst; + + // Level0 is equal to src + dst.push_back(src); + + for(size_t i = 1; i < num_levels; ++i) + { + // Gaussian Filter + const SimpleTensor<T> out_gaus5x5 = reference::gaussian5x5(dst[i - 1], border_mode, constant_border_value); + + // Scale down by 2 with nearest interpolation + const SimpleTensor<T> out = reference::scale(out_gaus5x5, SCALE_PYRAMID_HALF, SCALE_PYRAMID_HALF, InterpolationPolicy::NEAREST_NEIGHBOR, border_mode, constant_border_value, true); + + dst.push_back(out); + } + + return dst; +} + +template std::vector<SimpleTensor<uint8_t>> gaussian_pyramid_half(const SimpleTensor<uint8_t> &src, BorderMode border_mode, uint8_t constant_border_value, size_t num_levels); +} // namespace reference +} // namespace validation +} // namespace test +} // namespace arm_compute diff --git a/tests/validation/CPP/GaussianPyramidHalf.h b/tests/validation/CPP/GaussianPyramidHalf.h new file mode 100644 index 0000000000..abd29e1700 --- /dev/null +++ b/tests/validation/CPP/GaussianPyramidHalf.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2017 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_GAUSSIAN_PYRAMID_HALF_H__ +#define __ARM_COMPUTE_TEST_GAUSSIAN_PYRAMID_HALF_H__ + +#include "tests/SimpleTensor.h" + +namespace arm_compute +{ +namespace test +{ +namespace validation +{ +namespace reference +{ +template <typename T> +std::vector<SimpleTensor<T>> gaussian_pyramid_half(const SimpleTensor<T> &src, BorderMode border_mode, uint8_t constant_border_value, size_t num_levels); +} // namespace reference +} // namespace validation +} // namespace test +} // namespace arm_compute +#endif /* __ARM_COMPUTE_TEST_GAUSSIAN_PYRAMID_HALF_H__ */
\ No newline at end of file diff --git a/tests/validation/CPP/Scale.cpp b/tests/validation/CPP/Scale.cpp index 0da7497277..c368fa277a 100644 --- a/tests/validation/CPP/Scale.cpp +++ b/tests/validation/CPP/Scale.cpp @@ -36,11 +36,13 @@ namespace validation namespace reference { template <typename T> -SimpleTensor<T> scale(const SimpleTensor<T> &in, float scale_x, float scale_y, InterpolationPolicy policy, BorderMode border_mode, T constant_border_value) +SimpleTensor<T> scale(const SimpleTensor<T> &in, float scale_x, float scale_y, InterpolationPolicy policy, BorderMode border_mode, T constant_border_value, bool ceil_policy_scale) { - TensorShape shape_scaled(in.shape()); - shape_scaled.set(0, in.shape()[0] * scale_x); - shape_scaled.set(1, in.shape()[1] * scale_y); + // Add 1 if ceil_policy_scale is true + const size_t round_value = ceil_policy_scale ? 1U : 0U; + TensorShape shape_scaled(in.shape()); + shape_scaled.set(0, (in.shape()[0] + round_value) * scale_x); + shape_scaled.set(1, (in.shape()[1] + round_value) * scale_y); SimpleTensor<T> out(shape_scaled, in.data_type()); // Compute the ratio between source width/height and destination width/height @@ -149,10 +151,13 @@ SimpleTensor<T> scale(const SimpleTensor<T> &in, float scale_x, float scale_y, I return out; } -template SimpleTensor<uint8_t> scale(const SimpleTensor<uint8_t> &src, float scale_x, float scale_y, InterpolationPolicy policy, BorderMode border_mode, uint8_t constant_border_value); -template SimpleTensor<int16_t> scale(const SimpleTensor<int16_t> &src, float scale_x, float scale_y, InterpolationPolicy policy, BorderMode border_mode, int16_t constant_border_value); -template SimpleTensor<half> scale(const SimpleTensor<half> &src, float scale_x, float scale_y, InterpolationPolicy policy, BorderMode border_mode, half constant_border_value); -template SimpleTensor<float> scale(const SimpleTensor<float> &src, float scale_x, float scale_y, InterpolationPolicy policy, BorderMode border_mode, float constant_border_value); +template SimpleTensor<uint8_t> scale(const SimpleTensor<uint8_t> &src, float scale_x, float scale_y, InterpolationPolicy policy, BorderMode border_mode, uint8_t constant_border_value, + bool ceil_policy_scale); +template SimpleTensor<int16_t> scale(const SimpleTensor<int16_t> &src, float scale_x, float scale_y, InterpolationPolicy policy, BorderMode border_mode, int16_t constant_border_value, + bool ceil_policy_scale); +template SimpleTensor<half> scale(const SimpleTensor<half> &src, float scale_x, float scale_y, InterpolationPolicy policy, BorderMode border_mode, half constant_border_value, bool ceil_policy_scale); +template SimpleTensor<float> scale(const SimpleTensor<float> &src, float scale_x, float scale_y, InterpolationPolicy policy, BorderMode border_mode, float constant_border_value, + bool ceil_policy_scale); } // namespace reference } // namespace validation } // namespace test diff --git a/tests/validation/CPP/Scale.h b/tests/validation/CPP/Scale.h index 53183ae742..87af2fd204 100644 --- a/tests/validation/CPP/Scale.h +++ b/tests/validation/CPP/Scale.h @@ -35,7 +35,7 @@ namespace validation namespace reference { template <typename T> -SimpleTensor<T> scale(const SimpleTensor<T> &in, float scale_x, float scale_y, InterpolationPolicy policy, BorderMode border_mode, T constant_border_value = 0); +SimpleTensor<T> scale(const SimpleTensor<T> &in, float scale_x, float scale_y, InterpolationPolicy policy, BorderMode border_mode, T constant_border_value = 0, bool ceil_policy_scale = false); } // namespace reference } // namespace validation } // namespace test diff --git a/tests/validation/NEON/GaussianPyramid.cpp b/tests/validation/NEON/GaussianPyramid.cpp new file mode 100644 index 0000000000..fb4944f9c3 --- /dev/null +++ b/tests/validation/NEON/GaussianPyramid.cpp @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2017 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/NEON/functions/NEGaussianPyramid.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/BorderModeDataset.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/CPP/Utils.h" +#include "tests/validation/Validation.h" +#include "tests/validation/fixtures/GaussianPyramidHalfFixture.h" + +namespace arm_compute +{ +namespace test +{ +namespace validation +{ +namespace +{ +constexpr AbsoluteTolerance<float> tolerance_fp32(1.0f); /**< Tolerance value for comparing reference's output against implementation's output */ + +const auto small_gaussian_pyramid_levels = combine(datasets::Medium2DShapes(), datasets::BorderModes()) * framework::dataset::make("numlevels", 2, 3); +const auto large_gaussian_pyramid_levels = combine(datasets::Large2DShapes(), datasets::BorderModes()) * framework::dataset::make("numlevels", 2, 5); + +template <typename T, typename U> +inline void validate_gaussian_pyramid(const Pyramid &target, const std::vector<SimpleTensor<T>> &reference, BorderMode border_mode, U tolerance) +{ + ValidRegion prev_valid_region = shape_to_valid_region(reference[0].shape()); + + for(size_t i = 1; i < reference.size(); ++i) + { + const ValidRegion valid_region = shape_to_valid_region_gaussian_pyramid_half(reference[i - 1].shape(), prev_valid_region, (border_mode == BorderMode::UNDEFINED)); + + // Validate outputs + validate(Accessor(*(target.get_pyramid_level(i))), reference[i], valid_region, tolerance); + + // Keep the valid region for the next level + prev_valid_region = valid_region; + } +} +} // namespace + +TEST_SUITE(NEON) +TEST_SUITE(GaussianPyramid) +TEST_SUITE(Half) + +DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, large_gaussian_pyramid_levels, + shape, border_mode, num_levels) +{ + Tensor src = create_tensor<Tensor>(shape, DataType::U8); + + // Create pyramid + PyramidInfo pyramid_info(num_levels, SCALE_PYRAMID_HALF, shape, Format::U8); + Pyramid dst; + dst.init(pyramid_info); + + NEGaussianPyramidHalf gaussian_pyramid_half; + gaussian_pyramid_half.configure(&src, &dst, border_mode, 0); + + ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS); + + for(size_t level = 0; level < pyramid_info.num_levels(); ++level) + { + ARM_COMPUTE_EXPECT(dst.get_pyramid_level(level)->info()->is_resizable(), framework::LogLevel::ERRORS); + } +} + +template <typename T> +using NEGaussianPyramidHalfFixture = GaussianPyramidHalfValidationFixture<Tensor, Accessor, NEGaussianPyramidHalf, T, Pyramid>; + +FIXTURE_DATA_TEST_CASE(RunSmallGaussianPyramidHalf, NEGaussianPyramidHalfFixture<uint8_t>, framework::DatasetMode::ALL, small_gaussian_pyramid_levels) +{ + validate_gaussian_pyramid(_target, _reference, _border_mode, tolerance_fp32); +} + +FIXTURE_DATA_TEST_CASE(RunLargeGaussianPyramidHalf, NEGaussianPyramidHalfFixture<uint8_t>, framework::DatasetMode::NIGHTLY, large_gaussian_pyramid_levels) +{ + validate_gaussian_pyramid(_target, _reference, _border_mode, tolerance_fp32); +} +TEST_SUITE_END() +TEST_SUITE_END() +TEST_SUITE_END() +} // namespace validation +} // namespace test +} // namespace arm_compute diff --git a/tests/validation/fixtures/GaussianPyramidHalfFixture.h b/tests/validation/fixtures/GaussianPyramidHalfFixture.h new file mode 100644 index 0000000000..c3e3efb6e6 --- /dev/null +++ b/tests/validation/fixtures/GaussianPyramidHalfFixture.h @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2017 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_GAUSSIAN_PYRAMID_HALF_FIXTURE +#define ARM_COMPUTE_TEST_GAUSSIAN_PYRAMID_HALF_FIXTURE + +#include "arm_compute/core/IPyramid.h" +#include "arm_compute/core/PyramidInfo.h" +#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/CPP/GaussianPyramidHalf.h" + +namespace arm_compute +{ +namespace test +{ +namespace validation +{ +template <typename TensorType, typename AccessorType, typename FunctionType, typename T, typename PyramidType> +class GaussianPyramidHalfValidationFixture : public framework::Fixture +{ +public: + template <typename...> + void setup(TensorShape shape, BorderMode border_mode, size_t num_levels) + { + std::mt19937 gen(library->seed()); + std::uniform_int_distribution<uint8_t> distribution(0, 255); + const uint8_t constant_border_value = distribution(gen); + + _border_mode = border_mode; + + // Compute target and reference + compute_target(shape, border_mode, constant_border_value, num_levels); + compute_reference(shape, border_mode, constant_border_value, num_levels); + } + +protected: + template <typename U> + void fill(U &&tensor) + { + library->fill_tensor_uniform(tensor, 0); + } + + void compute_target(const TensorShape &shape, BorderMode border_mode, uint8_t constant_border_value, size_t num_levels) + { + // Create tensors + TensorType src = create_tensor<TensorType>(shape, DataType::U8); + + PyramidInfo pyramid_info(num_levels, SCALE_PYRAMID_HALF, shape, Format::U8); + _target.init(pyramid_info); + + // Create and configure function + FunctionType gaussian_pyramid; + + gaussian_pyramid.configure(&src, &_target, border_mode, constant_border_value); + + ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS); + for(size_t i = 0; i < pyramid_info.num_levels(); ++i) + { + ARM_COMPUTE_EXPECT(_target.get_pyramid_level(i)->info()->is_resizable(), framework::LogLevel::ERRORS); + } + + // Allocate input tensor + src.allocator()->allocate(); + + // Allocate pyramid + _target.allocate(); + + ARM_COMPUTE_EXPECT(!src.info()->is_resizable(), framework::LogLevel::ERRORS); + for(size_t i = 0; i < pyramid_info.num_levels(); ++i) + { + ARM_COMPUTE_EXPECT(!_target.get_pyramid_level(i)->info()->is_resizable(), framework::LogLevel::ERRORS); + } + + // Fill tensors + fill(AccessorType(src)); + + // Compute function + gaussian_pyramid.run(); + } + + void compute_reference(const TensorShape &shape, BorderMode border_mode, uint8_t constant_border_value, size_t num_levels) + { + // Create reference + SimpleTensor<T> src{ shape, DataType::U8 }; + + // Fill reference + fill(src); + + _reference = reference::gaussian_pyramid_half<T>(src, border_mode, constant_border_value, num_levels); + } + + PyramidType _target{}; + std::vector<SimpleTensor<T>> _reference{}; + BorderMode _border_mode{}; +}; +} // namespace validation +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_GAUSSIAN_PYRAMID_HALF_FIXTURE */
\ No newline at end of file |