From d912fd8eaaa56aac90f2b0b118c76f24ba8efa02 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Mon, 27 Nov 2017 21:00:13 +0000 Subject: COMPMID-617: Add validation to NEON functions. Adds validation to: - NECol2Im - NEIm2Col Change-Id: I346298583a6985ea793f71bb4527aa216a5cd4b2 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/110835 Tested-by: BSG Visual Compute Jenkins server to access repositories on http://mpd-gerrit.cambridge.arm.com Reviewed-by: Michalis Spyrou Reviewed-by: Anthony Barbier --- tests/validation/NEON/Col2Im.cpp | 71 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 tests/validation/NEON/Col2Im.cpp (limited to 'tests/validation/NEON/Col2Im.cpp') diff --git a/tests/validation/NEON/Col2Im.cpp b/tests/validation/NEON/Col2Im.cpp new file mode 100644 index 0000000000..c835c27f18 --- /dev/null +++ b/tests/validation/NEON/Col2Im.cpp @@ -0,0 +1,71 @@ +/* + * 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/NECol2Im.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" + +namespace arm_compute +{ +namespace test +{ +namespace validation +{ +TEST_SUITE(NEON) +TEST_SUITE(Col2Im) + +// *INDENT-OFF* +// clang-format off +DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip( + framework::dataset::make("InputInfo", { TensorInfo(TensorShape(10U, 12U, 1U, 2U), 1, DataType::S64), // Unsupported data type + TensorInfo(TensorShape(10U, 12U, 1U, 2U), 1, DataType::F32), // Mismatching data type + TensorInfo(TensorShape(10U, 12U, 1U, 2U), 1, DataType::QS8, 2), // Mismatching fixed point + TensorInfo(TensorShape(10U, 12U, 1U, 2U), 1, DataType::F32), // Invalid output shape + TensorInfo(TensorShape(10U, 12U, 1U, 2U), 1, DataType::F32), + }), + framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(3U, 4U, 10U, 2U), 1, DataType::F16), + TensorInfo(TensorShape(3U, 4U, 10U, 2U), 1, DataType::F16), + TensorInfo(TensorShape(3U, 4U, 10U, 2U), 1, DataType::QS8, 3), + TensorInfo(TensorShape(3U, 3U, 10U, 2U), 1, DataType::F32), + TensorInfo(TensorShape(3U, 4U, 10U, 2U), 1, DataType::F32), + })), + framework::dataset::make("ConvolvedWidth", { 3, 3, 3, 3, 3 })), + framework::dataset::make("ConvolvedHeight", { 4, 4, 4, 4, 4 })), + framework::dataset::make("Expected", { true, true, true, true, false })), + input_info, output_info, convolved_width, convolved_height, expected) +{ + bool err = bool(NECol2Im::validate(&input_info, &output_info, Size2D(convolved_width, convolved_height))); + ARM_COMPUTE_EXPECT(err == expected, framework::LogLevel::ERRORS); +} +// clang-format on +// *INDENT-ON* + +TEST_SUITE_END() +TEST_SUITE_END() +} // namespace validation +} // namespace test +} // namespace arm_compute -- cgit v1.2.1