aboutsummaryrefslogtreecommitdiff
path: root/tests/validation_new
diff options
context:
space:
mode:
authorMoritz Pflanzer <moritz.pflanzer@arm.com>2017-09-01 20:41:12 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:35:24 +0000
commita09de0c8b2ed0f1481502d3b023375609362d9e3 (patch)
treee34b56d9ca69b025d7d9b943cc4df59cd458f6cb /tests/validation_new
parent5280071b336d53aff94ca3a6c70ebbe6bf03f4c3 (diff)
downloadComputeLibrary-a09de0c8b2ed0f1481502d3b023375609362d9e3.tar.gz
COMPMID-415: Rename and move tests
The boost validation is now "standalone" in validation_old and builds as arm_compute_validation_old. The new validation builds now as arm_compute_validation. Change-Id: Ib93ba848a25680ac60afb92b461d574a0757150d Reviewed-on: http://mpd-gerrit.cambridge.arm.com/86187 Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'tests/validation_new')
-rw-r--r--tests/validation_new/CL/ActivationLayer.cpp247
-rw-r--r--tests/validation_new/CL/BitwiseAnd.cpp94
-rw-r--r--tests/validation_new/CL/BitwiseNot.cpp90
-rw-r--r--tests/validation_new/CL/BitwiseOr.cpp94
-rw-r--r--tests/validation_new/CL/BitwiseXor.cpp94
-rw-r--r--tests/validation_new/CL/ConvolutionLayer.cpp186
-rw-r--r--tests/validation_new/CL/DepthConcatenateLayer.cpp123
-rw-r--r--tests/validation_new/CL/DepthwiseConvolution.cpp69
-rw-r--r--tests/validation_new/CL/DepthwiseSeparableConvolutionLayer.cpp64
-rw-r--r--tests/validation_new/CL/DirectConvolutionLayer.cpp129
-rw-r--r--tests/validation_new/CL/Floor.cpp66
-rw-r--r--tests/validation_new/CL/FullyConnectedLayer.cpp195
-rw-r--r--tests/validation_new/CL/GEMM.cpp167
-rw-r--r--tests/validation_new/CL/L2Normalize.cpp78
-rw-r--r--tests/validation_new/CL/MeanStdDev.cpp97
-rw-r--r--tests/validation_new/CL/NormalizationLayer.cpp141
-rw-r--r--tests/validation_new/CL/PoolingLayer.cpp142
-rw-r--r--tests/validation_new/CL/ReductionOperation.cpp78
-rw-r--r--tests/validation_new/CL/Scale.cpp129
-rw-r--r--tests/validation_new/CL/SoftmaxLayer.cpp168
-rw-r--r--tests/validation_new/CPP/ActivationLayer.cpp158
-rw-r--r--tests/validation_new/CPP/ActivationLayer.h47
-rw-r--r--tests/validation_new/CPP/BitwiseAnd.cpp51
-rw-r--r--tests/validation_new/CPP/BitwiseAnd.h43
-rw-r--r--tests/validation_new/CPP/BitwiseNot.cpp51
-rw-r--r--tests/validation_new/CPP/BitwiseNot.h43
-rw-r--r--tests/validation_new/CPP/BitwiseOr.cpp51
-rw-r--r--tests/validation_new/CPP/BitwiseOr.h43
-rw-r--r--tests/validation_new/CPP/BitwiseXor.cpp51
-rw-r--r--tests/validation_new/CPP/BitwiseXor.h43
-rw-r--r--tests/validation_new/CPP/ConvolutionLayer.cpp205
-rw-r--r--tests/validation_new/CPP/ConvolutionLayer.h44
-rw-r--r--tests/validation_new/CPP/DepthConcatenateLayer.cpp104
-rw-r--r--tests/validation_new/CPP/DepthConcatenateLayer.h45
-rw-r--r--tests/validation_new/CPP/DepthwiseConvolution.cpp103
-rw-r--r--tests/validation_new/CPP/DepthwiseConvolution.h44
-rw-r--r--tests/validation_new/CPP/DepthwiseSeparableConvolutionLayer.cpp60
-rw-r--r--tests/validation_new/CPP/DepthwiseSeparableConvolutionLayer.h46
-rw-r--r--tests/validation_new/CPP/DequantizationLayer.cpp55
-rw-r--r--tests/validation_new/CPP/DequantizationLayer.h44
-rw-r--r--tests/validation_new/CPP/Floor.cpp57
-rw-r--r--tests/validation_new/CPP/Floor.h44
-rw-r--r--tests/validation_new/CPP/FullyConnectedLayer.cpp133
-rw-r--r--tests/validation_new/CPP/FullyConnectedLayer.h44
-rw-r--r--tests/validation_new/CPP/GEMM.cpp122
-rw-r--r--tests/validation_new/CPP/GEMM.h47
-rw-r--r--tests/validation_new/CPP/L2Normalize.cpp88
-rw-r--r--tests/validation_new/CPP/L2Normalize.h44
-rw-r--r--tests/validation_new/CPP/MeanStdDev.cpp57
-rw-r--r--tests/validation_new/CPP/MeanStdDev.h43
-rw-r--r--tests/validation_new/CPP/NormalizationLayer.cpp275
-rw-r--r--tests/validation_new/CPP/NormalizationLayer.h47
-rw-r--r--tests/validation_new/CPP/PoolingLayer.cpp243
-rw-r--r--tests/validation_new/CPP/PoolingLayer.h47
-rw-r--r--tests/validation_new/CPP/QuantizationLayer.cpp85
-rw-r--r--tests/validation_new/CPP/QuantizationLayer.h44
-rw-r--r--tests/validation_new/CPP/ReductionOperation.cpp93
-rw-r--r--tests/validation_new/CPP/ReductionOperation.h44
-rw-r--r--tests/validation_new/CPP/Scale.cpp166
-rw-r--r--tests/validation_new/CPP/Scale.h43
-rw-r--r--tests/validation_new/CPP/SoftmaxLayer.cpp122
-rw-r--r--tests/validation_new/CPP/SoftmaxLayer.h47
-rw-r--r--tests/validation_new/CPP/Utils.cpp93
-rw-r--r--tests/validation_new/CPP/Utils.h54
-rw-r--r--tests/validation_new/FixedPoint.h984
-rw-r--r--tests/validation_new/Helpers.cpp57
-rw-r--r--tests/validation_new/Helpers.h142
-rw-r--r--tests/validation_new/NEON/ActivationLayer.cpp230
-rw-r--r--tests/validation_new/NEON/BitwiseAnd.cpp94
-rw-r--r--tests/validation_new/NEON/BitwiseNot.cpp90
-rw-r--r--tests/validation_new/NEON/BitwiseOr.cpp94
-rw-r--r--tests/validation_new/NEON/BitwiseXor.cpp94
-rw-r--r--tests/validation_new/NEON/ConvolutionLayer.cpp192
-rw-r--r--tests/validation_new/NEON/DepthConcatenateLayer.cpp125
-rw-r--r--tests/validation_new/NEON/DequantizationLayer.cpp100
-rw-r--r--tests/validation_new/NEON/DirectConvolutionLayer.cpp149
-rw-r--r--tests/validation_new/NEON/Floor.cpp66
-rw-r--r--tests/validation_new/NEON/FullyConnectedLayer.cpp211
-rw-r--r--tests/validation_new/NEON/GEMM.cpp170
-rw-r--r--tests/validation_new/NEON/L2Normalize.cpp75
-rw-r--r--tests/validation_new/NEON/MeanStdDev.cpp93
-rw-r--r--tests/validation_new/NEON/NormalizationLayer.cpp144
-rw-r--r--tests/validation_new/NEON/PoolingLayer.cpp148
-rw-r--r--tests/validation_new/NEON/QuantizationLayer.cpp98
-rw-r--r--tests/validation_new/NEON/ReductionOperation.cpp75
-rw-r--r--tests/validation_new/NEON/Scale.cpp127
-rw-r--r--tests/validation_new/NEON/SoftmaxLayer.cpp175
-rw-r--r--tests/validation_new/Validation.cpp307
-rw-r--r--tests/validation_new/Validation.h351
-rw-r--r--tests/validation_new/fixtures/ActivationLayerFixture.h157
-rw-r--r--tests/validation_new/fixtures/BitwiseAndFixture.h113
-rw-r--r--tests/validation_new/fixtures/BitwiseNotFixture.h106
-rw-r--r--tests/validation_new/fixtures/BitwiseOrFixture.h113
-rw-r--r--tests/validation_new/fixtures/BitwiseXorFixture.h113
-rw-r--r--tests/validation_new/fixtures/ConvolutionLayerFixture.h152
-rw-r--r--tests/validation_new/fixtures/DepthConcatenateLayerFixture.h177
-rw-r--r--tests/validation_new/fixtures/DepthwiseConvolutionFixture.h120
-rw-r--r--tests/validation_new/fixtures/DepthwiseSeparableConvolutionLayerFixture.h139
-rw-r--r--tests/validation_new/fixtures/DequantizationLayerFixture.h147
-rw-r--r--tests/validation_new/fixtures/DirectConvolutionLayerFixture.h86
-rw-r--r--tests/validation_new/fixtures/FloorFixture.h107
-rw-r--r--tests/validation_new/fixtures/FullyConnectedLayerFixture.h250
-rw-r--r--tests/validation_new/fixtures/GEMMFixture.h152
-rw-r--r--tests/validation_new/fixtures/L2NormalizeFixture.h107
-rw-r--r--tests/validation_new/fixtures/MeanStdDevFixture.h102
-rw-r--r--tests/validation_new/fixtures/NormalizationLayerFixture.h133
-rw-r--r--tests/validation_new/fixtures/PoolingLayerFixture.h134
-rw-r--r--tests/validation_new/fixtures/QuantizationLayerFixture.h120
-rw-r--r--tests/validation_new/fixtures/ReductionOperationFixture.h116
-rw-r--r--tests/validation_new/fixtures/ScaleFixture.h127
-rw-r--r--tests/validation_new/fixtures/SoftmaxLayerFixture.h133
-rw-r--r--tests/validation_new/half.h38
112 files changed, 0 insertions, 13197 deletions
diff --git a/tests/validation_new/CL/ActivationLayer.cpp b/tests/validation_new/CL/ActivationLayer.cpp
deleted file mode 100644
index c8fddc7db6..0000000000
--- a/tests/validation_new/CL/ActivationLayer.cpp
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * 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/CL/CLTensor.h"
-#include "arm_compute/runtime/CL/CLTensorAllocator.h"
-#include "arm_compute/runtime/CL/functions/CLActivationLayer.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/CL/CLAccessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/ActivationFunctionsDataset.h"
-#include "tests/datasets_new/ShapeDatasets.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/ActivationLayerFixture.h"
-#include "tests/validation_new/half.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace
-{
-/** Define tolerance of the activation layer.
- *
- * @param[in] activation The activation function used.
- * @param[in] data_type Data type.
- *
- * @return Tolerance depending on the activation function.
- */
-AbsoluteTolerance<float> tolerance(ActivationLayerInfo::ActivationFunction activation, DataType data_type)
-{
- constexpr float epsilon = 1e-6f;
-
- switch(activation)
- {
- case ActivationLayerInfo::ActivationFunction::LINEAR:
- return AbsoluteTolerance<float>(data_type == DataType::F16 ? 0.2f : epsilon);
- case ActivationLayerInfo::ActivationFunction::SQUARE:
- return AbsoluteTolerance<float>(data_type == DataType::F16 ? 0.1f : epsilon);
- case ActivationLayerInfo::ActivationFunction::LOGISTIC:
- if(is_data_type_fixed_point(data_type))
- {
- return AbsoluteTolerance<float>(5.f);
- }
- else
- {
- return AbsoluteTolerance<float>(data_type == DataType::F16 ? 0.001f : epsilon);
- }
- case ActivationLayerInfo::ActivationFunction::LEAKY_RELU:
- return AbsoluteTolerance<float>(data_type == DataType::F16 ? 0.00001f : epsilon);
- case ActivationLayerInfo::ActivationFunction::SOFT_RELU:
- case ActivationLayerInfo::ActivationFunction::SQRT:
- if(is_data_type_fixed_point(data_type))
- {
- return AbsoluteTolerance<float>(5.f);
- }
- else
- {
- return AbsoluteTolerance<float>(data_type == DataType::F16 ? 0.01f : 0.00001f);
- }
- case ActivationLayerInfo::ActivationFunction::TANH:
- if(is_data_type_fixed_point(data_type))
- {
- return AbsoluteTolerance<float>(5.f);
- }
- else
- {
- return AbsoluteTolerance<float>(data_type == DataType::F16 ? 0.001f : 0.00001f);
- }
- default:
- return AbsoluteTolerance<float>(epsilon);
- }
-}
-
-/** CNN data types */
-const auto CNNDataTypes = framework::dataset::make("DataType",
-{
- DataType::F16,
- DataType::F32,
- DataType::QS8,
- DataType::QS16,
-});
-
-/** Input data sets. */
-const auto ActivationDataset = combine(combine(framework::dataset::make("InPlace", { false, true }), datasets::ActivationFunctions()), framework::dataset::make("AlphaBeta", { 0.5f, 1.f }));
-} // namespace
-
-TEST_SUITE(CL)
-TEST_SUITE(ActivationLayer)
-
-DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), CNNDataTypes), framework::dataset::make("InPlace", { false, true })),
- shape, data_type, in_place)
-{
- // Set fixed point position data type allowed
- const int fixed_point_position = is_data_type_fixed_point(data_type) ? 3 : 0;
-
- // Create tensors
- CLTensor src = create_tensor<CLTensor>(shape, data_type, 1, fixed_point_position);
- CLTensor dst = create_tensor<CLTensor>(shape, data_type, 1, fixed_point_position);
-
- ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Create and configure function
- CLActivationLayer act_layer;
-
- if(in_place)
- {
- act_layer.configure(&src, nullptr, ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::ABS));
- }
- else
- {
- act_layer.configure(&src, &dst, ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::ABS));
- }
-
- // Validate valid region
- const ValidRegion valid_region = shape_to_valid_region(shape);
- validate(src.info()->valid_region(), valid_region);
-
- if(!in_place)
- {
- validate(dst.info()->valid_region(), valid_region);
- }
-
- // Validate padding
- const int step = 16 / arm_compute::data_size_from_type(data_type);
- const PaddingSize padding = PaddingCalculator(shape.x(), step).required_padding();
- validate(src.info()->padding(), padding);
-
- if(!in_place)
- {
- validate(dst.info()->padding(), padding);
- }
-}
-
-template <typename T>
-using CLActivationLayerFixture = ActivationValidationFixture<CLTensor, CLAccessor, CLActivationLayer, T>;
-
-TEST_SUITE(Float)
-TEST_SUITE(FP16)
-FIXTURE_DATA_TEST_CASE(RunSmall, CLActivationLayerFixture<half_float::half>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallShapes(), ActivationDataset),
- framework::dataset::make("DataType",
- DataType::F16)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance(_function, _data_type));
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLActivationLayerFixture<half_float::half>, framework::DatasetMode::NIGHTLY, combine(combine(datasets::LargeShapes(), ActivationDataset),
- framework::dataset::make("DataType",
- DataType::F16)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance(_function, _data_type));
-}
-TEST_SUITE_END()
-
-TEST_SUITE(FP32)
-FIXTURE_DATA_TEST_CASE(RunSmall, CLActivationLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallShapes(), ActivationDataset), framework::dataset::make("DataType",
- DataType::F32)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance(_function, _data_type));
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLActivationLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(datasets::LargeShapes(), ActivationDataset), framework::dataset::make("DataType",
- DataType::F32)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance(_function, _data_type));
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-template <typename T>
-using CLActivationLayerFixedPointFixture = ActivationValidationFixedPointFixture<CLTensor, CLAccessor, CLActivationLayer, T>;
-
-TEST_SUITE(Quantized)
-TEST_SUITE(QS8)
-// We test for fixed point precision [3,5] because [1,2] and [6,7] ranges cause
-// overflowing issues in most of the transcendentals functions.
-FIXTURE_DATA_TEST_CASE(RunSmall, CLActivationLayerFixedPointFixture<int8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallShapes(), ActivationDataset),
- framework::dataset::make("DataType",
- DataType::QS8)),
- framework::dataset::make("FractionalBits", 3, 6)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance(_function, _data_type));
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLActivationLayerFixedPointFixture<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeShapes(), ActivationDataset),
- framework::dataset::make("DataType",
- DataType::QS8)),
- framework::dataset::make("FractionalBits", 3, 6)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance(_function, _data_type));
-}
-TEST_SUITE_END()
-
-TEST_SUITE(QS16)
-// Testing for fixed point position [1,14) as reciprocal limits the maximum fixed point position to 14
-FIXTURE_DATA_TEST_CASE(RunSmall, CLActivationLayerFixedPointFixture<int16_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallShapes(), ActivationDataset),
- framework::dataset::make("DataType",
- DataType::QS16)),
- framework::dataset::make("FractionalBits", 1, 14)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance(_function, _data_type));
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLActivationLayerFixedPointFixture<int16_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeShapes(), ActivationDataset),
- framework::dataset::make("DataType",
- DataType::QS16)),
- framework::dataset::make("FractionalBits", 1, 14)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance(_function, _data_type));
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CL/BitwiseAnd.cpp b/tests/validation_new/CL/BitwiseAnd.cpp
deleted file mode 100644
index af40812b2a..0000000000
--- a/tests/validation_new/CL/BitwiseAnd.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * 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/CL/functions/CLBitwiseAnd.h"
-#include "arm_compute/runtime/Tensor.h"
-#include "arm_compute/runtime/TensorAllocator.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/CL/CLAccessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/ShapeDatasets.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/BitwiseAndFixture.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-TEST_SUITE(CL)
-TEST_SUITE(BitwiseAnd)
-
-DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), framework::dataset::make("DataType", DataType::U8)), shape, data_type)
-{
- // Create tensors
- CLTensor src1 = create_tensor<CLTensor>(shape, data_type);
- CLTensor src2 = create_tensor<CLTensor>(shape, data_type);
- CLTensor dst = create_tensor<CLTensor>(shape, data_type);
-
- ARM_COMPUTE_EXPECT(src1.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(src2.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Create and configure function
- CLBitwiseAnd bitwise_and;
- bitwise_and.configure(&src1, &src2, &dst);
-
- // Validate valid region
- const ValidRegion valid_region = shape_to_valid_region(shape);
- validate(src1.info()->valid_region(), valid_region);
- validate(src2.info()->valid_region(), valid_region);
- validate(dst.info()->valid_region(), valid_region);
-
- // Validate padding
- const PaddingSize padding = PaddingCalculator(shape.x(), 16).required_padding();
- validate(src1.info()->padding(), padding);
- validate(src2.info()->padding(), padding);
- validate(dst.info()->padding(), padding);
-}
-
-template <typename T>
-using CLBitwiseAndFixture = BitwiseAndValidationFixture<CLTensor, CLAccessor, CLBitwiseAnd, T>;
-
-FIXTURE_DATA_TEST_CASE(RunSmall, CLBitwiseAndFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), framework::dataset::make("DataType",
- DataType::U8)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLBitwiseAndFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(datasets::LargeShapes(), framework::dataset::make("DataType",
- DataType::U8)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference);
-}
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CL/BitwiseNot.cpp b/tests/validation_new/CL/BitwiseNot.cpp
deleted file mode 100644
index e95619f481..0000000000
--- a/tests/validation_new/CL/BitwiseNot.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * 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/CL/functions/CLBitwiseNot.h"
-#include "arm_compute/runtime/Tensor.h"
-#include "arm_compute/runtime/TensorAllocator.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/CL/CLAccessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/ShapeDatasets.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/BitwiseNotFixture.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-TEST_SUITE(CL)
-TEST_SUITE(BitwiseNot)
-
-DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), framework::dataset::make("DataType", DataType::U8)), shape, data_type)
-{
- // Create tensors
- CLTensor src = create_tensor<CLTensor>(shape, data_type);
- CLTensor dst = create_tensor<CLTensor>(shape, data_type);
-
- ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Create and configure function
- CLBitwiseNot bitwise_not;
- bitwise_not.configure(&src, &dst);
-
- // Validate valid region
- const ValidRegion valid_region = shape_to_valid_region(shape);
- validate(src.info()->valid_region(), valid_region);
- validate(dst.info()->valid_region(), valid_region);
-
- // Validate padding
- const PaddingSize padding = PaddingCalculator(shape.x(), 16).required_padding();
- validate(src.info()->padding(), padding);
- validate(dst.info()->padding(), padding);
-}
-
-template <typename T>
-using CLBitwiseNotFixture = BitwiseNotValidationFixture<CLTensor, CLAccessor, CLBitwiseNot, T>;
-
-FIXTURE_DATA_TEST_CASE(RunSmall, CLBitwiseNotFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), framework::dataset::make("DataType",
- DataType::U8)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLBitwiseNotFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(datasets::LargeShapes(), framework::dataset::make("DataType",
- DataType::U8)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference);
-}
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CL/BitwiseOr.cpp b/tests/validation_new/CL/BitwiseOr.cpp
deleted file mode 100644
index 15964eecc3..0000000000
--- a/tests/validation_new/CL/BitwiseOr.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * 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/CL/functions/CLBitwiseOr.h"
-#include "arm_compute/runtime/Tensor.h"
-#include "arm_compute/runtime/TensorAllocator.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/CL/CLAccessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/ShapeDatasets.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/BitwiseOrFixture.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-TEST_SUITE(CL)
-TEST_SUITE(BitwiseOr)
-
-DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), framework::dataset::make("DataType", DataType::U8)), shape, data_type)
-{
- // Create tensors
- CLTensor src1 = create_tensor<CLTensor>(shape, data_type);
- CLTensor src2 = create_tensor<CLTensor>(shape, data_type);
- CLTensor dst = create_tensor<CLTensor>(shape, data_type);
-
- ARM_COMPUTE_EXPECT(src1.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(src2.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Create and configure function
- CLBitwiseOr bitwise_or;
- bitwise_or.configure(&src1, &src2, &dst);
-
- // Validate valid region
- const ValidRegion valid_region = shape_to_valid_region(shape);
- validate(src1.info()->valid_region(), valid_region);
- validate(src2.info()->valid_region(), valid_region);
- validate(dst.info()->valid_region(), valid_region);
-
- // Validate padding
- const PaddingSize padding = PaddingCalculator(shape.x(), 16).required_padding();
- validate(src1.info()->padding(), padding);
- validate(src2.info()->padding(), padding);
- validate(dst.info()->padding(), padding);
-}
-
-template <typename T>
-using CLBitwiseOrFixture = BitwiseOrValidationFixture<CLTensor, CLAccessor, CLBitwiseOr, T>;
-
-FIXTURE_DATA_TEST_CASE(RunSmall, CLBitwiseOrFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), framework::dataset::make("DataType",
- DataType::U8)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLBitwiseOrFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(datasets::LargeShapes(), framework::dataset::make("DataType",
- DataType::U8)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference);
-}
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CL/BitwiseXor.cpp b/tests/validation_new/CL/BitwiseXor.cpp
deleted file mode 100644
index 8e8852209b..0000000000
--- a/tests/validation_new/CL/BitwiseXor.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * 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/CL/functions/CLBitwiseXor.h"
-#include "arm_compute/runtime/Tensor.h"
-#include "arm_compute/runtime/TensorAllocator.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/CL/CLAccessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/ShapeDatasets.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/BitwiseXorFixture.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-TEST_SUITE(CL)
-TEST_SUITE(BitwiseXor)
-
-DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), framework::dataset::make("DataType", DataType::U8)), shape, data_type)
-{
- // Create tensors
- CLTensor src1 = create_tensor<CLTensor>(shape, data_type);
- CLTensor src2 = create_tensor<CLTensor>(shape, data_type);
- CLTensor dst = create_tensor<CLTensor>(shape, data_type);
-
- ARM_COMPUTE_EXPECT(src1.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(src2.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Create and configure function
- CLBitwiseXor bitwise_xor;
- bitwise_xor.configure(&src1, &src2, &dst);
-
- // Validate valid region
- const ValidRegion valid_region = shape_to_valid_region(shape);
- validate(src1.info()->valid_region(), valid_region);
- validate(src2.info()->valid_region(), valid_region);
- validate(dst.info()->valid_region(), valid_region);
-
- // Validate padding
- const PaddingSize padding = PaddingCalculator(shape.x(), 16).required_padding();
- validate(src1.info()->padding(), padding);
- validate(src2.info()->padding(), padding);
- validate(dst.info()->padding(), padding);
-}
-
-template <typename T>
-using CLBitwiseXorFixture = BitwiseXorValidationFixture<CLTensor, CLAccessor, CLBitwiseXor, T>;
-
-FIXTURE_DATA_TEST_CASE(RunSmall, CLBitwiseXorFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), framework::dataset::make("DataType",
- DataType::U8)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLBitwiseXorFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(datasets::LargeShapes(), framework::dataset::make("DataType",
- DataType::U8)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference);
-}
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CL/ConvolutionLayer.cpp b/tests/validation_new/CL/ConvolutionLayer.cpp
deleted file mode 100644
index 9703e0bcba..0000000000
--- a/tests/validation_new/CL/ConvolutionLayer.cpp
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * 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 CONCLCTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-#include "arm_compute/core/Types.h"
-#include "arm_compute/runtime/CL/CLTensor.h"
-#include "arm_compute/runtime/CL/CLTensorAllocator.h"
-#include "arm_compute/runtime/CL/functions/CLConvolutionLayer.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/CL/CLAccessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/LargeConvolutionLayerDataset.h"
-#include "tests/datasets_new/SmallConvolutionLayerDataset.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/ConvolutionLayerFixture.h"
-#include "tests/validation_new/half.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace
-{
-constexpr AbsoluteTolerance<float> tolerance_f32(0.001f); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F32 */
-constexpr AbsoluteTolerance<float> tolerance_f16(0.1f); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F16 */
-constexpr AbsoluteTolerance<float> tolerance_q(1.0f); /**< Tolerance value for comparing reference's output against implementation's output for fixed point data types */
-
-/** CNN data types */
-const auto CNNDataTypes = framework::dataset::make("DataType",
-{
- DataType::F16,
- DataType::F32,
- DataType::QS8,
- DataType::QS16,
-});
-} // namespace
-
-TEST_SUITE(CL)
-TEST_SUITE(ConvolutionLayer)
-
-DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(framework::dataset::concat(datasets::SmallConvolutionLayerDataset(), datasets::LargeConvolutionLayerDataset()), CNNDataTypes),
- input_shape, weights_shape, bias_shape, output_shape, info, data_type)
-{
- // Set fixed point position data type allowed
- int fixed_point_position = is_data_type_fixed_point(data_type) ? 3 : 0;
-
- // Create tensors
- CLTensor src = create_tensor<CLTensor>(input_shape, data_type, 1, fixed_point_position);
- CLTensor weights = create_tensor<CLTensor>(weights_shape, data_type, 1, fixed_point_position);
- CLTensor bias = create_tensor<CLTensor>(bias_shape, data_type, 1, fixed_point_position);
- CLTensor dst = create_tensor<CLTensor>(output_shape, data_type, 1, fixed_point_position);
-
- ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(weights.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(bias.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Create and configure function
- CLConvolutionLayer conv;
- conv.configure(&src, &weights, &bias, &dst, info);
-
- // Validate valid region
- const ValidRegion src_valid_region = shape_to_valid_region(input_shape);
- const ValidRegion weights_valid_region = shape_to_valid_region(weights_shape);
- const ValidRegion bias_valid_region = shape_to_valid_region(bias_shape);
- const ValidRegion dst_valid_region = shape_to_valid_region(output_shape);
-
- validate(src.info()->valid_region(), src_valid_region);
- validate(weights.info()->valid_region(), weights_valid_region);
- validate(bias.info()->valid_region(), bias_valid_region);
- validate(dst.info()->valid_region(), dst_valid_region);
-
- // Validate padding
- //TODO(COMPMID-415) Need to validate padding?
-}
-
-template <typename T>
-using CLConvolutionLayerFixture = ConvolutionValidationFixture<CLTensor, CLAccessor, CLConvolutionLayer, T>;
-
-TEST_SUITE(Float)
-TEST_SUITE(FP16)
-FIXTURE_DATA_TEST_CASE(RunSmall, CLConvolutionLayerFixture<half_float::half>, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallConvolutionLayerDataset(),
- framework::dataset::make("DataType",
- DataType::F16)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_f16);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLConvolutionLayerFixture<half_float::half>, framework::DatasetMode::NIGHTLY, combine(datasets::LargeConvolutionLayerDataset(),
- framework::dataset::make("DataType",
- DataType::F16)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_f16);
-}
-TEST_SUITE_END()
-
-TEST_SUITE(FP32)
-FIXTURE_DATA_TEST_CASE(RunSmall, CLConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallConvolutionLayerDataset(), framework::dataset::make("DataType",
- DataType::F32)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_f32);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(datasets::LargeConvolutionLayerDataset(), framework::dataset::make("DataType",
- DataType::F32)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_f32);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-template <typename T>
-using CLConvolutionLayerFixedPointFixture = ConvolutionValidationFixedPointFixture<CLTensor, CLAccessor, CLConvolutionLayer, T>;
-
-TEST_SUITE(Quantized)
-TEST_SUITE(QS8)
-// We test for fixed point precision [4,6]
-FIXTURE_DATA_TEST_CASE(RunSmall, CLConvolutionLayerFixedPointFixture<int8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallConvolutionLayerDataset(),
- framework::dataset::make("DataType",
- DataType::QS8)),
- framework::dataset::make("FractionalBits", 4, 7)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_q);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLConvolutionLayerFixedPointFixture<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(datasets::LargeConvolutionLayerDataset(),
- framework::dataset::make("DataType",
- DataType::QS8)),
- framework::dataset::make("FractionalBits", 4, 7)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_q);
-}
-TEST_SUITE_END()
-
-TEST_SUITE(QS16)
-// Testing for fixed point position [1,14)
-FIXTURE_DATA_TEST_CASE(RunSmall, CLConvolutionLayerFixedPointFixture<int16_t>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallConvolutionLayerDataset(),
- framework::dataset::make("DataType",
- DataType::QS16)),
- framework::dataset::make("FractionalBits", 1, 14)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_q);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLConvolutionLayerFixedPointFixture<int16_t>, framework::DatasetMode::NIGHTLY, combine(combine(datasets::LargeConvolutionLayerDataset(),
- framework::dataset::make("DataType",
- DataType::QS16)),
- framework::dataset::make("FractionalBits", 1, 14)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_q);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CL/DepthConcatenateLayer.cpp b/tests/validation_new/CL/DepthConcatenateLayer.cpp
deleted file mode 100644
index ff64e2340b..0000000000
--- a/tests/validation_new/CL/DepthConcatenateLayer.cpp
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * 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/CL/CLTensor.h"
-#include "arm_compute/runtime/CL/CLTensorAllocator.h"
-#include "arm_compute/runtime/CL/functions/CLDepthConcatenate.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/CL/CLAccessor.h"
-#include "tests/datasets_new/ShapeDatasets.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/DepthConcatenateLayerFixture.h"
-#include "tests/validation_new/half.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-TEST_SUITE(CL)
-TEST_SUITE(DepthConcatenateLayer)
-
-//TODO(COMPMID-415): Add configuration test?
-
-template <typename T>
-using CLDepthConcatenateLayerFixture = DepthConcatenateValidationFixture<CLTensor, CLAccessor, CLDepthConcatenate, T>;
-
-TEST_SUITE(Float)
-TEST_SUITE(FP16)
-FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthConcatenateLayerFixture<half_float::half>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), framework::dataset::make("DataType",
- DataType::F16)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthConcatenateLayerFixture<half_float::half>, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(), framework::dataset::make("DataType",
- DataType::F16)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference);
-}
-TEST_SUITE_END()
-
-TEST_SUITE(FP32)
-FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthConcatenateLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), framework::dataset::make("DataType",
- DataType::F32)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthConcatenateLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(), framework::dataset::make("DataType",
- DataType::F32)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-TEST_SUITE(Quantized)
-TEST_SUITE(QS8)
-FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthConcatenateLayerFixture<int8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(),
- framework::dataset::make("DataType",
- DataType::QS8)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthConcatenateLayerFixture<int8_t>, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(),
- framework::dataset::make("DataType",
- DataType::QS8)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference);
-}
-TEST_SUITE_END()
-
-TEST_SUITE(QS16)
-FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthConcatenateLayerFixture<int16_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(),
- framework::dataset::make("DataType",
- DataType::QS16)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthConcatenateLayerFixture<int16_t>, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(),
- framework::dataset::make("DataType",
- DataType::QS16)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CL/DepthwiseConvolution.cpp b/tests/validation_new/CL/DepthwiseConvolution.cpp
deleted file mode 100644
index 3fda275715..0000000000
--- a/tests/validation_new/CL/DepthwiseConvolution.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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 CONCLCTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-#include "arm_compute/core/Types.h"
-#include "arm_compute/runtime/CL/CLTensor.h"
-#include "arm_compute/runtime/CL/CLTensorAllocator.h"
-#include "arm_compute/runtime/CL/functions/CLDepthwiseConvolution.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/CL/CLAccessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/LargeDepthwiseConvolutionDataset.h"
-#include "tests/datasets_new/SmallDepthwiseConvolutionDataset.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/DepthwiseConvolutionFixture.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace
-{
-constexpr AbsoluteTolerance<float> tolerance_f32(0.001f); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F32 */
-} // namespace
-
-TEST_SUITE(CL)
-TEST_SUITE(DepthwiseConvolution)
-
-template <typename T>
-using CLDepthwiseConvolutionFixture = DepthwiseConvolutionValidationFixture<CLTensor, CLAccessor, CLDepthwiseConvolution, T>;
-
-FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionFixture<float>, framework::DatasetMode::PRECOMMIT, datasets::SmallDepthwiseConvolutionDataset())
-{
- validate(CLAccessor(_target), _reference, tolerance_f32);
-}
-
-FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionFixture<float>, framework::DatasetMode::NIGHTLY, datasets::LargeDepthwiseConvolutionDataset())
-{
- validate(CLAccessor(_target), _reference, tolerance_f32);
-}
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CL/DepthwiseSeparableConvolutionLayer.cpp b/tests/validation_new/CL/DepthwiseSeparableConvolutionLayer.cpp
deleted file mode 100644
index e577f5af04..0000000000
--- a/tests/validation_new/CL/DepthwiseSeparableConvolutionLayer.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * 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 CONCLCTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-#include "arm_compute/core/Types.h"
-#include "arm_compute/runtime/CL/CLTensor.h"
-#include "arm_compute/runtime/CL/CLTensorAllocator.h"
-#include "arm_compute/runtime/CL/functions/CLDepthwiseSeparableConvolutionLayer.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/CL/CLAccessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/MobileNetDepthwiseSeparableConvolutionLayerDataset.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/DepthwiseSeparableConvolutionLayerFixture.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace
-{
-constexpr AbsoluteTolerance<float> tolerance_f32(0.001f); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F32 */
-} // namespace
-
-TEST_SUITE(CL)
-TEST_SUITE(DepthwiseSeparableConvolutionLayer)
-
-// Configuration test to do
-
-template <typename T>
-using CLDepthwiseSeparableConvolutionLayerFixture = DepthwiseSeparableConvolutionValidationFixture<CLTensor, CLAccessor, CLDepthwiseSeparableConvolutionLayer, T>;
-FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseSeparableConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, datasets::MobileNetDepthwiseSeparableConvolutionLayerDataset())
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_f32);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CL/DirectConvolutionLayer.cpp b/tests/validation_new/CL/DirectConvolutionLayer.cpp
deleted file mode 100644
index 1c698ace0f..0000000000
--- a/tests/validation_new/CL/DirectConvolutionLayer.cpp
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * 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/CL/CLTensor.h"
-#include "arm_compute/runtime/CL/CLTensorAllocator.h"
-#include "arm_compute/runtime/CL/functions/CLDirectConvolutionLayer.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/CL/CLAccessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/ShapeDatasets.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/DirectConvolutionLayerFixture.h"
-#include "tests/validation_new/half.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace
-{
-constexpr AbsoluteTolerance<float> tolerance_fp16(0.1f); /**< Tolerance for floating point tests */
-constexpr AbsoluteTolerance<float> tolerance_fp32(0.001f); /**< Tolerance for floating point tests */
-
-constexpr AbsoluteTolerance<int8_t> tolerance_qs8(0); /**< Tolerance for fixed point tests */
-constexpr AbsoluteTolerance<int16_t> tolerance_qs16(0); /**< Tolerance for fixed point tests */
-
-/** Direct convolution data set. */
-const auto data_quantized = combine(datasets::SmallDirectConvolutionShapes(),
- combine(framework::dataset::make("StrideX", 1, 3),
- combine(framework::dataset::make("StrideY", 1, 3),
- combine(concat(combine(framework::dataset::make("PadX", 0),
- combine(framework::dataset::make("PadY", 0),
- framework::dataset::make("KernelSize", 1))),
- combine(framework::dataset::make("PadX", 0, 2),
- combine(framework::dataset::make("PadY", 0, 2),
- framework::dataset::make("KernelSize", { 3 })))),
- framework::dataset::make("NumKernels", { 1, 4, 8, 16 })))));
-
-const auto data = combine(datasets::SmallDirectConvolutionShapes(),
- combine(framework::dataset::make("StrideX", 1, 3),
- combine(framework::dataset::make("StrideY", 1, 3),
- combine(concat(combine(framework::dataset::make("PadX", 0),
- combine(framework::dataset::make("PadY", 0),
- framework::dataset::make("KernelSize", 1))),
- combine(framework::dataset::make("PadX", 0, 2),
- combine(framework::dataset::make("PadY", 0, 2),
- framework::dataset::make("KernelSize", { 3, 5 })))),
- framework::dataset::make("NumKernels", { 1, 4, 8, 16 })))));
-} // namespace
-
-TEST_SUITE(CL)
-TEST_SUITE(DirectConvolutionLayer)
-
-//TODO(COMPMID-415): Configuration tests?
-
-template <typename T>
-using CLDirectConvolutionLayerFixture = DirectConvolutionValidationFixture<CLTensor, CLAccessor, CLDirectConvolutionLayer, T>;
-
-TEST_SUITE(Float)
-TEST_SUITE(FP16)
-FIXTURE_DATA_TEST_CASE(Run, CLDirectConvolutionLayerFixture<half_float::half>, framework::DatasetMode::ALL, combine(data, framework::dataset::make("DataType", DataType::F16)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_fp16);
-}
-TEST_SUITE_END()
-
-TEST_SUITE(FP32)
-FIXTURE_DATA_TEST_CASE(Run, CLDirectConvolutionLayerFixture<float>, framework::DatasetMode::ALL, combine(data, framework::dataset::make("DataType", DataType::F32)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_fp32);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-template <typename T>
-using CLDirectConvolutionLayerFixedPointFixture = DirectConvolutionValidationFixedPointFixture<CLTensor, CLAccessor, CLDirectConvolutionLayer, T>;
-
-TEST_SUITE(Quantized)
-TEST_SUITE(QS8)
-FIXTURE_DATA_TEST_CASE(Run, CLDirectConvolutionLayerFixedPointFixture<int8_t>, framework::DatasetMode::ALL, combine(combine(data_quantized, framework::dataset::make("DataType", DataType::QS8)),
- framework::dataset::make("FractionalBits", 2, 7)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_qs8);
-}
-TEST_SUITE_END()
-
-TEST_SUITE(QS16)
-FIXTURE_DATA_TEST_CASE(Run, CLDirectConvolutionLayerFixedPointFixture<int16_t>, framework::DatasetMode::ALL, combine(combine(data_quantized, framework::dataset::make("DataType", DataType::QS16)),
- framework::dataset::make("FractionalBits", 2, 15)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_qs16);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CL/Floor.cpp b/tests/validation_new/CL/Floor.cpp
deleted file mode 100644
index 461a914be9..0000000000
--- a/tests/validation_new/CL/Floor.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * 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/CL/CLTensor.h"
-#include "arm_compute/runtime/CL/CLTensorAllocator.h"
-#include "arm_compute/runtime/CL/functions/CLFloor.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/CL/CLAccessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/ShapeDatasets.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/FloorFixture.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-TEST_SUITE(CL)
-TEST_SUITE(Floor)
-
-template <typename T>
-using CLFloorFixture = FloorValidationFixture<CLTensor, CLAccessor, CLFloor, T>;
-
-TEST_SUITE(FP32)
-FIXTURE_DATA_TEST_CASE(RunSmall, CLFloorFixture<float>, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F32)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLFloorFixture<float>, framework::DatasetMode::NIGHTLY, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F32)))
-{
- // 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_new/CL/FullyConnectedLayer.cpp b/tests/validation_new/CL/FullyConnectedLayer.cpp
deleted file mode 100644
index e43997c47b..0000000000
--- a/tests/validation_new/CL/FullyConnectedLayer.cpp
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * 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/CL/CLTensor.h"
-#include "arm_compute/runtime/CL/CLTensorAllocator.h"
-#include "arm_compute/runtime/CL/functions/CLFullyConnectedLayer.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/CL/CLAccessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/FullyConnectedLayerDataset.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/FullyConnectedLayerFixture.h"
-#include "tests/validation_new/half.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace
-{
-/** Tolerance for float operations */
-constexpr AbsoluteTolerance<float> tolerance_f32(0.001f);
-constexpr AbsoluteTolerance<float> tolerance_f16(0.4f);
-/** Tolerance for fixed point operations */
-constexpr AbsoluteTolerance<float> tolerance_fixed_point(1.f);
-
-/** CNN data types */
-const auto CNNDataTypes = framework::dataset::make("DataType",
-{
- DataType::F16,
- DataType::F32,
- DataType::QS8,
- DataType::QS16,
-});
-
-const auto FullyConnectedParameters = combine(framework::dataset::make("TransposeWeights", { false, true }), framework::dataset::make("ReshapeWeights", { false, true }));
-} // namespace
-
-TEST_SUITE(CL)
-TEST_SUITE(FullyConnectedLayer)
-
-DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(framework::dataset::concat(datasets::SmallFullyConnectedLayerDataset(), datasets::LargeFullyConnectedLayerDataset()),
- FullyConnectedParameters),
- CNNDataTypes),
- src_shape, weights_shape, bias_shape, dst_shape, transpose_weights, reshape_weights, data_type)
-{
- // Set fixed point position data type allowed
- int fixed_point_position = is_data_type_fixed_point(data_type) ? 3 : 0;
-
- TensorShape ws(weights_shape);
-
- // Transpose weights if not done in the function
- if(!reshape_weights || !transpose_weights)
- {
- const size_t shape_x = ws.x();
- ws.set(0, ws.y());
- ws.set(1, shape_x);
- }
-
- // Create tensors
- CLTensor src = create_tensor<CLTensor>(src_shape, data_type, 1, fixed_point_position);
- CLTensor weights = create_tensor<CLTensor>(ws, data_type, 1, fixed_point_position);
- CLTensor bias = create_tensor<CLTensor>(bias_shape, data_type, 1, fixed_point_position);
- CLTensor dst = create_tensor<CLTensor>(dst_shape, data_type, 1, fixed_point_position);
-
- ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(weights.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(bias.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Create and configure function.
- CLFullyConnectedLayer fc;
- fc.configure(&src, &weights, &bias, &dst, transpose_weights, !reshape_weights);
-
- // Validate valid region
- const ValidRegion dst_valid_region = shape_to_valid_region(dst_shape);
- validate(dst.info()->valid_region(), dst_valid_region);
-}
-
-template <typename T>
-using CLFullyConnectedLayerFixture = FullyConnectedLayerValidationFixture<CLTensor, CLAccessor, CLFullyConnectedLayer, T, false>;
-
-TEST_SUITE(Float)
-TEST_SUITE(FP16)
-FIXTURE_DATA_TEST_CASE(RunSmall, CLFullyConnectedLayerFixture<half_float::half>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallFullyConnectedLayerDataset(),
- FullyConnectedParameters),
- framework::dataset::make("DataType", DataType::F16)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_f16);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLFullyConnectedLayerFixture<half_float::half>, framework::DatasetMode::NIGHTLY, combine(combine(datasets::LargeFullyConnectedLayerDataset(),
- FullyConnectedParameters),
- framework::dataset::make("DataType", DataType::F16)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_f16);
-}
-TEST_SUITE_END()
-
-TEST_SUITE(FP32)
-FIXTURE_DATA_TEST_CASE(RunSmall, CLFullyConnectedLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallFullyConnectedLayerDataset(), FullyConnectedParameters),
- framework::dataset::make("DataType", DataType::F32)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_f32);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLFullyConnectedLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(datasets::LargeFullyConnectedLayerDataset(), FullyConnectedParameters),
- framework::dataset::make("DataType", DataType::F32)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_f32);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-template <typename T>
-using CLFullyConnectedLayerFixedPointFixture = FullyConnectedLayerValidationFixedPointFixture<CLTensor, CLAccessor, CLFullyConnectedLayer, T, false>;
-
-TEST_SUITE(Quantized)
-TEST_SUITE(QS8)
-// Testing for fixed point position [1,6) as reciprocal limits the maximum fixed point position to 5
-FIXTURE_DATA_TEST_CASE(RunSmall, CLFullyConnectedLayerFixedPointFixture<int8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallFullyConnectedLayerDataset(),
- FullyConnectedParameters),
- framework::dataset::make("DataType",
- DataType::QS8)),
- framework::dataset::make("FractionalBits", 1, 6)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_fixed_point);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLFullyConnectedLayerFixedPointFixture<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeFullyConnectedLayerDataset(),
- FullyConnectedParameters),
- framework::dataset::make("DataType",
- DataType::QS8)),
- framework::dataset::make("FractionalBits", 1, 6)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_fixed_point);
-}
-TEST_SUITE_END()
-
-TEST_SUITE(QS16)
-// Testing for fixed point position [1,14) as reciprocal limits the maximum fixed point position to 14
-FIXTURE_DATA_TEST_CASE(RunSmall, CLFullyConnectedLayerFixedPointFixture<int16_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallFullyConnectedLayerDataset(),
- FullyConnectedParameters),
- framework::dataset::make("DataType",
- DataType::QS16)),
- framework::dataset::make("FractionalBits", 1, 14)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_fixed_point);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLFullyConnectedLayerFixedPointFixture<int16_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeFullyConnectedLayerDataset(),
- FullyConnectedParameters),
- framework::dataset::make("DataType",
- DataType::QS16)),
- framework::dataset::make("FractionalBits", 1, 14)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_fixed_point);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CL/GEMM.cpp b/tests/validation_new/CL/GEMM.cpp
deleted file mode 100644
index 7da5da3ed9..0000000000
--- a/tests/validation_new/CL/GEMM.cpp
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * 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/CL/CLTensor.h"
-#include "arm_compute/runtime/CL/CLTensorAllocator.h"
-#include "arm_compute/runtime/CL/functions/CLGEMM.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/CL/CLAccessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/LargeGEMMDataset.h"
-#include "tests/datasets_new/SmallGEMMDataset.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/GEMMFixture.h"
-#include "tests/validation_new/half.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace
-{
-constexpr AbsoluteTolerance<float> tolerance_f32(0.001f); /**< Tolerance value for comparing reference's output against implementation's output for floating point data types */
-constexpr AbsoluteTolerance<float> tolerance_f16(0.1f); /**< Tolerance value for comparing reference's output against implementation's output for floating point data types */
-constexpr AbsoluteTolerance<float> tolerance_q(1.0f); /**< Tolerance value for comparing reference's output against implementation's output for fixed point data types */
-
-/** CNN data types */
-const auto CNNDataTypes = framework::dataset::make("DataType",
-{
- DataType::F16,
- DataType::F32,
- DataType::QS8,
- DataType::QS16,
-});
-} // namespace
-
-TEST_SUITE(CL)
-TEST_SUITE(GEMM)
-
-DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(framework::dataset::concat(datasets::SmallGEMMDataset(), datasets::LargeGEMMDataset()), CNNDataTypes),
- shape_a, shape_b, shape_c, output_shape, alpha, beta, data_type)
-{
- // Set fixed point position data type allowed
- const int fixed_point_position = is_data_type_fixed_point(data_type) ? 3 : 0;
-
- // Create tensors
- CLTensor a = create_tensor<CLTensor>(shape_a, data_type, 1, fixed_point_position);
- CLTensor b = create_tensor<CLTensor>(shape_b, data_type, 1, fixed_point_position);
- CLTensor c = create_tensor<CLTensor>(shape_c, data_type, 1, fixed_point_position);
- CLTensor dst = create_tensor<CLTensor>(output_shape, data_type, 1, fixed_point_position);
-
- ARM_COMPUTE_EXPECT(a.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(b.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(c.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Create and configure function
- CLGEMM gemm;
- gemm.configure(&a, &b, &c, &dst, alpha, beta);
-
- //TODO(COMPMID-415): Validate valid region
-}
-
-template <typename T>
-using CLGEMMFixture = GEMMValidationFixture<CLTensor, CLAccessor, CLGEMM, T>;
-
-TEST_SUITE(Float)
-TEST_SUITE(FP16)
-FIXTURE_DATA_TEST_CASE(RunSmall, CLGEMMFixture<half_float::half>, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallGEMMDataset(), framework::dataset::make("DataType", DataType::F16)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_f16);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLGEMMFixture<half_float::half>, framework::DatasetMode::NIGHTLY, combine(datasets::LargeGEMMDataset(), framework::dataset::make("DataType",
- DataType::F16)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_f16);
-}
-TEST_SUITE_END()
-
-TEST_SUITE(FP32)
-FIXTURE_DATA_TEST_CASE(RunSmall, CLGEMMFixture<float>, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallGEMMDataset(), framework::dataset::make("DataType", DataType::F32)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_f32);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLGEMMFixture<float>, framework::DatasetMode::NIGHTLY, combine(datasets::LargeGEMMDataset(), framework::dataset::make("DataType", DataType::F32)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_f32);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-template <typename T>
-using CLGEMMFixedPointFixture = GEMMValidationFixedPointFixture<CLTensor, CLAccessor, CLGEMM, T>;
-
-TEST_SUITE(Quantized)
-TEST_SUITE(QS8)
-FIXTURE_DATA_TEST_CASE(RunSmall, CLGEMMFixedPointFixture<int8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallGEMMDataset(),
- framework::dataset::make("DataType",
- DataType::QS8)),
- framework::dataset::make("FractionalBits", 1, 7)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_q);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLGEMMFixedPointFixture<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(datasets::LargeGEMMDataset(),
- framework::dataset::make("DataType",
- DataType::QS8)),
- framework::dataset::make("FractionalBits", 1, 7)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_q);
-}
-TEST_SUITE_END()
-
-TEST_SUITE(QS16)
-FIXTURE_DATA_TEST_CASE(RunSmall, CLGEMMFixedPointFixture<int16_t>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallGEMMDataset(),
- framework::dataset::make("DataType",
- DataType::QS16)),
- framework::dataset::make("FractionalBits", 1, 14)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_q);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLGEMMFixedPointFixture<int16_t>, framework::DatasetMode::NIGHTLY, combine(combine(datasets::LargeGEMMDataset(),
- framework::dataset::make("DataType",
- DataType::QS16)),
- framework::dataset::make("FractionalBits", 1, 14)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_q);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CL/L2Normalize.cpp b/tests/validation_new/CL/L2Normalize.cpp
deleted file mode 100644
index d7882a842a..0000000000
--- a/tests/validation_new/CL/L2Normalize.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * 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/CL/CLTensor.h"
-#include "arm_compute/runtime/CL/CLTensorAllocator.h"
-#include "arm_compute/runtime/CL/functions/CLL2Normalize.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/CL/CLAccessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/ShapeDatasets.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/L2NormalizeFixture.h"
-#include "tests/validation_new/half.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace
-{
-/** Tolerance for float operations */
-constexpr AbsoluteTolerance<float> tolerance_f32(0.00001f);
-
-} // namespace
-
-TEST_SUITE(CL)
-TEST_SUITE(L2Normalize)
-
-template <typename T>
-using CLL2NormalizeFixture = L2NormalizeValidationFixture<CLTensor, CLAccessor, CLL2Normalize, T>;
-
-TEST_SUITE(Float)
-TEST_SUITE(FP32)
-FIXTURE_DATA_TEST_CASE(RunSmall, CLL2NormalizeFixture<float>, framework::DatasetMode::PRECOMMIT,
- combine(combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F32)), framework::dataset::make("Axis", { 0 })), framework::dataset::make("Epsilon", { 1e-12 })))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_f32);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLL2NormalizeFixture<float>, framework::DatasetMode::NIGHTLY,
- combine(combine(combine(datasets::LargeShapes(), framework::dataset::make("DataType", DataType::F32)), framework::dataset::make("Axis", { 0 })), framework::dataset::make("Epsilon", { 1e-12 })))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_f32);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CL/MeanStdDev.cpp b/tests/validation_new/CL/MeanStdDev.cpp
deleted file mode 100644
index 494e1001bc..0000000000
--- a/tests/validation_new/CL/MeanStdDev.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * 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/runtime/CL/functions/CLMeanStdDev.h"
-#include "framework/Macros.h"
-#include "tests/CL/CLAccessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/ShapeDatasets.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/MeanStdDevFixture.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace
-{
-constexpr RelativeTolerance tolerance_rel_high_error(0.05f);
-constexpr RelativeTolerance tolerance_rel_low_error(0.0005f);
-} // namespace
-
-TEST_SUITE(CL)
-TEST_SUITE(MeanStdDev)
-
-DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(concat(datasets::Small2DShapes(), datasets::Large2DShapes()), framework::dataset::make("DataType", DataType::U8)), shape, data_type)
-{
- // Create tensors
- CLTensor src = create_tensor<CLTensor>(shape, data_type);
-
- // Create output variables
- float mean = 0.f;
- float std_dev = 0.f;
-
- ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Create configure function
- CLMeanStdDev mean_std_dev_image;
- mean_std_dev_image.configure(&src, &mean, &std_dev);
-
- // Validate valid region
- const ValidRegion valid_region = shape_to_valid_region(shape);
- validate(src.info()->valid_region(), valid_region);
-
- // Validate padding
- const PaddingSize padding = PaddingCalculator(shape.x(), 8).required_padding();
- validate(src.info()->padding(), padding);
-}
-
-template <typename T>
-using CLMeanStdDevFixture = MeanStdDevValidationFixture<CLTensor, CLAccessor, CLMeanStdDev, T>;
-
-FIXTURE_DATA_TEST_CASE(RunSmall, CLMeanStdDevFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), framework::dataset::make("DataType",
- DataType::U8)))
-{
- // Validate mean output
- validate(_target.first, _reference.first);
-
- // Validate std_dev output
- validate(_target.second, _reference.second, tolerance_rel_high_error);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLMeanStdDevFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(), framework::dataset::make("DataType",
- DataType::U8)))
-{
- // Validate mean output
- validate(_target.first, _reference.first, tolerance_rel_low_error);
-
- // Validate std_dev output
- validate(_target.second, _reference.second, tolerance_rel_high_error);
-}
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CL/NormalizationLayer.cpp b/tests/validation_new/CL/NormalizationLayer.cpp
deleted file mode 100644
index 37e77f3632..0000000000
--- a/tests/validation_new/CL/NormalizationLayer.cpp
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * 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/CL/CLTensor.h"
-#include "arm_compute/runtime/CL/CLTensorAllocator.h"
-#include "arm_compute/runtime/CL/functions/CLNormalizationLayer.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/CL/CLAccessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/NormalizationTypesDataset.h"
-#include "tests/datasets_new/ShapeDatasets.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/NormalizationLayerFixture.h"
-#include "tests/validation_new/half.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace
-{
-/** Tolerance for float operations */
-constexpr AbsoluteTolerance<float> tolerance_f16(0.01f);
-constexpr AbsoluteTolerance<float> tolerance_f32(0.00001f);
-/** Tolerance for fixed point operations */
-constexpr AbsoluteTolerance<int8_t> tolerance_qs8(2);
-constexpr AbsoluteTolerance<int16_t> tolerance_qs16(2);
-
-/** Input data set. */
-const auto NormalizationDataset = combine(combine(combine(datasets::SmallShapes(), framework::dataset::make("NormType", { NormType::IN_MAP_1D, NormType::CROSS_MAP })),
- framework::dataset::make("NormalizationSize", 3, 9, 2)),
- framework::dataset::make("Beta", { 0.5f, 1.f, 2.f }));
-} // namespace
-
-TEST_SUITE(CL)
-TEST_SUITE(NormalizationLayer)
-
-//TODO(COMPMID-415): Missing configuration?
-
-template <typename T>
-using CLNormalizationLayerFixture = NormalizationValidationFixture<CLTensor, CLAccessor, CLNormalizationLayer, T>;
-
-TEST_SUITE(Float)
-TEST_SUITE(FP16)
-FIXTURE_DATA_TEST_CASE(RunSmall, CLNormalizationLayerFixture<half_float::half>, framework::DatasetMode::PRECOMMIT, combine(NormalizationDataset, framework::dataset::make("DataType", DataType::F16)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_f16);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLNormalizationLayerFixture<half_float::half>, framework::DatasetMode::NIGHTLY, combine(NormalizationDataset, framework::dataset::make("DataType", DataType::F16)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_f16);
-}
-TEST_SUITE_END()
-
-TEST_SUITE(FP32)
-FIXTURE_DATA_TEST_CASE(RunSmall, CLNormalizationLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(NormalizationDataset, framework::dataset::make("DataType", DataType::F32)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_f32);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLNormalizationLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(NormalizationDataset, framework::dataset::make("DataType", DataType::F32)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_f32);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-template <typename T>
-using CLNormalizationLayerFixedPointFixture = NormalizationValidationFixedPointFixture<CLTensor, CLAccessor, CLNormalizationLayer, T>;
-
-TEST_SUITE(Quantized)
-TEST_SUITE(QS8)
-// Testing for fixed point position [1,6) as reciprocal limits the maximum fixed point position to 5
-FIXTURE_DATA_TEST_CASE(RunSmall, CLNormalizationLayerFixedPointFixture<int8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(NormalizationDataset, framework::dataset::make("DataType",
- DataType::QS8)),
- framework::dataset::make("FractionalBits", 1, 6)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_qs8);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLNormalizationLayerFixedPointFixture<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(NormalizationDataset, framework::dataset::make("DataType",
- DataType::QS8)),
- framework::dataset::make("FractionalBits", 1, 6)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_qs8);
-}
-TEST_SUITE_END()
-
-TEST_SUITE(QS16)
-// Testing for fixed point position [1,14) as reciprocal limits the maximum fixed point position to 5
-FIXTURE_DATA_TEST_CASE(RunSmall, CLNormalizationLayerFixedPointFixture<int16_t>, framework::DatasetMode::PRECOMMIT, combine(combine(NormalizationDataset, framework::dataset::make("DataType",
- DataType::QS16)),
- framework::dataset::make("FractionalBits", 1, 14)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_qs16);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLNormalizationLayerFixedPointFixture<int16_t>, framework::DatasetMode::NIGHTLY, combine(combine(NormalizationDataset, framework::dataset::make("DataType",
- DataType::QS16)),
- framework::dataset::make("FractionalBits", 1, 14)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_qs16);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CL/PoolingLayer.cpp b/tests/validation_new/CL/PoolingLayer.cpp
deleted file mode 100644
index d38a3b2c6a..0000000000
--- a/tests/validation_new/CL/PoolingLayer.cpp
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * 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/CL/CLTensor.h"
-#include "arm_compute/runtime/CL/CLTensorAllocator.h"
-#include "arm_compute/runtime/CL/functions/CLPoolingLayer.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/CL/CLAccessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/PoolingTypesDataset.h"
-#include "tests/datasets_new/ShapeDatasets.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/PoolingLayerFixture.h"
-#include "tests/validation_new/half.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace
-{
-/** Input data set for float data types */
-const auto PoolingLayerDatasetFP = combine(combine(datasets::PoolingTypes(), framework::dataset::make("PoolingSize", { 2, 3, 7 })),
- framework::dataset::make("PadStride", { PadStrideInfo(1, 1, 0, 0), PadStrideInfo(2, 1, 0, 0), PadStrideInfo(1, 2, 1, 1), PadStrideInfo(2, 2, 1, 0) }));
-
-/** Input data set for quantized data types */
-const auto PoolingLayerDatasetQS = combine(combine(datasets::PoolingTypes(), framework::dataset::make("PoolingSize", { 2, 3 })),
- framework::dataset::make("PadStride", { PadStrideInfo(1, 1, 0, 0), PadStrideInfo(2, 1, 0, 0), PadStrideInfo(1, 2, 1, 1), PadStrideInfo(2, 2, 1, 0) }));
-
-constexpr AbsoluteTolerance<float> tolerance_f32(0.001f); /**< Tolerance value for comparing reference's output against implementation's output for float types */
-constexpr AbsoluteTolerance<float> tolerance_f16(0.01f); /**< Tolerance value for comparing reference's output against implementation's output for float types */
-constexpr AbsoluteTolerance<float> tolerance_qs8(3); /**< Tolerance value for comparing reference's output against implementation's output for quantized input */
-constexpr AbsoluteTolerance<float> tolerance_qs16(6); /**< Tolerance value for comparing reference's output against implementation's output for quantized input */
-} // namespace
-
-TEST_SUITE(CL)
-TEST_SUITE(PoolingLayer)
-
-template <typename T>
-using CLPoolingLayerFixture = PoolingLayerValidationFixture<CLTensor, CLAccessor, CLPoolingLayer, T>;
-
-TEST_SUITE(Float)
-TEST_SUITE(FP32)
-FIXTURE_DATA_TEST_CASE(RunSmall, CLPoolingLayerFixture<float>, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), combine(PoolingLayerDatasetFP, framework::dataset::make("DataType",
- DataType::F32))))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_f32);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLPoolingLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(datasets::LargeShapes(), combine(PoolingLayerDatasetFP, framework::dataset::make("DataType",
- DataType::F32))))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_f32);
-}
-TEST_SUITE_END()
-
-TEST_SUITE(FP16)
-FIXTURE_DATA_TEST_CASE(RunSmall, CLPoolingLayerFixture<half_float::half>, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), combine(PoolingLayerDatasetFP,
- framework::dataset::make("DataType", DataType::F16))))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_f16);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLPoolingLayerFixture<half_float::half>, framework::DatasetMode::NIGHTLY, combine(datasets::LargeShapes(), combine(PoolingLayerDatasetFP,
- framework::dataset::make("DataType", DataType::F16))))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_f16);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-template <typename T>
-using CLPoolingLayerFixedPointFixture = PoolingLayerValidationFixedPointFixture<CLTensor, CLAccessor, CLPoolingLayer, T>;
-
-TEST_SUITE(Quantized)
-TEST_SUITE(QS8)
-FIXTURE_DATA_TEST_CASE(RunSmall, CLPoolingLayerFixedPointFixture<int8_t>, framework::DatasetMode::ALL, combine(combine(datasets::SmallShapes(), combine(PoolingLayerDatasetQS,
- framework::dataset::make("DataType", DataType::QS8))),
- framework::dataset::make("FractionalBits", 1, 4)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_qs8);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLPoolingLayerFixedPointFixture<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(datasets::LargeShapes(), combine(PoolingLayerDatasetQS,
- framework::dataset::make("DataType", DataType::QS8))),
- framework::dataset::make("FractionalBits", 1, 4)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_qs8);
-}
-TEST_SUITE_END()
-
-TEST_SUITE(QS16)
-FIXTURE_DATA_TEST_CASE(RunSmall, CLPoolingLayerFixedPointFixture<int16_t>, framework::DatasetMode::ALL, combine(combine(datasets::SmallShapes(), combine(PoolingLayerDatasetQS,
- framework::dataset::make("DataType", DataType::QS16))),
- framework::dataset::make("FractionalBits", 1, 12)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_qs16);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLPoolingLayerFixedPointFixture<int16_t>, framework::DatasetMode::NIGHTLY, combine(combine(datasets::LargeShapes(), combine(PoolingLayerDatasetQS,
- framework::dataset::make("DataType", DataType::QS16))),
- framework::dataset::make("FractionalBits", 1, 12)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_qs16);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CL/ReductionOperation.cpp b/tests/validation_new/CL/ReductionOperation.cpp
deleted file mode 100644
index af49d736ab..0000000000
--- a/tests/validation_new/CL/ReductionOperation.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * 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/CL/CLTensor.h"
-#include "arm_compute/runtime/CL/CLTensorAllocator.h"
-#include "arm_compute/runtime/CL/functions/CLReductionOperation.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/CL/CLAccessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/ReductionOperationDataset.h"
-#include "tests/datasets_new/ShapeDatasets.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/ReductionOperationFixture.h"
-#include "tests/validation_new/half.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace
-{
-/** Tolerance for float operations */
-constexpr RelativeTolerance tolerance_f32(0.00001f);
-} // namespace
-
-TEST_SUITE(CL)
-TEST_SUITE(ReductionOperation)
-
-template <typename T>
-using CLReductionOperationFixture = ReductionOperationValidationFixture<CLTensor, CLAccessor, CLReductionOperation, T>;
-
-TEST_SUITE(Float)
-TEST_SUITE(FP32)
-FIXTURE_DATA_TEST_CASE(RunSmall, CLReductionOperationFixture<float>, framework::DatasetMode::PRECOMMIT,
- combine(combine(combine(datasets::LargeShapes(), framework::dataset::make("DataType", DataType::F32)), framework::dataset::make("Axis", { 0 })), datasets::ReductionOperations()))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_f32);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLReductionOperationFixture<float>, framework::DatasetMode::NIGHTLY,
- combine(combine(combine(datasets::LargeShapes(), framework::dataset::make("DataType", DataType::F32)), framework::dataset::make("Axis", { 0 })), datasets::ReductionOperations()))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_f32);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CL/Scale.cpp b/tests/validation_new/CL/Scale.cpp
deleted file mode 100644
index e28555ac21..0000000000
--- a/tests/validation_new/CL/Scale.cpp
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * 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/Helpers.h"
-#include "arm_compute/core/Types.h"
-#include "arm_compute/runtime/CL/functions/CLScale.h"
-#include "arm_compute/runtime/Tensor.h"
-#include "arm_compute/runtime/TensorAllocator.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/CL/CLAccessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/BorderModeDataset.h"
-#include "tests/datasets_new/ShapeDatasets.h"
-#include "tests/validation_new/Helpers.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/ScaleFixture.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace
-{
-/** Tolerance */
-constexpr AbsoluteTolerance<uint8_t> tolerance(1);
-} // namespace
-
-TEST_SUITE(CL)
-TEST_SUITE(Scale)
-
-DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), framework::dataset::make("DataType", DataType::U8)),
- framework::dataset::make("InterpolationPolicy", { InterpolationPolicy::NEAREST_NEIGHBOR, InterpolationPolicy::BILINEAR })),
- datasets::BorderModes()),
- shape, data_type, policy, border_mode)
-{
- std::mt19937 generator(library->seed());
- std::uniform_real_distribution<float> distribution_float(0.25, 2);
- const float scale_x = distribution_float(generator);
- const float scale_y = distribution_float(generator);
- std::uniform_int_distribution<uint8_t> distribution_u8(0, 255);
- uint8_t constant_border_value = distribution_u8(generator);
-
- // Create tensors
- CLTensor src = create_tensor<CLTensor>(shape, data_type);
- TensorShape shape_scaled(shape);
- shape_scaled.set(0, shape[0] * scale_x);
- shape_scaled.set(1, shape[1] * scale_y);
- CLTensor dst = create_tensor<CLTensor>(shape_scaled, data_type);
-
- ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Create and configure function
- CLScale clscale;
- clscale.configure(&src, &dst, policy, border_mode, constant_border_value);
-
- // Validate valid region
- const ValidRegion dst_valid_region = calculate_valid_region_scale(*(src.info()), shape_scaled, policy, BorderSize(1), (border_mode == BorderMode::UNDEFINED));
-
- validate(dst.info()->valid_region(), dst_valid_region);
-
- // Validate padding
- PaddingCalculator calculator(shape_scaled.x(), 4);
- calculator.set_border_mode(border_mode);
-
- const PaddingSize read_padding(1);
- const PaddingSize write_padding = calculator.required_padding(PaddingCalculator::Option::EXCLUDE_BORDER);
- validate(src.info()->padding(), read_padding);
- validate(dst.info()->padding(), write_padding);
-}
-
-template <typename T>
-using CLScaleFixture = ScaleValidationFixture<CLTensor, CLAccessor, CLScale, T>;
-
-FIXTURE_DATA_TEST_CASE(RunSmall, CLScaleFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType",
- DataType::U8)),
- framework::dataset::make("InterpolationPolicy",
-{ InterpolationPolicy::NEAREST_NEIGHBOR, InterpolationPolicy::BILINEAR })),
-datasets::BorderModes()))
-{
- //Create valid region
- TensorInfo src_info(_shape, 1, _data_type);
- const ValidRegion valid_region = calculate_valid_region_scale(src_info, _reference.shape(), _policy, BorderSize(1), (_border_mode == BorderMode::UNDEFINED));
-
- // Validate output
- validate(CLAccessor(_target), _reference, valid_region, tolerance);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLScaleFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeShapes(), framework::dataset::make("DataType",
- DataType::U8)),
- framework::dataset::make("InterpolationPolicy",
-{ InterpolationPolicy::NEAREST_NEIGHBOR, InterpolationPolicy::BILINEAR })),
-datasets::BorderModes()))
-{
- //Create valid region
- TensorInfo src_info(_shape, 1, _data_type);
- const ValidRegion valid_region = calculate_valid_region_scale(src_info, _reference.shape(), _policy, BorderSize(1), (_border_mode == BorderMode::UNDEFINED));
-
- // Validate output
- validate(CLAccessor(_target), _reference, valid_region, tolerance);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CL/SoftmaxLayer.cpp b/tests/validation_new/CL/SoftmaxLayer.cpp
deleted file mode 100644
index d13236a2f9..0000000000
--- a/tests/validation_new/CL/SoftmaxLayer.cpp
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * 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/CL/CLTensor.h"
-#include "arm_compute/runtime/CL/CLTensorAllocator.h"
-#include "arm_compute/runtime/CL/functions/CLSoftmaxLayer.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/CL/CLAccessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/ShapeDatasets.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/SoftmaxLayerFixture.h"
-#include "tests/validation_new/half.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace
-{
-/** Tolerance for float operations */
-constexpr AbsoluteTolerance<float> tolerance_f16(0.002f);
-constexpr AbsoluteTolerance<float> tolerance_f32(0.000001f);
-/** Tolerance for fixed point operations */
-constexpr AbsoluteTolerance<int8_t> tolerance_fixed_point(2);
-
-/** CNN data types */
-const auto CNNDataTypes = framework::dataset::make("DataType",
-{
- DataType::F16,
- DataType::F32,
- DataType::QS8,
- DataType::QS16,
-});
-} // namespace
-
-TEST_SUITE(CL)
-TEST_SUITE(SoftmaxLayer)
-
-DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), CNNDataTypes), shape, data_type)
-{
- // Set fixed point position data type allowed
- const int fixed_point_position = is_data_type_fixed_point(data_type) ? 3 : 0;
-
- // Create tensors
- CLTensor src = create_tensor<CLTensor>(shape, data_type, 1, fixed_point_position);
- CLTensor dst = create_tensor<CLTensor>(shape, data_type, 1, fixed_point_position);
-
- ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Create and configure function
- CLSoftmaxLayer smx_layer;
- smx_layer.configure(&src, &dst);
-
- // Validate valid region
- const ValidRegion valid_region = shape_to_valid_region(shape);
- validate(src.info()->valid_region(), valid_region);
- validate(dst.info()->valid_region(), valid_region);
-
- // Validate padding
- const PaddingSize padding = PaddingCalculator(shape.x(), 16).required_padding();
- validate(src.info()->padding(), padding);
- validate(dst.info()->padding(), padding);
-}
-
-template <typename T>
-using CLSoftmaxLayerFixture = SoftmaxValidationFixture<CLTensor, CLAccessor, CLSoftmaxLayer, T>;
-
-TEST_SUITE(Float)
-TEST_SUITE(FP16)
-FIXTURE_DATA_TEST_CASE(RunSmall, CLSoftmaxLayerFixture<half_float::half>, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F16)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_f16);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLSoftmaxLayerFixture<half_float::half>, framework::DatasetMode::NIGHTLY, combine(datasets::LargeShapes(), framework::dataset::make("DataType", DataType::F16)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_f16);
-}
-TEST_SUITE_END()
-
-TEST_SUITE(FP32)
-FIXTURE_DATA_TEST_CASE(RunSmall, CLSoftmaxLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F32)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_f32);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLSoftmaxLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(datasets::LargeShapes(), framework::dataset::make("DataType", DataType::F32)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_f32);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-template <typename T>
-using CLSoftmaxLayerFixedPointFixture = SoftmaxValidationFixedPointFixture<CLTensor, CLAccessor, CLSoftmaxLayer, T>;
-
-TEST_SUITE(Quantized)
-TEST_SUITE(QS8)
-// Testing for fixed point position [1,6) as reciprocal limits the maximum fixed point position to 5
-FIXTURE_DATA_TEST_CASE(RunSmall, CLSoftmaxLayerFixedPointFixture<int8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType",
- DataType::QS8)),
- framework::dataset::make("FractionalBits", 1, 6)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_fixed_point);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLSoftmaxLayerFixedPointFixture<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(datasets::LargeShapes(), framework::dataset::make("DataType",
- DataType::QS8)),
- framework::dataset::make("FractionalBits", 1, 6)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_fixed_point);
-}
-TEST_SUITE_END()
-
-TEST_SUITE(QS16)
-// Testing for fixed point position [1,14) as reciprocal limits the maximum fixed point position to 14
-FIXTURE_DATA_TEST_CASE(RunSmall, CLSoftmaxLayerFixedPointFixture<int16_t>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType",
- DataType::QS16)),
- framework::dataset::make("FractionalBits", 1, 14)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_fixed_point);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, CLSoftmaxLayerFixedPointFixture<int16_t>, framework::DatasetMode::NIGHTLY, combine(combine(datasets::LargeShapes(), framework::dataset::make("DataType",
- DataType::QS16)),
- framework::dataset::make("FractionalBits", 1, 14)))
-{
- // Validate output
- validate(CLAccessor(_target), _reference, tolerance_fixed_point);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CPP/ActivationLayer.cpp b/tests/validation_new/CPP/ActivationLayer.cpp
deleted file mode 100644
index 052c3aa566..0000000000
--- a/tests/validation_new/CPP/ActivationLayer.cpp
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * 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 "ActivationLayer.h"
-
-#include "tests/validation_new/FixedPoint.h"
-#include "tests/validation_new/Helpers.h"
-#include "tests/validation_new/half.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-template <typename T, typename std::enable_if<is_floating_point<T>::value, int>::type>
-SimpleTensor<T> activation_layer(const SimpleTensor<T> &src, ActivationLayerInfo info)
-{
- // Create reference
- SimpleTensor<T> dst{ src.shape(), src.data_type(), 1, src.fixed_point_position() };
-
- // Compute reference
- const T a(info.a());
- const T b(info.b());
-
- for(int i = 0; i < src.num_elements(); ++i)
- {
- T x = src[i];
-
- switch(info.activation())
- {
- case ActivationLayerInfo::ActivationFunction::ABS:
- dst[i] = std::abs(x);
- break;
- case ActivationLayerInfo::ActivationFunction::LINEAR:
- dst[i] = a * x + b;
- break;
- case ActivationLayerInfo::ActivationFunction::LOGISTIC:
- dst[i] = static_cast<T>(1) / (static_cast<T>(1) + std::exp(-x));
- break;
- case ActivationLayerInfo::ActivationFunction::RELU:
- dst[i] = std::max<T>(static_cast<T>(0), x);
- break;
- case ActivationLayerInfo::ActivationFunction::BOUNDED_RELU:
- dst[i] = std::min<T>(a, std::max(static_cast<T>(0), x));
- break;
- case ActivationLayerInfo::ActivationFunction::LEAKY_RELU:
- dst[i] = (x > 0) ? x : a * x;
- break;
- case ActivationLayerInfo::ActivationFunction::SOFT_RELU:
- dst[i] = std::log(static_cast<T>(1) + std::exp(x));
- break;
- case ActivationLayerInfo::ActivationFunction::SQRT:
- dst[i] = std::sqrt(x);
- break;
- case ActivationLayerInfo::ActivationFunction::SQUARE:
- dst[i] = x * x;
- break;
- case ActivationLayerInfo::ActivationFunction::TANH:
- dst[i] = a * std::tanh(b * x);
- break;
- default:
- ARM_COMPUTE_ERROR("Unsupported activation function");
- }
- }
-
- return dst;
-}
-
-template <typename T, typename std::enable_if<std::is_integral<T>::value, int>::type>
-SimpleTensor<T> activation_layer(const SimpleTensor<T> &src, ActivationLayerInfo info)
-{
- using namespace fixed_point_arithmetic;
-
- // Create reference
- SimpleTensor<T> dst{ src.shape(), src.data_type(), 1, src.fixed_point_position() };
-
- // Compute reference
- const int fixed_point_position = src.fixed_point_position();
- const fixed_point<T> a(info.a(), fixed_point_position);
- const fixed_point<T> b(info.b(), fixed_point_position);
- const fixed_point<T> const_0(0, fixed_point_position);
- const fixed_point<T> const_1(1, fixed_point_position);
-
- for(int i = 0; i < src.num_elements(); ++i)
- {
- fixed_point<T> x(src[i], fixed_point_position, true);
-
- switch(info.activation())
- {
- case ActivationLayerInfo::ActivationFunction::ABS:
- dst[i] = abs(x).raw();
- break;
- case ActivationLayerInfo::ActivationFunction::LINEAR:
- dst[i] = add(b, mul(a, x)).raw();
- break;
- case ActivationLayerInfo::ActivationFunction::LOGISTIC:
- dst[i] = (const_1 / (const_1 + exp(-x))).raw();
- break;
- case ActivationLayerInfo::ActivationFunction::RELU:
- dst[i] = max(const_0, x).raw();
- break;
- case ActivationLayerInfo::ActivationFunction::BOUNDED_RELU:
- dst[i] = min(a, max(const_0, x)).raw();
- break;
- case ActivationLayerInfo::ActivationFunction::LEAKY_RELU:
- dst[i] = (x > const_0) ? x.raw() : mul(a, x).raw();
- break;
- case ActivationLayerInfo::ActivationFunction::SOFT_RELU:
- dst[i] = log(const_1 + exp(x)).raw();
- break;
- case ActivationLayerInfo::ActivationFunction::SQRT:
- dst[i] = (const_1 / inv_sqrt(x)).raw();
- break;
- case ActivationLayerInfo::ActivationFunction::SQUARE:
- dst[i] = mul(x, x).raw();
- break;
- case ActivationLayerInfo::ActivationFunction::TANH:
- dst[i] = mul(a, tanh(mul(b, x))).raw();
- break;
- default:
- ARM_COMPUTE_ERROR("Unsupported activation function");
- }
- }
-
- return dst;
-}
-
-template SimpleTensor<float> activation_layer(const SimpleTensor<float> &src, ActivationLayerInfo info);
-template SimpleTensor<half_float::half> activation_layer(const SimpleTensor<half_float::half> &src, ActivationLayerInfo info);
-template SimpleTensor<qint8_t> activation_layer(const SimpleTensor<qint8_t> &src, ActivationLayerInfo info);
-template SimpleTensor<qint16_t> activation_layer(const SimpleTensor<qint16_t> &src, ActivationLayerInfo info);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CPP/ActivationLayer.h b/tests/validation_new/CPP/ActivationLayer.h
deleted file mode 100644
index 3f10a2f360..0000000000
--- a/tests/validation_new/CPP/ActivationLayer.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * 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_ACTIVATION_LAYER_H__
-#define __ARM_COMPUTE_TEST_ACTIVATION_LAYER_H__
-
-#include "tests/SimpleTensor.h"
-#include "tests/validation_new/Helpers.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-template <typename T, typename std::enable_if<is_floating_point<T>::value, int>::type = 0>
-SimpleTensor<T> activation_layer(const SimpleTensor<T> &src, ActivationLayerInfo info);
-
-template <typename T, typename std::enable_if<std::is_integral<T>::value, int>::type = 0>
-SimpleTensor<T> activation_layer(const SimpleTensor<T> &src, ActivationLayerInfo info);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* __ARM_COMPUTE_TEST_ACTIVATION_LAYER_H__ */
diff --git a/tests/validation_new/CPP/BitwiseAnd.cpp b/tests/validation_new/CPP/BitwiseAnd.cpp
deleted file mode 100644
index 6fc46b402b..0000000000
--- a/tests/validation_new/CPP/BitwiseAnd.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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 "BitwiseAnd.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-template <typename T>
-SimpleTensor<T> bitwise_and(const SimpleTensor<T> &src1, const SimpleTensor<T> &src2)
-{
- SimpleTensor<T> dst(src1.shape(), src1.data_type());
-
- for(int i = 0; i < src1.num_elements(); ++i)
- {
- dst[i] = src1[i] & src2[i];
- }
-
- return dst;
-}
-
-template SimpleTensor<uint8_t> bitwise_and(const SimpleTensor<uint8_t> &src1, const SimpleTensor<uint8_t> &src2);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CPP/BitwiseAnd.h b/tests/validation_new/CPP/BitwiseAnd.h
deleted file mode 100644
index eba2fd695f..0000000000
--- a/tests/validation_new/CPP/BitwiseAnd.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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_BITWISE_AND_H__
-#define __ARM_COMPUTE_TEST_BITWISE_AND_H__
-
-#include "tests/SimpleTensor.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-template <typename T>
-SimpleTensor<T> bitwise_and(const SimpleTensor<T> &src1, const SimpleTensor<T> &src2);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* __ARM_COMPUTE_TEST_BITWISE_AND_H__ */
diff --git a/tests/validation_new/CPP/BitwiseNot.cpp b/tests/validation_new/CPP/BitwiseNot.cpp
deleted file mode 100644
index 5a6a13b56c..0000000000
--- a/tests/validation_new/CPP/BitwiseNot.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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 "BitwiseNot.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-template <typename T>
-SimpleTensor<T> bitwise_not(const SimpleTensor<T> &src)
-{
- SimpleTensor<T> dst(src.shape(), src.data_type());
-
- for(int i = 0; i < src.num_elements(); ++i)
- {
- dst[i] = ~src[i];
- }
-
- return dst;
-}
-
-template SimpleTensor<uint8_t> bitwise_not(const SimpleTensor<uint8_t> &src);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CPP/BitwiseNot.h b/tests/validation_new/CPP/BitwiseNot.h
deleted file mode 100644
index b4206f9388..0000000000
--- a/tests/validation_new/CPP/BitwiseNot.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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_BITWISE_NOT_H__
-#define __ARM_COMPUTE_TEST_BITWISE_NOT_H__
-
-#include "tests/SimpleTensor.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-template <typename T>
-SimpleTensor<T> bitwise_not(const SimpleTensor<T> &src);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* __ARM_COMPUTE_TEST_BITWISE_NOT_H__ */
diff --git a/tests/validation_new/CPP/BitwiseOr.cpp b/tests/validation_new/CPP/BitwiseOr.cpp
deleted file mode 100644
index fc258d54f1..0000000000
--- a/tests/validation_new/CPP/BitwiseOr.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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 "BitwiseOr.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-template <typename T>
-SimpleTensor<T> bitwise_or(const SimpleTensor<T> &src1, const SimpleTensor<T> &src2)
-{
- SimpleTensor<T> dst(src1.shape(), src1.data_type());
-
- for(int i = 0; i < src1.num_elements(); ++i)
- {
- dst[i] = src1[i] | src2[i];
- }
-
- return dst;
-}
-
-template SimpleTensor<uint8_t> bitwise_or(const SimpleTensor<uint8_t> &src1, const SimpleTensor<uint8_t> &src2);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CPP/BitwiseOr.h b/tests/validation_new/CPP/BitwiseOr.h
deleted file mode 100644
index 39158cb411..0000000000
--- a/tests/validation_new/CPP/BitwiseOr.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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_BITWISE_OR_H__
-#define __ARM_COMPUTE_TEST_BITWISE_OR_H__
-
-#include "tests/SimpleTensor.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-template <typename T>
-SimpleTensor<T> bitwise_or(const SimpleTensor<T> &src1, const SimpleTensor<T> &src2);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* __ARM_COMPUTE_TEST_BITWISE_OR_H__ */
diff --git a/tests/validation_new/CPP/BitwiseXor.cpp b/tests/validation_new/CPP/BitwiseXor.cpp
deleted file mode 100644
index b8d275d8b5..0000000000
--- a/tests/validation_new/CPP/BitwiseXor.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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 "BitwiseXor.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-template <typename T>
-SimpleTensor<T> bitwise_xor(const SimpleTensor<T> &src1, const SimpleTensor<T> &src2)
-{
- SimpleTensor<T> dst(src1.shape(), src1.data_type());
-
- for(int i = 0; i < src1.num_elements(); ++i)
- {
- dst[i] = src1[i] ^ src2[i];
- }
-
- return dst;
-}
-
-template SimpleTensor<uint8_t> bitwise_xor(const SimpleTensor<uint8_t> &src1, const SimpleTensor<uint8_t> &src2);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CPP/BitwiseXor.h b/tests/validation_new/CPP/BitwiseXor.h
deleted file mode 100644
index 3e7721e843..0000000000
--- a/tests/validation_new/CPP/BitwiseXor.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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_BITWISE_XOR_H__
-#define __ARM_COMPUTE_TEST_BITWISE_XOR_H__
-
-#include "tests/SimpleTensor.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-template <typename T>
-SimpleTensor<T> bitwise_xor(const SimpleTensor<T> &src1, const SimpleTensor<T> &src2);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* __ARM_COMPUTE_TEST_BITWISE_XOR_H__ */
diff --git a/tests/validation_new/CPP/ConvolutionLayer.cpp b/tests/validation_new/CPP/ConvolutionLayer.cpp
deleted file mode 100644
index a24621a3f2..0000000000
--- a/tests/validation_new/CPP/ConvolutionLayer.cpp
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * 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 "ConvolutionLayer.h"
-
-#include "tests/validation_new/FixedPoint.h"
-#include "tests/validation_new/Helpers.h"
-#include "tests/validation_new/half.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-namespace
-{
-inline bool is_valid_pixel(int i, int min, int max)
-{
- return (i >= min && i < max);
-}
-
-// 3D convolution for floating point type
-template <typename T, typename std::enable_if<is_floating_point<T>::value, int>::type = 0>
-void convolution3d(const T *in, const T *weights, const T *bias, T *out, int xi, int yi, int width_in, int height_in, int depth_in, int width_weights, int height_weights, int fixed_point_position)
-{
- ARM_COMPUTE_UNUSED(fixed_point_position);
-
- const int half_width_weights = width_weights / 2;
- const int half_height_weights = height_weights / 2;
-
- // Reset accumulator
- T acc(0);
-
- // Compute a 2D convolution for each IFM and accumulate the result
- for(int ifm = 0; ifm < depth_in; ++ifm)
- {
- // Compute the offset for the input slice
- const int offset_slice_in = xi + yi * width_in + ifm * width_in * height_in;
-
- // Compute 2D convolution
- for(int yk = -half_height_weights; yk <= half_height_weights; ++yk)
- {
- for(int xk = -half_width_weights; xk <= half_width_weights; ++xk)
- {
- // Check if the pixel is out-of-bound
- if(is_valid_pixel(xi + xk, 0, width_in) && is_valid_pixel(yi + yk, 0, height_in))
- {
- const int idx = xk + half_width_weights;
- const int idy = yk + half_height_weights;
-
- const T i_value = in[offset_slice_in + xk + yk * width_in];
- const T w_value = weights[idx + idy * width_weights + ifm * width_weights * height_weights];
-
- acc += i_value * w_value;
- }
- }
- }
- }
-
- // Accumulate the bias and store the result
- *out = acc + (*bias);
-}
-
-// 3D convolution for fixed point type
-template <typename T, typename std::enable_if<std::is_integral<T>::value, int>::type = 0>
-void convolution3d(const T *in, const T *weights, const T *bias, T *out, int xi, int yi, int width_in, int height_in, int depth_in, int width_weights, int height_weights,
- int fixed_point_position)
-{
- const int half_width_weights = width_weights / 2;
- const int half_height_weights = height_weights / 2;
-
- using namespace fixed_point_arithmetic;
- using promoted_type = fixed_point_arithmetic::traits::promote_t<T>;
-
- // Reset accumulator
- fixed_point<promoted_type> acc(0, fixed_point_position);
-
- // Compute a 2D convolution for each IFM and accumulate the result
- for(int ifm = 0; ifm < depth_in; ++ifm)
- {
- // Compute the offset for the input slice
- const int offset_slice_in = xi + yi * width_in + ifm * width_in * height_in;
-
- // Compute 2D convolution
- for(int yk = -half_height_weights; yk <= half_height_weights; ++yk)
- {
- for(int xk = -half_width_weights; xk <= half_width_weights; ++xk)
- {
- // Check if the pixel is out-of-bound
- if(is_valid_pixel(xi + xk, 0, width_in) && is_valid_pixel(yi + yk, 0, height_in))
- {
- const int idx = xk + half_width_weights;
- const int idy = yk + half_height_weights;
-
- const fixed_point<promoted_type> i_value(in[offset_slice_in + xk + yk * width_in], fixed_point_position, true);
- const fixed_point<promoted_type> w_value(weights[idx + idy * width_weights + ifm * width_weights * height_weights], fixed_point_position, true);
- const fixed_point<promoted_type> iw = i_value * w_value;
- acc = iw + acc;
- }
- }
- }
- }
-
- // Get the bias
- const fixed_point<promoted_type> b(*bias, fixed_point_position, true);
-
- // Accumulate the bias and covert back
- acc = acc + b;
- fixed_point<T> res(acc);
- *out = res.raw();
-}
-} // namespace
-
-template <typename T>
-SimpleTensor<T> convolution_layer(const SimpleTensor<T> &src, const SimpleTensor<T> &weights, const SimpleTensor<T> &bias, const TensorShape &output_shape, const PadStrideInfo &info)
-{
- // Create reference
- SimpleTensor<T> dst{ output_shape, src.data_type(), 1, src.fixed_point_position() };
-
- // Compute reference
- const int width_in = src.shape().x();
- const int height_in = src.shape().y();
- const int depth_in = src.shape().z();
- const int width_out = dst.shape().x();
- const int height_out = dst.shape().y();
- const int depth_out = dst.shape().z();
- const int width_weights = weights.shape().x();
- const int height_weights = weights.shape().y();
- const int depth_weights = weights.shape().z();
- const int pad_xi = std::min(static_cast<int>(info.pad().first), width_weights / 2);
- const int pad_yi = std::min(static_cast<int>(info.pad().second), height_weights / 2);
- const int start_xi = width_weights / 2 - pad_xi;
- const int start_yi = height_weights / 2 - pad_yi;
- const int end_xi = width_in - start_xi;
- const int end_yi = height_in - start_yi;
- const int stride_xi = info.stride().first;
- const int stride_yi = info.stride().second;
- const int num_batches = src.shape().total_size() / (width_in * height_in * depth_in);
-
- for(int r = 0; r < num_batches; ++r)
- {
- for(int yi = start_yi; yi < end_yi; yi += stride_yi)
- {
- for(int xi = start_xi; xi < end_xi; xi += stride_xi)
- {
- for(int ofm = 0; ofm < depth_out; ++ofm)
- {
- // Compute input and output offsets
- const int offset_in = r * width_in * height_in * depth_in;
- const int xo = (xi - start_xi) / stride_xi;
- const int yo = (yi - start_yi) / stride_yi;
- const int offset_out = xo + yo * width_out + ofm * width_out * height_out + r * width_out * height_out * depth_out;
-
- // Compute 3D convolution
- convolution3d(src.data() + offset_in,
- weights.data() + ofm * width_weights * height_weights * depth_weights,
- bias.data() + ofm,
- dst.data() + offset_out,
- xi, yi,
- width_in, height_in, depth_in,
- width_weights, height_weights,
- src.fixed_point_position());
- }
- }
- }
- }
-
- return dst;
-}
-
-template SimpleTensor<float> convolution_layer(const SimpleTensor<float> &src, const SimpleTensor<float> &weights, const SimpleTensor<float> &bias, const TensorShape &output_shape,
- const PadStrideInfo &info);
-template SimpleTensor<half_float::half> convolution_layer(const SimpleTensor<half_float::half> &src, const SimpleTensor<half_float::half> &weights, const SimpleTensor<half_float::half> &bias,
- const TensorShape &output_shape, const PadStrideInfo &info);
-template SimpleTensor<qint8_t> convolution_layer(const SimpleTensor<qint8_t> &src, const SimpleTensor<qint8_t> &weights, const SimpleTensor<qint8_t> &bias, const TensorShape &output_shape,
- const PadStrideInfo &info);
-template SimpleTensor<qint16_t> convolution_layer(const SimpleTensor<qint16_t> &src, const SimpleTensor<qint16_t> &weights, const SimpleTensor<qint16_t> &bias, const TensorShape &output_shape,
- const PadStrideInfo &info);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CPP/ConvolutionLayer.h b/tests/validation_new/CPP/ConvolutionLayer.h
deleted file mode 100644
index a7c9e086a4..0000000000
--- a/tests/validation_new/CPP/ConvolutionLayer.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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_CONVOLUTION_LAYER_H__
-#define __ARM_COMPUTE_TEST_CONVOLUTION_LAYER_H__
-
-#include "tests/SimpleTensor.h"
-#include "tests/validation_new/Helpers.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-template <typename T>
-SimpleTensor<T> convolution_layer(const SimpleTensor<T> &src, const SimpleTensor<T> &weights, const SimpleTensor<T> &bias, const TensorShape &output_shape, const PadStrideInfo &info);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* __ARM_COMPUTE_TEST_CONVOLUTION_LAYER_H__ */
diff --git a/tests/validation_new/CPP/DepthConcatenateLayer.cpp b/tests/validation_new/CPP/DepthConcatenateLayer.cpp
deleted file mode 100644
index c54c6c8568..0000000000
--- a/tests/validation_new/CPP/DepthConcatenateLayer.cpp
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * 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 "DepthConcatenateLayer.h"
-
-#include "tests/validation_new/FixedPoint.h"
-#include "tests/validation_new/Helpers.h"
-#include "tests/validation_new/half.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-template <typename T>
-SimpleTensor<T> depthconcatenate_layer(const std::vector<SimpleTensor<T>> &srcs)
-{
- // Create reference
- std::vector<TensorShape> shapes;
-
- for(const auto &src : srcs)
- {
- shapes.emplace_back(src.shape());
- }
-
- DataType dst_type = srcs.empty() ? DataType::UNKNOWN : srcs[0].data_type();
- TensorShape dst_shape = calculate_depth_concatenate_shape(shapes);
- SimpleTensor<T> dst(dst_shape, dst_type);
-
- // Compute reference
- int depth_offset = 0;
- const int width_out = dst.shape().x();
- const int height_out = dst.shape().y();
- const int depth_out = dst.shape().z();
- const int out_stride_z = width_out * height_out;
- const int batches = dst.shape().total_size_upper(3);
-
- // Set output tensor to 0
- std::fill_n(dst.data(), dst.num_elements(), 0);
-
- for(const auto &src : srcs)
- {
- ARM_COMPUTE_ERROR_ON(depth_offset >= depth_out);
- ARM_COMPUTE_ERROR_ON(batches != static_cast<int>(src.shape().total_size_upper(3)));
-
- const int width = src.shape().x();
- const int height = src.shape().y();
- const int depth = src.shape().z();
- const int x_diff = (width_out - width) / 2;
- const int y_diff = (height_out - height) / 2;
-
- const T *src_ptr = src.data();
-
- for(int b = 0; b < batches; ++b)
- {
- const size_t offset_to_first_element = b * out_stride_z * depth_out + depth_offset * out_stride_z + y_diff * width_out + x_diff;
-
- for(int d = 0; d < depth; ++d)
- {
- for(int r = 0; r < height; ++r)
- {
- std::copy(src_ptr, src_ptr + width, dst.data() + offset_to_first_element + d * out_stride_z + r * width_out);
- src_ptr += width;
- }
- }
- }
-
- depth_offset += depth;
- }
-
- return dst;
-}
-
-template SimpleTensor<float> depthconcatenate_layer(const std::vector<SimpleTensor<float>> &srcs);
-template SimpleTensor<half_float::half> depthconcatenate_layer(const std::vector<SimpleTensor<half_float::half>> &srcs);
-template SimpleTensor<qint8_t> depthconcatenate_layer(const std::vector<SimpleTensor<qint8_t>> &srcs);
-template SimpleTensor<qint16_t> depthconcatenate_layer(const std::vector<SimpleTensor<qint16_t>> &srcs);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CPP/DepthConcatenateLayer.h b/tests/validation_new/CPP/DepthConcatenateLayer.h
deleted file mode 100644
index 3c486a8015..0000000000
--- a/tests/validation_new/CPP/DepthConcatenateLayer.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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_DEPTHCONCATENATE_LAYER_H__
-#define __ARM_COMPUTE_TEST_DEPTHCONCATENATE_LAYER_H__
-
-#include "tests/SimpleTensor.h"
-
-#include <vector>
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-template <typename T>
-SimpleTensor<T> depthconcatenate_layer(const std::vector<SimpleTensor<T>> &srcs);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* __ARM_COMPUTE_TEST_DEPTHCONCATENATE_LAYER_H__ */
diff --git a/tests/validation_new/CPP/DepthwiseConvolution.cpp b/tests/validation_new/CPP/DepthwiseConvolution.cpp
deleted file mode 100644
index 8c5cec596e..0000000000
--- a/tests/validation_new/CPP/DepthwiseConvolution.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * 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 "DepthwiseConvolution.h"
-
-#include "ConvolutionLayer.h"
-#include "Utils.h"
-
-#include "tests/validation_new/Helpers.h"
-#include "tests/validation_new/half.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-/** Perform a depthwise convolution
- *
- * - Three dimensions tensors
- * - Third dimention is number of channels
- * - Depths of input tensor and filter are equals
- * - Padding, stride and output shape "match"
- *
- */
-template <typename T>
-SimpleTensor<T> depthwise_convolution(const SimpleTensor<T> &src, const SimpleTensor<T> &weights, const TensorShape &dst_shape, const PadStrideInfo &conv_info)
-{
- // Create reference
- SimpleTensor<T> dst{ dst_shape, src.data_type(), 1, src.fixed_point_position() };
-
- // Compute reference
- const size_t filter_width = weights.shape().x();
- const size_t filter_height = weights.shape().y();
- const size_t filter_plane = filter_width * filter_height;
- const size_t input_width = src.shape().x();
- const size_t input_height = src.shape().y();
- const size_t input_depth = src.shape().z();
-
- const size_t filter_half_size = filter_width / 2;
- const size_t pad_x = std::min(filter_half_size, static_cast<size_t>(conv_info.pad().first));
- const size_t pad_y = std::min(filter_half_size, static_cast<size_t>(conv_info.pad().second));
- const size_t minimum_x = -pad_x + filter_half_size;
- const size_t minimum_y = -pad_y + filter_half_size;
-
- int out_pos = 0;
- for(size_t z = 0; z < input_depth; ++z)
- {
- for(size_t y = minimum_y; y < input_height + pad_y - filter_half_size; y += conv_info.stride().second)
- {
- for(size_t x = minimum_x; x < input_width + pad_x - filter_half_size; x += conv_info.stride().first)
- {
- Coordinates coords(static_cast<int>(x), static_cast<int>(y), static_cast<int>(z));
- size_t filter_offset = filter_plane * z;
-
- T val = 0;
- for(int j = y - filter_half_size; j <= static_cast<int>(y + filter_half_size); ++j)
- {
- for(int i = x - filter_half_size; i <= static_cast<int>(x + filter_half_size); ++i)
- {
- coords.set(0, i);
- coords.set(1, j);
- val += *(weights.data() + filter_offset) * tensor_elem_at(src, coords, BorderMode::CONSTANT, 0.f);
- ++filter_offset;
- }
- }
- coords.set(0, x);
- coords.set(1, y);
- dst[out_pos++] = saturate_cast<T>(val);
- }
- }
- }
-
- return dst;
-}
-
-template SimpleTensor<float> depthwise_convolution(const SimpleTensor<float> &src, const SimpleTensor<float> &weights, const TensorShape &dst_shape, const PadStrideInfo &conv_info);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CPP/DepthwiseConvolution.h b/tests/validation_new/CPP/DepthwiseConvolution.h
deleted file mode 100644
index 4a92620880..0000000000
--- a/tests/validation_new/CPP/DepthwiseConvolution.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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_DEPTHWISE_CONVOLUTION_H__
-#define __ARM_COMPUTE_TEST_DEPTHWISE_CONVOLUTION_H__
-
-#include "tests/SimpleTensor.h"
-#include "tests/validation_new/Helpers.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-template <typename T>
-SimpleTensor<T> depthwise_convolution(const SimpleTensor<T> &src, const SimpleTensor<T> &weights, const TensorShape &dst_shape, const PadStrideInfo &conv_info);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* __ARM_COMPUTE_TEST_DEPTHWISE_SEPARABLE_CONVOLUTION_LAYER_H__ */
diff --git a/tests/validation_new/CPP/DepthwiseSeparableConvolutionLayer.cpp b/tests/validation_new/CPP/DepthwiseSeparableConvolutionLayer.cpp
deleted file mode 100644
index eba0a19189..0000000000
--- a/tests/validation_new/CPP/DepthwiseSeparableConvolutionLayer.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * 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 "DepthwiseConvolution.h"
-
-#include "DepthwiseSeparableConvolutionLayer.h"
-
-#include "ConvolutionLayer.h"
-#include "Utils.h"
-
-#include "tests/validation_new/Helpers.h"
-#include "tests/validation_new/half.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-// Depthwise separable convolution layer
-template <typename T>
-SimpleTensor<T> depthwise_separable_convolution_layer(const SimpleTensor<T> &src, const SimpleTensor<T> &depthwise_weights, const TensorShape &depthwise_out_shape,
- const SimpleTensor<T> &pointwise_weights,
- const SimpleTensor<T> &biases, const TensorShape &dst_shape, const PadStrideInfo &depthwise_conv_info, const PadStrideInfo &pointwise_conv_info)
-{
- // Compute reference
- SimpleTensor<T> depthwise_out = depthwise_convolution(src, depthwise_weights, depthwise_out_shape, depthwise_conv_info);
- SimpleTensor<T> dst = convolution_layer(depthwise_out, pointwise_weights, biases, dst_shape, pointwise_conv_info);
-
- return dst;
-}
-
-template SimpleTensor<float> depthwise_separable_convolution_layer(const SimpleTensor<float> &in, const SimpleTensor<float> &depthwise_weights, const TensorShape &depthwise_out_shape,
- const SimpleTensor<float> &pointwise_weights, const SimpleTensor<float> &biases, const TensorShape &dst_shape, const PadStrideInfo &depthwise_conv_info, const PadStrideInfo &pointwise_conv_info);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CPP/DepthwiseSeparableConvolutionLayer.h b/tests/validation_new/CPP/DepthwiseSeparableConvolutionLayer.h
deleted file mode 100644
index 0c9f118b84..0000000000
--- a/tests/validation_new/CPP/DepthwiseSeparableConvolutionLayer.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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_DEPTHWISE_SEPARABLE_CONVOLUTION_LAYER_H__
-#define __ARM_COMPUTE_TEST_DEPTHWISE_SEPARABLE_CONVOLUTION_LAYER_H__
-
-#include "tests/SimpleTensor.h"
-#include "tests/validation_new/Helpers.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-template <typename T>
-SimpleTensor<T> depthwise_separable_convolution_layer(const SimpleTensor<T> &src, const SimpleTensor<T> &depthwise_weights, const TensorShape &depthwise_out_shape,
- const SimpleTensor<T> &pointwise_weights,
- const SimpleTensor<T> &biases, const TensorShape &dst_shape, const PadStrideInfo &depthwise_conv_info, const PadStrideInfo &pointwise_conv_info);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* __ARM_COMPUTE_TEST_DEPTHWISE_SEPARABLE_CONVOLUTION_LAYER_H__ */
diff --git a/tests/validation_new/CPP/DequantizationLayer.cpp b/tests/validation_new/CPP/DequantizationLayer.cpp
deleted file mode 100644
index 1c7ec25255..0000000000
--- a/tests/validation_new/CPP/DequantizationLayer.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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 "DequantizationLayer.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-template <typename T, typename std::enable_if<std::is_integral<T>::value, int>::type>
-SimpleTensor<float> dequantization_layer(const SimpleTensor<T> &src, float min, float max)
-{
- // Create reference
- SimpleTensor<float> dst{ src.shape(), DataType::F32 };
-
- const float range = max - min;
- const float scaling = range / 255.0f;
-
- for(int i = 0; i < src.num_elements(); ++i)
- {
- dst[i] = (static_cast<float>(src[i]) * scaling) + min;
- }
-
- return dst;
-}
-
-template SimpleTensor<float> dequantization_layer(const SimpleTensor<uint8_t> &src, float min, float max);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CPP/DequantizationLayer.h b/tests/validation_new/CPP/DequantizationLayer.h
deleted file mode 100644
index 33592b89b8..0000000000
--- a/tests/validation_new/CPP/DequantizationLayer.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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_DEQUANTIZATION_LAYER_H__
-#define __ARM_COMPUTE_TEST_DEQUANTIZATION_LAYER_H__
-
-#include "tests/SimpleTensor.h"
-#include "tests/validation_new/Helpers.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-template <typename T, typename std::enable_if<std::is_integral<T>::value, int>::type = 0>
-SimpleTensor<float> dequantization_layer(const SimpleTensor<T> &src, float min, float max);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* __ARM_COMPUTE_TEST_DEQUANTIZATION_LAYER_H__ */
diff --git a/tests/validation_new/CPP/Floor.cpp b/tests/validation_new/CPP/Floor.cpp
deleted file mode 100644
index aed4fecd01..0000000000
--- a/tests/validation_new/CPP/Floor.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 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 "Floor.h"
-
-#include "tests/validation_new/Helpers.h"
-
-#include <cmath>
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-template <typename T>
-SimpleTensor<T> floor_layer(const SimpleTensor<T> &src)
-{
- // Create reference
- SimpleTensor<T> dst{ src.shape(), src.data_type() };
-
- // Compute reference
- for(int i = 0; i < src.num_elements(); ++i)
- {
- dst[i] = std::floor(src[i]);
- }
-
- return dst;
-}
-
-template SimpleTensor<float> floor_layer(const SimpleTensor<float> &src);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CPP/Floor.h b/tests/validation_new/CPP/Floor.h
deleted file mode 100644
index 30b8118622..0000000000
--- a/tests/validation_new/CPP/Floor.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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_FLOOR_H__
-#define __ARM_COMPUTE_TEST_FLOOR_H__
-
-#include "tests/SimpleTensor.h"
-#include "tests/validation_new/Helpers.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-template <typename T>
-SimpleTensor<T> floor_layer(const SimpleTensor<T> &src);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* __ARM_COMPUTE_TEST_FLOOR_H__ */
diff --git a/tests/validation_new/CPP/FullyConnectedLayer.cpp b/tests/validation_new/CPP/FullyConnectedLayer.cpp
deleted file mode 100644
index 7852dab27b..0000000000
--- a/tests/validation_new/CPP/FullyConnectedLayer.cpp
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * 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 "FullyConnectedLayer.h"
-
-#include "tests/validation_new/FixedPoint.h"
-#include "tests/validation_new/half.h"
-
-#include <numeric>
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-namespace
-{
-// Vector matrix multiply for floating point
-template <typename T, typename std::enable_if<is_floating_point<T>::value, int>::type = 0>
-void vector_matrix_multiply(const T *src, const T *weights, const T *bias, T *dst, int cols_weights, int rows_weights, uint8_t fixed_point_position)
-{
- ARM_COMPUTE_UNUSED(fixed_point_position);
-
- for(int y = 0; y < rows_weights; ++y)
- {
- dst[y] = std::inner_product(src, src + cols_weights, weights, static_cast<T>(0)) + bias[y];
- weights += cols_weights;
- }
-}
-
-// Vector matrix multiply for fixed point type
-template <typename T, typename std::enable_if<std::is_integral<T>::value, int>::type = 0>
-void vector_matrix_multiply(const T *src, const T *weights, const T *bias, T *dst, int cols_weights, int rows_weights, uint8_t fixed_point_position)
-{
- using namespace fixed_point_arithmetic;
- using promoted_type = fixed_point_arithmetic::traits::promote_t<T>;
-
- for(int y = 0; y < rows_weights; ++y)
- {
- // Reset accumulator
- fixed_point<promoted_type> acc(0, fixed_point_position);
-
- for(int x = 0; x < cols_weights; ++x)
- {
- const fixed_point<promoted_type> i_value(src[x], fixed_point_position, true);
- const fixed_point<promoted_type> w_value(weights[x], fixed_point_position, true);
- acc = acc + i_value * w_value;
- }
-
- // Get the bias
- const fixed_point<T> b(bias[y], fixed_point_position, true);
-
- // Convert back and accumulate the bias
- fixed_point<T> res(acc);
- res = res + b;
-
- // Store the result
- dst[y] = res.raw();
-
- weights += cols_weights;
- }
-}
-} // namespace
-
-template <typename T>
-SimpleTensor<T> fully_connected_layer(const SimpleTensor<T> &src, const SimpleTensor<T> &weights, const SimpleTensor<T> &bias, const TensorShape &dst_shape)
-{
- // Create reference
- SimpleTensor<T> dst{ TensorShape{ dst_shape }, src.data_type(), 1, src.fixed_point_position() };
-
- // Sanity checks
- const int num_batch_dimensions = std::max(0, static_cast<int>(dst_shape.num_dimensions()) - 1);
- const int num_input_dimensions = src.shape().num_dimensions() - num_batch_dimensions;
- const unsigned int linear_input_size = src.shape().total_size_lower(num_input_dimensions);
-
- ARM_COMPUTE_UNUSED(num_batch_dimensions);
- ARM_COMPUTE_UNUSED(num_input_dimensions);
- ARM_COMPUTE_UNUSED(linear_input_size);
- ARM_COMPUTE_ERROR_ON(weights.shape().x() != linear_input_size);
- ARM_COMPUTE_ERROR_ON(weights.shape().y() != bias.shape().x());
- ARM_COMPUTE_ERROR_ON(weights.shape().y() != dst.shape().x());
-
- // Compute reference
- const int cols_weights = weights.shape().x();
- const int rows_weights = weights.shape().y();
- const int num_batches = dst_shape.total_size_upper(1);
-
- for(int k = 0; k < num_batches; ++k)
- {
- vector_matrix_multiply<T>(src.data() + k * cols_weights,
- weights.data(),
- bias.data(),
- dst.data() + k * rows_weights,
- cols_weights,
- rows_weights,
- src.fixed_point_position());
- }
-
- return dst;
-}
-
-template SimpleTensor<float> fully_connected_layer(const SimpleTensor<float> &src, const SimpleTensor<float> &weights, const SimpleTensor<float> &bias, const TensorShape &dst_shape);
-template SimpleTensor<half_float::half> fully_connected_layer(const SimpleTensor<half_float::half> &src, const SimpleTensor<half_float::half> &weights, const SimpleTensor<half_float::half> &bias,
- const TensorShape &dst_shape);
-template SimpleTensor<qint8_t> fully_connected_layer(const SimpleTensor<qint8_t> &src, const SimpleTensor<qint8_t> &weights, const SimpleTensor<qint8_t> &bias, const TensorShape &dst_shape);
-template SimpleTensor<qint16_t> fully_connected_layer(const SimpleTensor<qint16_t> &src, const SimpleTensor<qint16_t> &weights, const SimpleTensor<qint16_t> &bias, const TensorShape &dst_shape);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CPP/FullyConnectedLayer.h b/tests/validation_new/CPP/FullyConnectedLayer.h
deleted file mode 100644
index 5d62179f57..0000000000
--- a/tests/validation_new/CPP/FullyConnectedLayer.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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_FULLY_CONNECTED_LAYER_H__
-#define __ARM_COMPUTE_TEST_FULLY_CONNECTED_LAYER_H__
-
-#include "tests/SimpleTensor.h"
-#include "tests/validation_new/Helpers.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-template <typename T>
-SimpleTensor<T> fully_connected_layer(const SimpleTensor<T> &src, const SimpleTensor<T> &weights, const SimpleTensor<T> &bias, const TensorShape &dst_shape);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* __ARM_COMPUTE_TEST_FULLY_CONNECTED_LAYER_H__ */
diff --git a/tests/validation_new/CPP/GEMM.cpp b/tests/validation_new/CPP/GEMM.cpp
deleted file mode 100644
index 424633f8e7..0000000000
--- a/tests/validation_new/CPP/GEMM.cpp
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * 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 "GEMM.h"
-
-#include "tests/validation_new/FixedPoint.h"
-#include "tests/validation_new/half.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-template <typename T, typename std::enable_if<is_floating_point<T>::value, int>::type>
-SimpleTensor<T> gemm(const SimpleTensor<T> &a, const SimpleTensor<T> &b, const SimpleTensor<T> &c, float alpha, float beta)
-{
- // Create reference
- SimpleTensor<T> dst{ c.shape(), c.data_type(), 1, c.fixed_point_position() };
-
- // Compute reference
- const int M = dst.shape().y();
- const int N = dst.shape().x();
- const int K = a.shape().x();
-
- for(int row = 0; row < M; ++row)
- {
- for(int col = 0; col < N; ++col)
- {
- T acc(0);
-
- for(int k = 0; k < K; ++k)
- {
- acc += a[row * K + k] * b[k * N + col];
- }
-
- // Finalize the result: alpha * A * B + beta * C
- dst[col + row * N] = alpha * acc + beta * c[col + row * N];
- }
- }
-
- return dst;
-}
-
-template <typename T, typename std::enable_if<std::is_integral<T>::value, int>::type>
-SimpleTensor<T> gemm(const SimpleTensor<T> &a, const SimpleTensor<T> &b, const SimpleTensor<T> &c, float alpha, float beta)
-{
- using namespace fixed_point_arithmetic;
-
- // Create reference
- SimpleTensor<T> dst{ c.shape(), c.data_type(), 1, c.fixed_point_position() };
-
- // Compute reference
- using promoted_type = fixed_point_arithmetic::traits::promote_t<T>;
-
- const int M = dst.shape().y();
- const int N = dst.shape().x();
- const int K = a.shape().x();
- const int fixed_point_position = a.fixed_point_position();
-
- const fixed_point<T> alpha_q(alpha, fixed_point_position);
- const fixed_point<T> beta_q(beta, fixed_point_position);
-
- for(int row = 0; row < M; ++row)
- {
- for(int col = 0; col < N; ++col)
- {
- fixed_point<promoted_type> acc_q(0, fixed_point_position);
-
- for(int k = 0; k < K; ++k)
- {
- const fixed_point<promoted_type> a0_q(a[row * K + k], fixed_point_position, true);
- const fixed_point<promoted_type> b0_q(b[k * N + col], fixed_point_position, true);
-
- acc_q = acc_q + (a0_q * b0_q);
- }
-
- // Finalize the result: alpha * A * B + beta * C
- const fixed_point<T> c0_q(c[col + row * N], fixed_point_position, true);
-
- fixed_point<T> res_q(acc_q);
- res_q = alpha_q * res_q;
- res_q = res_q + (beta_q * c0_q);
-
- // Store the result
- dst[col + row * N] = res_q.raw();
- }
- }
-
- return dst;
-}
-
-template SimpleTensor<float> gemm(const SimpleTensor<float> &a, const SimpleTensor<float> &b, const SimpleTensor<float> &c, float alpha, float beta);
-template SimpleTensor<half_float::half> gemm(const SimpleTensor<half_float::half> &a, const SimpleTensor<half_float::half> &b, const SimpleTensor<half_float::half> &c, float alpha, float beta);
-template SimpleTensor<qint8_t> gemm(const SimpleTensor<qint8_t> &a, const SimpleTensor<qint8_t> &b, const SimpleTensor<qint8_t> &c, float alpha, float beta);
-template SimpleTensor<qint16_t> gemm(const SimpleTensor<qint16_t> &a, const SimpleTensor<qint16_t> &b, const SimpleTensor<qint16_t> &c, float alpha, float beta);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CPP/GEMM.h b/tests/validation_new/CPP/GEMM.h
deleted file mode 100644
index 7fea2a9862..0000000000
--- a/tests/validation_new/CPP/GEMM.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * 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_GEMM_H__
-#define __ARM_COMPUTE_TEST_GEMM_H__
-
-#include "tests/SimpleTensor.h"
-#include "tests/validation_new/Helpers.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-template <typename T, typename std::enable_if<is_floating_point<T>::value, int>::type = 0>
-SimpleTensor<T> gemm(const SimpleTensor<T> &a, const SimpleTensor<T> &b, const SimpleTensor<T> &c, float alpha, float beta);
-
-template <typename T, typename std::enable_if<std::is_integral<T>::value, int>::type = 0>
-SimpleTensor<T> gemm(const SimpleTensor<T> &a, const SimpleTensor<T> &b, const SimpleTensor<T> &c, float alpha, float beta);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* __ARM_COMPUTE_TEST_GEMM_H__ */
diff --git a/tests/validation_new/CPP/L2Normalize.cpp b/tests/validation_new/CPP/L2Normalize.cpp
deleted file mode 100644
index f423702819..0000000000
--- a/tests/validation_new/CPP/L2Normalize.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * 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 "L2Normalize.h"
-#include "ReductionOperation.h"
-
-#include "tests/validation_new/Helpers.h"
-
-#include <algorithm>
-#include <cmath>
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-namespace
-{
-TensorShape get_output_shape(TensorShape shape, unsigned int axis)
-{
- TensorShape output_shape(shape);
- output_shape.set(axis, 1);
- return output_shape;
-}
-} // namespace
-
-template <typename T>
-SimpleTensor<T> l2_normalize(const SimpleTensor<T> &src, unsigned int axis, float epsilon)
-{
- // Create reference
- SimpleTensor<T> dst{ src.shape(), src.data_type() };
-
- // Reduce across given axis
- SimpleTensor<T> sum = reduction_operation(src, get_output_shape(src.shape(), axis), axis, ReductionOperation::SUM_SQUARE);
-
- // Compute reference
- const int elems = src.shape()[axis];
- const int upper_dims = src.shape().total_size_upper(axis + 1);
-
- for(int du = 0; du < upper_dims; ++du)
- {
- if(axis == 0)
- {
- const T *src_row_ptr = src.data() + du * elems;
- T *dst_row_ptr = dst.data() + du * elems;
- const T normalization_value = std::sqrt(std::max(sum[du], epsilon));
- std::transform(src_row_ptr, src_row_ptr + elems, dst_row_ptr, [normalization_value](T val)
- {
- return val / normalization_value;
- });
- }
- else
- {
- ARM_COMPUTE_ERROR("Unsupported normalization axis");
- }
- }
-
- return dst;
-}
-
-template SimpleTensor<float> l2_normalize(const SimpleTensor<float> &src, unsigned int axis, float epsilon);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CPP/L2Normalize.h b/tests/validation_new/CPP/L2Normalize.h
deleted file mode 100644
index da36a73bba..0000000000
--- a/tests/validation_new/CPP/L2Normalize.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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_L2NORMALIZE_H__
-#define __ARM_COMPUTE_TEST_L2NORMALIZE_H__
-
-#include "tests/SimpleTensor.h"
-#include "tests/validation_new/Helpers.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-template <typename T>
-SimpleTensor<T> l2_normalize(const SimpleTensor<T> &src, unsigned int axis, float epsilon);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* __ARM_COMPUTE_TEST_L2NORMALIZE_H__ */
diff --git a/tests/validation_new/CPP/MeanStdDev.cpp b/tests/validation_new/CPP/MeanStdDev.cpp
deleted file mode 100644
index 4a39b13d56..0000000000
--- a/tests/validation_new/CPP/MeanStdDev.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 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 "MeanStdDev.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-template <typename T>
-std::pair<float, float> mean_and_standard_deviation(const SimpleTensor<T> &in)
-{
- const int num_elements = in.num_elements();
-
- // Calculate mean
- float mean = std::accumulate(in.data(), in.data() + num_elements, 0.f) / num_elements;
-
- // Calculate standard deviation
- float std_dev = std::accumulate(in.data(), in.data() + num_elements, 0.f, [&mean](float a, float b)
- {
- return a + (mean - b) * (mean - b);
- });
-
- std_dev = std::sqrt(std_dev / num_elements);
-
- return std::make_pair(mean, std_dev);
-}
-
-template std::pair<float, float> mean_and_standard_deviation(const SimpleTensor<uint8_t> &in);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CPP/MeanStdDev.h b/tests/validation_new/CPP/MeanStdDev.h
deleted file mode 100644
index 6b89ae0656..0000000000
--- a/tests/validation_new/CPP/MeanStdDev.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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_STD_MEAN_DEV_H__
-#define __ARM_COMPUTE_TEST_STD_MEAN_DEV_H__
-
-#include "tests/SimpleTensor.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-template <typename T>
-std::pair<float, float> mean_and_standard_deviation(const SimpleTensor<T> &in);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* __ARM_COMPUTE_TEST_STD_MEAN_DEV_H__ */
diff --git a/tests/validation_new/CPP/NormalizationLayer.cpp b/tests/validation_new/CPP/NormalizationLayer.cpp
deleted file mode 100644
index a8818d8b5c..0000000000
--- a/tests/validation_new/CPP/NormalizationLayer.cpp
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * 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 "NormalizationLayer.h"
-
-#include "tests/validation_new/FixedPoint.h"
-#include "tests/validation_new/half.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-template <typename T, typename std::enable_if<is_floating_point<T>::value, int>::type>
-SimpleTensor<T> normalization_layer(const SimpleTensor<T> &src, NormalizationLayerInfo info)
-{
- // Create reference
- SimpleTensor<T> dst{ src.shape(), src.data_type(), 1, src.fixed_point_position() };
-
- // Compute reference
- const uint32_t norm_size = info.norm_size();
- NormType type = info.type();
- float beta = info.beta();
- uint32_t kappa = info.kappa();
-
- const int cols = src.shape()[0];
- const int rows = src.shape()[1];
- const int depth = src.shape()[2];
- int upper_dims = src.shape().total_size() / (cols * rows);
-
- float coeff = info.scale_coeff();
- int radius_cols = norm_size / 2;
-
- // IN_MAP_1D and CROSS_MAP normalize over a single axis only
- int radius_rows = (NormType::IN_MAP_2D == type) ? norm_size / 2 : 0;
-
- if(type == NormType::CROSS_MAP)
- {
- // Remove also depth from upper dimensions since it is the dimension we
- // want to use for normalization
- upper_dims /= depth;
-
- for(int r = 0; r < upper_dims; ++r)
- {
- for(int i = 0; i < rows; ++i)
- {
- for(int k = 0; k < cols; ++k)
- {
- for(int l = 0; l < depth; ++l)
- {
- float accumulated_scale = 0.f;
-
- for(int j = -radius_cols; j <= radius_cols; ++j)
- {
- const int z = l + j;
-
- if(z >= 0 && z < depth)
- {
- const T value = src[k + i * cols + z * rows * cols + r * cols * rows * depth];
- accumulated_scale += value * value;
- }
- }
-
- dst[k + i * cols + l * rows * cols + r * cols * rows * depth] = kappa + accumulated_scale * coeff;
- }
- }
- }
- }
- }
- else
- {
- for(int r = 0; r < upper_dims; ++r)
- {
- for(int i = 0; i < rows; ++i)
- {
- for(int k = 0; k < cols; ++k)
- {
- float accumulated_scale = 0.f;
-
- for(int j = -radius_rows; j <= radius_rows; ++j)
- {
- const int y = i + j;
- for(int l = -radius_cols; l <= radius_cols; ++l)
- {
- const int x = k + l;
-
- if((x >= 0 && y >= 0) && (x < cols && y < rows))
- {
- const T value = src[x + y * cols + r * cols * rows];
- accumulated_scale += value * value;
- }
- }
- }
-
- dst[k + i * cols + r * cols * rows] = kappa + accumulated_scale * coeff;
- }
- }
- }
- }
-
- if(beta == 1.f)
- {
- for(int i = 0; i < dst.num_elements(); ++i)
- {
- dst[i] = src[i] / dst[i];
- }
- }
- else if(beta == 0.5f)
- {
- for(int i = 0; i < dst.num_elements(); ++i)
- {
- dst[i] = src[i] / std::sqrt(dst[i]);
- }
- }
- else
- {
- for(int i = 0; i < dst.num_elements(); ++i)
- {
- dst[i] = src[i] * std::exp(std::log(dst[i]) * -beta);
- }
- }
-
- return dst;
-}
-
-template <typename T, typename std::enable_if<std::is_integral<T>::value, int>::type>
-SimpleTensor<T> normalization_layer(const SimpleTensor<T> &src, NormalizationLayerInfo info)
-{
- using namespace fixed_point_arithmetic;
-
- // Create reference
- SimpleTensor<T> dst{ src.shape(), src.data_type(), 1, src.fixed_point_position() };
-
- // Compute reference
- const int fixed_point_position = src.fixed_point_position();
-
- const uint32_t norm_size = info.norm_size();
- NormType type = info.type();
- fixed_point<T> beta(info.beta(), fixed_point_position);
- fixed_point<T> kappa(info.kappa(), fixed_point_position);
-
- const int cols = src.shape()[0];
- const int rows = src.shape()[1];
- const int depth = src.shape()[2];
- int upper_dims = src.shape().total_size() / (cols * rows);
-
- fixed_point<T> coeff(info.scale_coeff(), fixed_point_position);
- int radius_cols = norm_size / 2;
-
- // IN_MAP_1D and CROSS_MAP normalize over a single axis only
- int radius_rows = (NormType::IN_MAP_2D == type) ? norm_size / 2 : 0;
-
- if(type == NormType::CROSS_MAP)
- {
- // Remove also depth from upper dimensions since it is the dimension we
- // want to use for normalization
- upper_dims /= depth;
-
- for(int r = 0; r < upper_dims; ++r)
- {
- for(int i = 0; i < rows; ++i)
- {
- for(int k = 0; k < cols; ++k)
- {
- for(int l = 0; l < depth; ++l)
- {
- fixed_point<T> accumulated_scale(0.f, fixed_point_position);
-
- for(int j = -radius_cols; j <= radius_cols; ++j)
- {
- const int z = l + j;
-
- if(z >= 0 && z < depth)
- {
- const T value = src[k + i * cols + z * rows * cols + r * cols * rows * depth];
- const fixed_point<T> fp_value(value, fixed_point_position, true);
- accumulated_scale = add(accumulated_scale, mul(fp_value, fp_value));
- }
- }
-
- accumulated_scale = add(kappa, mul(accumulated_scale, coeff));
- dst[k + i * cols + l * rows * cols + r * cols * rows * depth] = accumulated_scale.raw();
- }
- }
- }
- }
- }
- else
- {
- for(int r = 0; r < upper_dims; ++r)
- {
- for(int i = 0; i < rows; ++i)
- {
- for(int k = 0; k < cols; ++k)
- {
- fixed_point<T> accumulated_scale(0.f, fixed_point_position);
-
- for(int j = -radius_rows; j <= radius_rows; ++j)
- {
- const int y = i + j;
-
- for(int l = -radius_cols; l <= radius_cols; ++l)
- {
- const int x = k + l;
-
- if((x >= 0 && y >= 0) && (x < cols && y < rows))
- {
- const T value = src[x + y * cols + r * cols * rows];
- const fixed_point<T> fp_value(value, fixed_point_position, true);
- accumulated_scale = add(accumulated_scale, mul(fp_value, fp_value));
- }
- }
- }
-
- accumulated_scale = add(kappa, mul(accumulated_scale, coeff));
- dst[k + i * cols + r * cols * rows] = accumulated_scale.raw();
- }
- }
- }
- }
-
- if(info.beta() == 1.f)
- {
- for(int i = 0; i < dst.num_elements(); ++i)
- {
- fixed_point<T> res = div(fixed_point<T>(src[i], fixed_point_position, true), fixed_point<T>(dst[i], fixed_point_position, true));
- dst[i] = res.raw();
- }
- }
- else
- {
- const fixed_point<T> beta(info.beta(), fixed_point_position);
-
- for(int i = 0; i < dst.num_elements(); ++i)
- {
- fixed_point<T> res = pow(fixed_point<T>(dst[i], fixed_point_position, true), beta);
- res = div(fixed_point<T>(src[i], fixed_point_position, true), res);
- dst[i] = res.raw();
- }
- }
-
- return dst;
-}
-
-template SimpleTensor<float> normalization_layer(const SimpleTensor<float> &src, NormalizationLayerInfo info);
-template SimpleTensor<half_float::half> normalization_layer(const SimpleTensor<half_float::half> &src, NormalizationLayerInfo info);
-template SimpleTensor<qint8_t> normalization_layer(const SimpleTensor<qint8_t> &src, NormalizationLayerInfo info);
-template SimpleTensor<qint16_t> normalization_layer(const SimpleTensor<qint16_t> &src, NormalizationLayerInfo info);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CPP/NormalizationLayer.h b/tests/validation_new/CPP/NormalizationLayer.h
deleted file mode 100644
index bdd87545ca..0000000000
--- a/tests/validation_new/CPP/NormalizationLayer.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * 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_NORMALIZATION_LAYER_H__
-#define __ARM_COMPUTE_TEST_NORMALIZATION_LAYER_H__
-
-#include "tests/SimpleTensor.h"
-#include "tests/validation_new/Helpers.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-template <typename T, typename std::enable_if<is_floating_point<T>::value, int>::type = 0>
-SimpleTensor<T> normalization_layer(const SimpleTensor<T> &src, NormalizationLayerInfo info);
-
-template <typename T, typename std::enable_if<std::is_integral<T>::value, int>::type = 0>
-SimpleTensor<T> normalization_layer(const SimpleTensor<T> &src, NormalizationLayerInfo info);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* __ARM_COMPUTE_TEST_NORMALIZATION_LAYER_H__ */
diff --git a/tests/validation_new/CPP/PoolingLayer.cpp b/tests/validation_new/CPP/PoolingLayer.cpp
deleted file mode 100644
index 5464885dc4..0000000000
--- a/tests/validation_new/CPP/PoolingLayer.cpp
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * 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 "PoolingLayer.h"
-
-#include "tests/validation_new/FixedPoint.h"
-#include "tests/validation_new/half.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-namespace
-{
-TensorShape calculate_output_shape(TensorShape shape, PoolingLayerInfo info)
-{
- TensorShape dst_shape = shape;
- const std::pair<unsigned int, unsigned int> scaled_dims = arm_compute::scaled_dimensions(shape.x(),
- shape.y(),
- info.pool_size(),
- info.pool_size(),
- info.pad_stride_info());
- dst_shape.set(0, scaled_dims.first);
- dst_shape.set(1, scaled_dims.second);
-
- return dst_shape;
-}
-} // namespace
-
-template <typename T, typename std::enable_if<is_floating_point<T>::value, int>::type>
-SimpleTensor<T> pooling_layer(const SimpleTensor<T> &src, PoolingLayerInfo info)
-{
- const int pool_size = info.pool_size();
- PoolingType type = info.pool_type();
- int pool_stride_x = info.pad_stride_info().stride().first;
- int pool_stride_y = info.pad_stride_info().stride().second;
- int pad_x = info.pad_stride_info().pad().first;
- int pad_y = info.pad_stride_info().pad().second;
-
- const auto w_src = static_cast<int>(src.shape()[0]);
- const auto h_src = static_cast<int>(src.shape()[1]);
- const int upper_dims = src.shape().total_size() / (w_src * h_src);
-
- // Create reference
- SimpleTensor<T> dst{ calculate_output_shape(src.shape(), info), src.data_type(), 1, src.fixed_point_position() };
-
- const auto w_dst = static_cast<int>(dst.shape()[0]);
- const auto h_dst = static_cast<int>(dst.shape()[1]);
-
- if(type == PoolingType::MAX)
- {
- for(int r = 0; r < upper_dims; ++r)
- {
- for(int h = 0; h < h_dst; ++h)
- {
- for(int w = 0; w < w_dst; ++w)
- {
- int wstart = w * pool_stride_x - pad_x;
- int hstart = h * pool_stride_y - pad_y;
- int wend = std::min(wstart + pool_size, w_src);
- int hend = std::min(hstart + pool_size, h_src);
- wstart = std::max(wstart, 0);
- hstart = std::max(hstart, 0);
-
- T max_val = std::numeric_limits<T>::lowest();
- for(int y = hstart; y < hend; ++y)
- {
- for(int x = wstart; x < wend; ++x)
- {
- const T val = src[r * h_src * w_src + y * w_src + x];
- if(val > max_val)
- {
- max_val = val;
- }
- }
- }
-
- dst[r * h_dst * w_dst + h * w_dst + w] = max_val;
- }
- }
- }
- }
- else // Average pooling
- {
- for(int r = 0; r < upper_dims; ++r)
- {
- for(int h = 0; h < h_dst; ++h)
- {
- for(int w = 0; w < w_dst; ++w)
- {
- T avg_val(0);
- int wstart = w * pool_stride_x - pad_x;
- int hstart = h * pool_stride_y - pad_y;
- int wend = std::min(wstart + pool_size, w_src + pad_x);
- int hend = std::min(hstart + pool_size, h_src + pad_y);
- int pool = (hend - hstart) * (wend - wstart);
- wstart = std::max(wstart, 0);
- hstart = std::max(hstart, 0);
- wend = std::min(wend, w_src);
- hend = std::min(hend, h_src);
-
- for(int y = hstart; y < hend; ++y)
- {
- for(int x = wstart; x < wend; ++x)
- {
- avg_val += src[r * h_src * w_src + y * w_src + x];
- }
- }
- dst[r * h_dst * w_dst + h * w_dst + w] = avg_val / pool;
- }
- }
- }
- }
-
- return dst;
-}
-
-template <typename T, typename std::enable_if<std::is_integral<T>::value, int>::type>
-SimpleTensor<T> pooling_layer(const SimpleTensor<T> &src, PoolingLayerInfo info)
-{
- const int pool_size = info.pool_size();
- PoolingType type = info.pool_type();
- int pool_stride_x = info.pad_stride_info().stride().first;
- int pool_stride_y = info.pad_stride_info().stride().second;
- int pad_x = info.pad_stride_info().pad().first;
- int pad_y = info.pad_stride_info().pad().second;
-
- const auto w_src = static_cast<int>(src.shape()[0]);
- const auto h_src = static_cast<int>(src.shape()[1]);
- const int upper_dims = src.shape().total_size() / (w_src * h_src);
-
- // Create reference
- SimpleTensor<T> dst{ calculate_output_shape(src.shape(), info), src.data_type(), 1, src.fixed_point_position() };
-
- const auto w_dst = static_cast<int>(dst.shape()[0]);
- const auto h_dst = static_cast<int>(dst.shape()[1]);
-
- if(type == PoolingType::MAX)
- {
- for(int r = 0; r < upper_dims; ++r)
- {
- for(int h = 0; h < h_dst; ++h)
- {
- for(int w = 0; w < w_dst; ++w)
- {
- int wstart = w * pool_stride_x - pad_x;
- int hstart = h * pool_stride_y - pad_y;
- int wend = std::min(wstart + pool_size, w_src);
- int hend = std::min(hstart + pool_size, h_src);
- wstart = std::max(wstart, 0);
- hstart = std::max(hstart, 0);
-
- T max_val = std::numeric_limits<T>::lowest();
- for(int y = hstart; y < hend; ++y)
- {
- for(int x = wstart; x < wend; ++x)
- {
- const T val = src[r * h_src * w_src + y * w_src + x];
- if(val > max_val)
- {
- max_val = val;
- }
- }
- }
-
- dst[r * h_dst * w_dst + h * w_dst + w] = max_val;
- }
- }
- }
- }
- else // Average pooling
- {
- for(int r = 0; r < upper_dims; ++r)
- {
- for(int h = 0; h < h_dst; ++h)
- {
- for(int w = 0; w < w_dst; ++w)
- {
- int wstart = w * pool_stride_x - pad_x;
- int hstart = h * pool_stride_y - pad_y;
- int wend = std::min(wstart + pool_size, w_src + pad_x);
- int hend = std::min(hstart + pool_size, h_src + pad_y);
- int pool = (hend - hstart) * (wend - wstart);
- wstart = std::max(wstart, 0);
- hstart = std::max(hstart, 0);
- wend = std::min(wend, w_src);
- hend = std::min(hend, h_src);
-
- using namespace fixed_point_arithmetic;
-
- const int fixed_point_position = src.fixed_point_position();
- const fixed_point<T> invpool_fp(1.f / static_cast<float>(pool), fixed_point_position);
- fixed_point<T> avg_val(0, fixed_point_position, true);
-
- for(int y = hstart; y < hend; ++y)
- {
- for(int x = wstart; x < wend; ++x)
- {
- const fixed_point<T> in_fp(src[r * h_src * w_src + y * w_src + x], fixed_point_position, true);
- avg_val = add(avg_val, in_fp);
- }
- }
- dst[r * h_dst * w_dst + h * w_dst + w] = mul(avg_val, invpool_fp).raw();
- }
- }
- }
- }
-
- return dst;
-}
-
-template SimpleTensor<float> pooling_layer(const SimpleTensor<float> &src, PoolingLayerInfo info);
-template SimpleTensor<half_float::half> pooling_layer(const SimpleTensor<half_float::half> &src, PoolingLayerInfo info);
-template SimpleTensor<qint8_t> pooling_layer(const SimpleTensor<qint8_t> &src, PoolingLayerInfo info);
-template SimpleTensor<qint16_t> pooling_layer(const SimpleTensor<qint16_t> &src, PoolingLayerInfo info);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CPP/PoolingLayer.h b/tests/validation_new/CPP/PoolingLayer.h
deleted file mode 100644
index 0935fb02f9..0000000000
--- a/tests/validation_new/CPP/PoolingLayer.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * 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_POOLING_LAYER_H__
-#define __ARM_COMPUTE_TEST_POOLING_LAYER_H__
-
-#include "tests/SimpleTensor.h"
-#include "tests/validation_new/Helpers.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-template <typename T, typename std::enable_if<is_floating_point<T>::value, int>::type = 0>
-SimpleTensor<T> pooling_layer(const SimpleTensor<T> &src, PoolingLayerInfo info);
-
-template <typename T, typename std::enable_if<std::is_integral<T>::value, int>::type = 0>
-SimpleTensor<T> pooling_layer(const SimpleTensor<T> &src, PoolingLayerInfo info);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* __ARM_COMPUTE_TEST_POOLING_LAYER_H__ */
diff --git a/tests/validation_new/CPP/QuantizationLayer.cpp b/tests/validation_new/CPP/QuantizationLayer.cpp
deleted file mode 100644
index d61e75a3a9..0000000000
--- a/tests/validation_new/CPP/QuantizationLayer.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * 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 "QuantizationLayer.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-void compute_min_max(const SimpleTensor<float> &src, float *min, float *max)
-{
- // Set min and max to first pixel
- float tmp_min = src[0];
- float tmp_max = src[0];
-
- // Look for min and max values
- for(int i = 1; i < src.num_elements(); ++i)
- {
- if(src[i] < tmp_min)
- {
- tmp_min = src[i];
- }
- if(src[i] > tmp_max)
- {
- tmp_max = src[i];
- }
- }
-
- *min = tmp_min;
- *max = tmp_max;
-}
-
-template <typename T, typename std::enable_if<is_floating_point<T>::value, int>::type>
-SimpleTensor<uint8_t> quantization_layer(const SimpleTensor<T> &src)
-{
- // Create reference
- SimpleTensor<uint8_t> dst{ src.shape(), DataType::U8 };
-
- // Compute min and max of the tensor using Min-Max layer
- float min = 0.f;
- float max = 0.f;
-
- compute_min_max(src, &min, &max);
-
- const float range = max - min;
-
- for(int i = 0; i < src.num_elements(); ++i)
- {
- // map values to range [0.0, 1.0]
- const float normalized = (src[i] - min) / range;
- dst[i] = static_cast<uint8_t>(std::min(255.0f, normalized * 256.0f));
- }
-
- return dst;
-}
-
-template SimpleTensor<uint8_t> quantization_layer(const SimpleTensor<float> &src);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CPP/QuantizationLayer.h b/tests/validation_new/CPP/QuantizationLayer.h
deleted file mode 100644
index c696ab0c85..0000000000
--- a/tests/validation_new/CPP/QuantizationLayer.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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_QUANTIZATION_LAYER_H__
-#define __ARM_COMPUTE_TEST_QUANTIZATION_LAYER_H__
-
-#include "tests/SimpleTensor.h"
-#include "tests/validation_new/Helpers.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-template <typename T, typename std::enable_if<is_floating_point<T>::value, int>::type = 0>
-SimpleTensor<uint8_t> quantization_layer(const SimpleTensor<T> &src);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* __ARM_COMPUTE_TEST_QUANTIZATION_LAYER_H__ */
diff --git a/tests/validation_new/CPP/ReductionOperation.cpp b/tests/validation_new/CPP/ReductionOperation.cpp
deleted file mode 100644
index f4c5c21182..0000000000
--- a/tests/validation_new/CPP/ReductionOperation.cpp
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * 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 "ReductionOperation.h"
-
-#include "tests/validation_new/Helpers.h"
-
-#include <algorithm>
-#include <cmath>
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-namespace
-{
-template <typename T>
-struct square
-{
- T operator()(const T &lhs, const T &rhs) const
- {
- return (lhs + rhs * rhs);
- }
-};
-
-template <typename T>
-T reduce_operation(T *ptr, int reduce_elements, ReductionOperation op)
-{
- switch(op)
- {
- case ReductionOperation::SUM_SQUARE:
- return std::accumulate(ptr, ptr + reduce_elements, 0.f, square<T>());
- default:
- ARM_COMPUTE_ERROR("Unsupported reduction operation");
- }
-}
-} // namespace
-
-template <typename T>
-SimpleTensor<T> reduction_operation(const SimpleTensor<T> &src, const TensorShape &dst_shape, unsigned int axis, ReductionOperation op)
-{
- // Create reference
- SimpleTensor<T> dst{ dst_shape, src.data_type() };
-
- // Compute reference
- const int reduce_elems = src.shape()[axis];
- const int upper_dims = src.shape().total_size_upper(axis + 1);
-
- for(int du = 0; du < upper_dims; ++du)
- {
- if(axis == 0)
- {
- const T *src_row_ptr = src.data() + du * reduce_elems;
- dst[du] = reduce_operation(src_row_ptr, reduce_elems, op);
- }
- else
- {
- ARM_COMPUTE_ERROR("Unsupported reduction axis");
- }
- }
-
- return dst;
-}
-
-template SimpleTensor<float> reduction_operation(const SimpleTensor<float> &src, const TensorShape &dst_shape, unsigned int axis, ReductionOperation op);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CPP/ReductionOperation.h b/tests/validation_new/CPP/ReductionOperation.h
deleted file mode 100644
index 500a8162fd..0000000000
--- a/tests/validation_new/CPP/ReductionOperation.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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_REDUCTION_OPERATION_H__
-#define __ARM_COMPUTE_TEST_REDUCTION_OPERATION_H__
-
-#include "tests/SimpleTensor.h"
-#include "tests/validation_new/Helpers.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-template <typename T>
-SimpleTensor<T> reduction_operation(const SimpleTensor<T> &src, const TensorShape &dst_shape, unsigned int axis, ReductionOperation op);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* __ARM_COMPUTE_TEST_FLOOR_H__ */
diff --git a/tests/validation_new/CPP/Scale.cpp b/tests/validation_new/CPP/Scale.cpp
deleted file mode 100644
index a1119f33b9..0000000000
--- a/tests/validation_new/CPP/Scale.cpp
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * 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/Helpers.h"
-
-#include "Scale.h"
-#include "Utils.h"
-
-namespace arm_compute
-{
-namespace test
-{
-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, uint8_t constant_border_value)
-{
- TensorShape shape_scaled(in.shape());
- shape_scaled.set(0, in.shape()[0] * scale_x);
- shape_scaled.set(1, in.shape()[1] * scale_y);
- SimpleTensor<T> out(shape_scaled, in.data_type());
-
- // Compute the ratio between source width/height and destination width/height
- const auto wr = static_cast<float>(in.shape()[0]) / static_cast<float>(out.shape()[0]);
- const auto hr = static_cast<float>(in.shape()[1]) / static_cast<float>(out.shape()[1]);
-
- const auto width = static_cast<int>(in.shape().x());
- const auto height = static_cast<int>(in.shape().y());
-
- // Area interpolation behaves as Nearest Neighbour in case of up-sampling
- if(policy == InterpolationPolicy::AREA && wr <= 1.f && hr <= 1.f)
- {
- policy = InterpolationPolicy::NEAREST_NEIGHBOR;
- }
-
- for(int element_idx = 0, count = 0; element_idx < out.num_elements(); ++element_idx, ++count)
- {
- Coordinates id = index2coord(out.shape(), element_idx);
- int idx = id.x();
- int idy = id.y();
- float x_src = (idx + 0.5f) * wr - 0.5f;
- float y_src = (idy + 0.5f) * hr - 0.5f;
-
- switch(policy)
- {
- case InterpolationPolicy::NEAREST_NEIGHBOR:
- {
- //Calculate the source coords without -0.5f is equivalent to round the x_scr/y_src coords
- x_src = (idx + 0.5f) * wr;
- y_src = (idy + 0.5f) * hr;
- id.set(0, x_src);
- id.set(1, y_src);
-
- // If coordinates in range of tensor's width or height
- if(x_src >= -1 || y_src >= -1 || x_src <= width || y_src <= height)
- {
- out[element_idx] = tensor_elem_at(in, id, border_mode, constant_border_value);
- }
- else
- {
- if(border_mode == BorderMode::CONSTANT)
- {
- out[element_idx] = constant_border_value;
- }
- else if(border_mode == BorderMode::REPLICATE)
- {
- id.set(0, clamp(static_cast<int>(x_src), 0, width - 1));
- id.set(1, clamp(static_cast<int>(y_src), 0, height - 1));
- out[element_idx] = in[coord2index(in.shape(), id)];
- }
- }
- break;
- }
- case InterpolationPolicy::BILINEAR:
- {
- id.set(0, std::floor(x_src));
- id.set(1, std::floor(y_src));
- if(x_src >= -1 || y_src >= -1 || x_src <= width || y_src <= height)
- {
- out[element_idx] = bilinear_policy(in, id, x_src, y_src, border_mode, constant_border_value);
- }
- else
- {
- if(border_mode == BorderMode::CONSTANT)
- {
- out[element_idx] = constant_border_value;
- }
- else if(border_mode == BorderMode::REPLICATE)
- {
- id.set(0, clamp(static_cast<int>(x_src), 0, width - 1));
- id.set(1, clamp(static_cast<int>(y_src), 0, height - 1));
- out[element_idx] = in[coord2index(in.shape(), id)];
- }
- }
- break;
- }
- case InterpolationPolicy::AREA:
- {
- int x_from = std::floor(idx * wr - 0.5f - x_src);
- int y_from = std::floor(idy * hr - 0.5f - y_src);
- int x_to = std::ceil((idx + 1) * wr - 0.5f - x_src);
- int y_to = std::ceil((idy + 1) * hr - 0.5f - y_src);
- const int xi = std::floor(x_src);
- const int yi = std::floor(y_src);
-
- // Clamp position to borders
- x_src = std::max(-1.f, std::min(x_src, static_cast<float>(width)));
- y_src = std::max(-1.f, std::min(y_src, static_cast<float>(height)));
-
- // Clamp bounding box offsets to borders
- x_from = ((x_src + x_from) < -1) ? -1 : x_from;
- y_from = ((y_src + y_from) < -1) ? -1 : y_from;
- x_to = ((x_src + x_to) > width) ? (width - x_src) : x_to;
- y_to = ((y_src + y_to) > height) ? (height - y_src) : y_to;
- ARM_COMPUTE_ERROR_ON((x_to - x_from + 1) == 0 || (y_to - y_from + 1) == 0);
-
- float sum = 0;
- for(int j = yi + y_from, je = yi + y_to; j <= je; ++j)
- {
- for(int i = xi + x_from, ie = xi + x_to; i <= ie; ++i)
- {
- id.set(0, static_cast<int>(i));
- id.set(1, static_cast<int>(j));
- sum += tensor_elem_at(in, id, border_mode, constant_border_value);
- }
- }
- out[element_idx] = sum / ((x_to - x_from + 1) * (y_to - y_from + 1));
-
- break;
- }
- default:
- ARM_COMPUTE_ERROR("Unsupported interpolation mode");
- }
- }
-
- 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);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute \ No newline at end of file
diff --git a/tests/validation_new/CPP/Scale.h b/tests/validation_new/CPP/Scale.h
deleted file mode 100644
index b882915946..0000000000
--- a/tests/validation_new/CPP/Scale.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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_SCALE_H__
-#define __ARM_COMPUTE_TEST_SCALE_H__
-
-#include "tests/SimpleTensor.h"
-
-namespace arm_compute
-{
-namespace test
-{
-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, uint8_t constant_border_value = 0);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* __ARM_COMPUTE_TEST_SCALE_H__ */
diff --git a/tests/validation_new/CPP/SoftmaxLayer.cpp b/tests/validation_new/CPP/SoftmaxLayer.cpp
deleted file mode 100644
index 8c2cda8296..0000000000
--- a/tests/validation_new/CPP/SoftmaxLayer.cpp
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * 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 "SoftmaxLayer.h"
-
-#include "tests/validation_new/FixedPoint.h"
-#include "tests/validation_new/half.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-template <typename T, typename std::enable_if<is_floating_point<T>::value, int>::type>
-SimpleTensor<T> softmax_layer(const SimpleTensor<T> &src)
-{
- // Create reference
- SimpleTensor<T> dst{ src.shape(), src.data_type(), 1, src.fixed_point_position() };
-
- // Compute reference
- const int cols = src.shape()[0];
- const int upper_dims = src.num_elements() / cols;
-
- for(int r = 0; r < upper_dims; ++r)
- {
- const T *src_row_ptr = src.data() + r * cols;
- T *dst_row_ptr = dst.data() + r * cols;
-
- // Find max
- const T max = *std::max_element(src_row_ptr, src_row_ptr + cols);
-
- // Regularize
- T sum(0.f);
- std::transform(src_row_ptr, src_row_ptr + cols, dst_row_ptr, [&sum, max](T val)
- {
- const T res(std::exp(val - max));
- sum += res;
- return res;
- });
-
- // Normalize
- std::transform(dst_row_ptr, dst_row_ptr + cols, dst_row_ptr, [sum](T val)
- {
- return val / sum;
- });
- }
-
- return dst;
-}
-
-template <typename T, typename std::enable_if<std::is_integral<T>::value, int>::type>
-SimpleTensor<T> softmax_layer(const SimpleTensor<T> &src)
-{
- using namespace fixed_point_arithmetic;
-
- // Create reference
- SimpleTensor<T> dst{ src.shape(), src.data_type(), 1, src.fixed_point_position() };
-
- // Compute reference
- const int cols = src.shape()[0];
- const int upper_dims = src.num_elements() / cols;
-
- for(int r = 0; r < upper_dims; ++r)
- {
- const T *src_row_ptr = src.data() + r * cols;
- T *dst_row_ptr = dst.data() + r * cols;
-
- // Find max
- const fixed_point<T> max(*std::max_element(src_row_ptr, src_row_ptr + cols), src.fixed_point_position(), true);
-
- // Regularize
- using promoted_type = fixed_point_arithmetic::traits::promote_t<T>;
- fixed_point<promoted_type> sum(0, src.fixed_point_position(), true);
- std::transform(src_row_ptr, src_row_ptr + cols, dst_row_ptr, [&](T val)
- {
- const fixed_point<T> res = exp(fixed_point<T>(val, src.fixed_point_position(), true) - max);
- sum = add(sum, fixed_point<promoted_type>(res.raw(), src.fixed_point_position(), true));
- return res.raw();
- });
-
- // Normalize
- fixed_point<T> saturated_sum(sum);
- std::transform(dst_row_ptr, dst_row_ptr + cols, dst_row_ptr, [&](T val)
- {
- return div(fixed_point<T>(val, src.fixed_point_position(), true), saturated_sum).raw();
- });
- }
-
- return dst;
-}
-
-template SimpleTensor<float> softmax_layer(const SimpleTensor<float> &src);
-template SimpleTensor<half_float::half> softmax_layer(const SimpleTensor<half_float::half> &src);
-template SimpleTensor<qint8_t> softmax_layer(const SimpleTensor<qint8_t> &src);
-template SimpleTensor<qint16_t> softmax_layer(const SimpleTensor<qint16_t> &src);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CPP/SoftmaxLayer.h b/tests/validation_new/CPP/SoftmaxLayer.h
deleted file mode 100644
index cc52f3cf51..0000000000
--- a/tests/validation_new/CPP/SoftmaxLayer.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * 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_SOFTMAX_LAYER_H__
-#define __ARM_COMPUTE_TEST_SOFTMAX_LAYER_H__
-
-#include "tests/SimpleTensor.h"
-#include "tests/validation_new/Helpers.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace reference
-{
-template <typename T, typename std::enable_if<is_floating_point<T>::value, int>::type = 0>
-SimpleTensor<T> softmax_layer(const SimpleTensor<T> &src);
-
-template <typename T, typename std::enable_if<std::is_integral<T>::value, int>::type = 0>
-SimpleTensor<T> softmax_layer(const SimpleTensor<T> &src);
-} // namespace reference
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* __ARM_COMPUTE_TEST_SOFTMAX_LAYER_H__ */
diff --git a/tests/validation_new/CPP/Utils.cpp b/tests/validation_new/CPP/Utils.cpp
deleted file mode 100644
index c89807b69a..0000000000
--- a/tests/validation_new/CPP/Utils.cpp
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * 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 "Utils.h"
-
-#include "tests/validation_new/Helpers.h"
-#include "tests/validation_new/half.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-// Return a tensor element at a specified coordinate with different border modes
-template <typename T>
-T tensor_elem_at(const SimpleTensor<T> &in, Coordinates coord, BorderMode border_mode, T constant_border_value)
-{
- const int x = coord.x();
- const int y = coord.y();
- const auto width = static_cast<int>(in.shape().x());
- const auto height = static_cast<int>(in.shape().y());
-
- // If coordinates beyond range of tensor's width or height
- if(x < 0 || y < 0 || x >= width || y >= height)
- {
- if(border_mode == BorderMode::REPLICATE)
- {
- coord.set(0, std::max(0, std::min(x, width - 1)));
- coord.set(1, std::max(0, std::min(y, height - 1)));
- }
- else
- {
- return constant_border_value;
- }
- }
- return in[coord2index(in.shape(), coord)];
-}
-template float tensor_elem_at(const SimpleTensor<float> &in, Coordinates coord, BorderMode border_mode, float constant_border_value);
-template uint8_t tensor_elem_at(const SimpleTensor<uint8_t> &in, Coordinates coord, BorderMode border_mode, uint8_t constant_border_value);
-
-// Return the bilinear value at a specified coordinate with different border modes
-template <typename T>
-T bilinear_policy(const SimpleTensor<T> &in, Coordinates id, float xn, float yn, BorderMode border_mode, uint8_t constant_border_value)
-{
- int idx = std::floor(xn);
- int idy = std::floor(yn);
-
- const float dx = xn - idx;
- const float dy = yn - idy;
- const float dx_1 = 1.0f - dx;
- const float dy_1 = 1.0f - dy;
-
- id.set(0, idx);
- id.set(1, idy);
- const T tl = tensor_elem_at(in, id, border_mode, constant_border_value);
- id.set(0, idx + 1);
- id.set(1, idy);
- const T tr = tensor_elem_at(in, id, border_mode, constant_border_value);
- id.set(0, idx);
- id.set(1, idy + 1);
- const T bl = tensor_elem_at(in, id, border_mode, constant_border_value);
- id.set(0, idx + 1);
- id.set(1, idy + 1);
- const T br = tensor_elem_at(in, id, border_mode, constant_border_value);
-
- return tl * (dx_1 * dy_1) + tr * (dx * dy_1) + bl * (dx_1 * dy) + br * (dx * dy);
-}
-template uint8_t bilinear_policy(const SimpleTensor<uint8_t> &in, Coordinates id, float xn, float yn, BorderMode border_mode, uint8_t constant_border_value);
-
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/CPP/Utils.h b/tests/validation_new/CPP/Utils.h
deleted file mode 100644
index 4e3deb4d86..0000000000
--- a/tests/validation_new/CPP/Utils.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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_VALIDATION_UTILS_H__
-#define __ARM_COMPUTE_TEST_VALIDATION_UTILS_H__
-
-#include "arm_compute/core/Types.h"
-#include "tests/Globals.h"
-#include "tests/ILutAccessor.h"
-#include "tests/Types.h"
-#include "tests/validation/ValidationUserConfiguration.h"
-#include "tests/validation/half.h"
-
-#include <array>
-#include <random>
-#include <type_traits>
-#include <utility>
-#include <vector>
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-template <typename T>
-T tensor_elem_at(const SimpleTensor<T> &in, Coordinates coord, BorderMode border_mode, T constant_border_value);
-
-template <typename T>
-T bilinear_policy(const SimpleTensor<T> &in, Coordinates id, float xn, float yn, BorderMode border_mode, uint8_t constant_border_value);
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* __ARM_COMPUTE_TEST_VALIDATION_UTILS_H__ */
diff --git a/tests/validation_new/FixedPoint.h b/tests/validation_new/FixedPoint.h
deleted file mode 100644
index 61d791c54c..0000000000
--- a/tests/validation_new/FixedPoint.h
+++ /dev/null
@@ -1,984 +0,0 @@
-/*
- * 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_VALIDATION_FIXEDPOINT_H__
-#define __ARM_COMPUTE_TEST_VALIDATION_FIXEDPOINT_H__
-
-#include "Utils.h"
-#include "support/ToolchainSupport.h"
-
-#include <cassert>
-#include <cstdint>
-#include <cstdlib>
-#include <limits>
-#include <string>
-#include <type_traits>
-
-namespace arm_compute
-{
-namespace test
-{
-namespace fixed_point_arithmetic
-{
-namespace detail
-{
-// Forward declare structs
-struct functions;
-template <typename T>
-struct constant_expr;
-}
-
-/** Fixed point traits */
-namespace traits
-{
-// Promote types
-// *INDENT-OFF*
-// clang-format off
-template <typename T> struct promote { };
-template <> struct promote<uint8_t> { using type = uint16_t; };
-template <> struct promote<int8_t> { using type = int16_t; };
-template <> struct promote<uint16_t> { using type = uint32_t; };
-template <> struct promote<int16_t> { using type = int32_t; };
-template <> struct promote<uint32_t> { using type = uint64_t; };
-template <> struct promote<int32_t> { using type = int64_t; };
-template <> struct promote<uint64_t> { using type = uint64_t; };
-template <> struct promote<int64_t> { using type = int64_t; };
-template <typename T>
-using promote_t = typename promote<T>::type;
-// clang-format on
-// *INDENT-ON*
-}
-
-/** Strongly typed enum class representing the overflow policy */
-enum class OverflowPolicy
-{
- WRAP, /**< Wrap policy */
- SATURATE /**< Saturate policy */
-};
-/** Strongly typed enum class representing the rounding policy */
-enum class RoundingPolicy
-{
- TO_ZERO, /**< Round to zero policy */
- TO_NEAREST_EVEN /**< Round to nearest even policy */
-};
-
-/** Arbitrary fixed-point arithmetic class */
-template <typename T>
-class fixed_point
-{
-public:
- // Static Checks
- static_assert(std::is_integral<T>::value, "Type is not an integer");
-
- /** Constructor (from different fixed point type)
- *
- * @param[in] val Fixed point
- * @param[in] p Fixed point precision
- */
- template <typename U>
- fixed_point(fixed_point<U> val, uint8_t p)
- : _value(0), _fixed_point_position(p)
- {
- assert(p > 0 && p < std::numeric_limits<T>::digits);
- T v = 0;
-
- if(std::numeric_limits<T>::digits < std::numeric_limits<U>::digits)
- {
- val.rescale(p);
- v = detail::constant_expr<T>::saturate_cast(val.raw());
- }
- else
- {
- auto v_cast = static_cast<fixed_point<T>>(val);
- v_cast.rescale(p);
- v = v_cast.raw();
- }
- _value = static_cast<T>(v);
- }
- /** Constructor (from integer)
- *
- * @param[in] val Integer value to be represented as fixed point
- * @param[in] p Fixed point precision
- * @param[in] is_raw If true val is a raw fixed point value else an integer
- */
- template <typename U, typename = typename std::enable_if<std::is_integral<U>::value>::type>
- fixed_point(U val, uint8_t p, bool is_raw = false)
- : _value(val << p), _fixed_point_position(p)
- {
- if(is_raw)
- {
- _value = val;
- }
- }
- /** Constructor (from float)
- *
- * @param[in] val Float value to be represented as fixed point
- * @param[in] p Fixed point precision
- */
- fixed_point(float val, uint8_t p)
- : _value(detail::constant_expr<T>::to_fixed(val, p)), _fixed_point_position(p)
- {
- assert(p > 0 && p < std::numeric_limits<T>::digits);
- }
- /** Constructor (from float string)
- *
- * @param[in] str Float string to be represented as fixed point
- * @param[in] p Fixed point precision
- */
- fixed_point(std::string str, uint8_t p)
- : _value(detail::constant_expr<T>::to_fixed(support::cpp11::stof(str), p)), _fixed_point_position(p)
- {
- assert(p > 0 && p < std::numeric_limits<T>::digits);
- }
- /** Default copy constructor */
- fixed_point &operator=(const fixed_point &) = default;
- /** Default move constructor */
- fixed_point &operator=(fixed_point &&) = default;
- /** Default copy assignment operator */
- fixed_point(const fixed_point &) = default;
- /** Default move assignment operator */
- fixed_point(fixed_point &&) = default;
-
- /** Float conversion operator
- *
- * @return Float representation of fixed point
- */
- operator float() const
- {
- return detail::constant_expr<T>::to_float(_value, _fixed_point_position);
- }
- /** Integer conversion operator
- *
- * @return Integer representation of fixed point
- */
- template <typename U, typename = typename std::enable_if<std::is_integral<T>::value>::type>
- operator U() const
- {
- return detail::constant_expr<T>::to_int(_value, _fixed_point_position);
- }
- /** Convert to different fixed point of different type but same precision
- *
- * @note Down-conversion might fail.
- */
- template <typename U>
- operator fixed_point<U>()
- {
- U val = static_cast<U>(_value);
- if(std::numeric_limits<U>::digits < std::numeric_limits<T>::digits)
- {
- val = detail::constant_expr<U>::saturate_cast(_value);
- }
- return fixed_point<U>(val, _fixed_point_position, true);
- }
-
- /** Arithmetic += assignment operator
- *
- * @param[in] rhs Fixed point operand
- *
- * @return Reference to this fixed point
- */
- template <typename U>
- fixed_point<T> &operator+=(const fixed_point<U> &rhs)
- {
- fixed_point<T> val(rhs, _fixed_point_position);
- _value += val.raw();
- return *this;
- }
- /** Arithmetic -= assignment operator
- *
- * @param[in] rhs Fixed point operand
- *
- * @return Reference to this fixed point
- */
- template <typename U>
- fixed_point<T> &operator-=(const fixed_point<U> &rhs)
- {
- fixed_point<T> val(rhs, _fixed_point_position);
- _value -= val.raw();
- return *this;
- }
-
- /** Raw value accessor
- *
- * @return Raw fixed point value
- */
- T raw() const
- {
- return _value;
- }
- /** Precision accessor
- *
- * @return Precision of fixed point
- */
- uint8_t precision() const
- {
- return _fixed_point_position;
- }
- /** Rescale a fixed point to a new precision
- *
- * @param[in] p New fixed point precision
- */
- void rescale(uint8_t p)
- {
- assert(p > 0 && p < std::numeric_limits<T>::digits);
-
- using promoted_T = typename traits::promote<T>::type;
- promoted_T val = _value;
- if(p > _fixed_point_position)
- {
- val <<= (p - _fixed_point_position);
- }
- else if(p < _fixed_point_position)
- {
- uint8_t pbar = _fixed_point_position - p;
- val += (pbar != 0) ? (1 << (pbar - 1)) : 0;
- val >>= pbar;
- }
-
- _value = detail::constant_expr<T>::saturate_cast(val);
- _fixed_point_position = p;
- }
-
-private:
- T _value; /**< Fixed point raw value */
- uint8_t _fixed_point_position; /**< Fixed point precision */
-};
-
-namespace detail
-{
-/** Count the number of leading zero bits in the given value.
- *
- * @param[in] value Input value.
- *
- * @return Number of leading zero bits.
- */
-template <typename T>
-constexpr int clz(T value)
-{
- using unsigned_T = typename std::make_unsigned<T>::type;
- // __builtin_clz is available for int. Need to correct reported number to
- // match the original type.
- return __builtin_clz(value) - (32 - std::numeric_limits<unsigned_T>::digits);
-}
-
-template <typename T>
-struct constant_expr
-{
- /** Calculate representation of 1 in fixed point given a fixed point precision
- *
- * @param[in] p Fixed point precision
- *
- * @return Representation of value 1 in fixed point.
- */
- static constexpr T fixed_one(uint8_t p)
- {
- return (1 << p);
- }
- /** Calculate fixed point precision step given a fixed point precision
- *
- * @param[in] p Fixed point precision
- *
- * @return Fixed point precision step
- */
- static constexpr float fixed_step(uint8_t p)
- {
- return (1.0f / static_cast<float>(1 << p));
- }
-
- /** Convert a fixed point value to float given its precision.
- *
- * @param[in] val Fixed point value
- * @param[in] p Fixed point precision
- *
- * @return Float representation of the fixed point number
- */
- static constexpr float to_float(T val, uint8_t p)
- {
- return static_cast<float>(val * fixed_step(p));
- }
- /** Convert a fixed point value to integer given its precision.
- *
- * @param[in] val Fixed point value
- * @param[in] p Fixed point precision
- *
- * @return Integer of the fixed point number
- */
- static constexpr T to_int(T val, uint8_t p)
- {
- return val >> p;
- }
- /** Convert a single precision floating point value to a fixed point representation given its precision.
- *
- * @param[in] val Floating point value
- * @param[in] p Fixed point precision
- *
- * @return The raw fixed point representation
- */
- static constexpr T to_fixed(float val, uint8_t p)
- {
- return static_cast<T>(saturate_cast<float>(val * fixed_one(p) + ((val >= 0) ? 0.5 : -0.5)));
- }
- /** Clamp value between two ranges
- *
- * @param[in] val Value to clamp
- * @param[in] min Minimum value to clamp to
- * @param[in] max Maximum value to clamp to
- *
- * @return clamped value
- */
- static constexpr T clamp(T val, T min, T max)
- {
- return std::min(std::max(val, min), max);
- }
- /** Saturate given number
- *
- * @param[in] val Value to saturate
- *
- * @return Saturated value
- */
- template <typename U>
- static constexpr T saturate_cast(U val)
- {
- return static_cast<T>(std::min<U>(std::max<U>(val, static_cast<U>(std::numeric_limits<T>::min())), static_cast<U>(std::numeric_limits<T>::max())));
- }
-};
-struct functions
-{
- /** Output stream operator
- *
- * @param[in] s Output stream
- * @param[in] x Fixed point value
- *
- * @return Reference output to updated stream
- */
- template <typename T, typename U, typename traits>
- static std::basic_ostream<T, traits> &write(std::basic_ostream<T, traits> &s, fixed_point<U> &x)
- {
- return s << static_cast<float>(x);
- }
- /** Signbit of a fixed point number.
- *
- * @param[in] x Fixed point number
- *
- * @return True if negative else false.
- */
- template <typename T>
- static bool signbit(fixed_point<T> x)
- {
- return ((x.raw() >> std::numeric_limits<T>::digits) != 0);
- }
- /** Checks if two fixed point numbers are equal
- *
- * @param[in] x First fixed point operand
- * @param[in] y Second fixed point operand
- *
- * @return True if fixed points are equal else false
- */
- template <typename T>
- static bool isequal(fixed_point<T> x, fixed_point<T> y)
- {
- uint8_t p = std::min(x.precision(), y.precision());
- x.rescale(p);
- y.rescale(p);
- return (x.raw() == y.raw());
- }
- /** Checks if two fixed point number are not equal
- *
- * @param[in] x First fixed point operand
- * @param[in] y Second fixed point operand
- *
- * @return True if fixed points are not equal else false
- */
- template <typename T>
- static bool isnotequal(fixed_point<T> x, fixed_point<T> y)
- {
- return !isequal(x, y);
- }
- /** Checks if one fixed point is greater than the other
- *
- * @param[in] x First fixed point operand
- * @param[in] y Second fixed point operand
- *
- * @return True if fixed point is greater than other
- */
- template <typename T>
- static bool isgreater(fixed_point<T> x, fixed_point<T> y)
- {
- uint8_t p = std::min(x.precision(), y.precision());
- x.rescale(p);
- y.rescale(p);
- return (x.raw() > y.raw());
- }
- /** Checks if one fixed point is greater or equal than the other
- *
- * @param[in] x First fixed point operand
- * @param[in] y Second fixed point operand
- *
- * @return True if fixed point is greater or equal than other
- */
- template <typename T>
- static bool isgreaterequal(fixed_point<T> x, fixed_point<T> y)
- {
- uint8_t p = std::min(x.precision(), y.precision());
- x.rescale(p);
- y.rescale(p);
- return (x.raw() >= y.raw());
- }
- /** Checks if one fixed point is less than the other
- *
- * @param[in] x First fixed point operand
- * @param[in] y Second fixed point operand
- *
- * @return True if fixed point is less than other
- */
- template <typename T>
- static bool isless(fixed_point<T> x, fixed_point<T> y)
- {
- uint8_t p = std::min(x.precision(), y.precision());
- x.rescale(p);
- y.rescale(p);
- return (x.raw() < y.raw());
- }
- /** Checks if one fixed point is less or equal than the other
- *
- * @param[in] x First fixed point operand
- * @param[in] y Second fixed point operand
- *
- * @return True if fixed point is less or equal than other
- */
- template <typename T>
- static bool islessequal(fixed_point<T> x, fixed_point<T> y)
- {
- uint8_t p = std::min(x.precision(), y.precision());
- x.rescale(p);
- y.rescale(p);
- return (x.raw() <= y.raw());
- }
- /** Checks if one fixed point is less or greater than the other
- *
- * @param[in] x First fixed point operand
- * @param[in] y Second fixed point operand
- *
- * @return True if fixed point is less or greater than other
- */
- template <typename T>
- static bool islessgreater(fixed_point<T> x, fixed_point<T> y)
- {
- return isnotequal(x, y);
- }
- /** Clamp fixed point to specific range.
- *
- * @param[in] x Fixed point operand
- * @param[in] min Minimum value to clamp to
- * @param[in] max Maximum value to clamp to
- *
- * @return Clamped result
- */
- template <typename T>
- static fixed_point<T> clamp(fixed_point<T> x, T min, T max)
- {
- return fixed_point<T>(constant_expr<T>::clamp(x.raw(), min, max), x.precision(), true);
- }
- /** Negate number
- *
- * @param[in] x Fixed point operand
- *
- * @return Negated fixed point result
- */
- template <OverflowPolicy OP = OverflowPolicy::SATURATE, typename T>
- static fixed_point<T> negate(fixed_point<T> x)
- {
- using promoted_T = typename traits::promote<T>::type;
- promoted_T val = -x.raw();
- if(OP == OverflowPolicy::SATURATE)
- {
- val = constant_expr<T>::saturate_cast(val);
- }
- return fixed_point<T>(static_cast<T>(val), x.precision(), true);
- }
- /** Perform addition among two fixed point numbers
- *
- * @param[in] x First fixed point operand
- * @param[in] y Second fixed point operand
- *
- * @return Result fixed point with precision equal to minimum precision of both operands
- */
- template <OverflowPolicy OP = OverflowPolicy::SATURATE, typename T>
- static fixed_point<T> add(fixed_point<T> x, fixed_point<T> y)
- {
- uint8_t p = std::min(x.precision(), y.precision());
- x.rescale(p);
- y.rescale(p);
- if(OP == OverflowPolicy::SATURATE)
- {
- using type = typename traits::promote<T>::type;
- type val = static_cast<type>(x.raw()) + static_cast<type>(y.raw());
- val = constant_expr<T>::saturate_cast(val);
- return fixed_point<T>(static_cast<T>(val), p, true);
- }
- else
- {
- return fixed_point<T>(x.raw() + y.raw(), p, true);
- }
- }
- /** Perform subtraction among two fixed point numbers
- *
- * @param[in] x First fixed point operand
- * @param[in] y Second fixed point operand
- *
- * @return Result fixed point with precision equal to minimum precision of both operands
- */
- template <OverflowPolicy OP = OverflowPolicy::SATURATE, typename T>
- static fixed_point<T> sub(fixed_point<T> x, fixed_point<T> y)
- {
- uint8_t p = std::min(x.precision(), y.precision());
- x.rescale(p);
- y.rescale(p);
- if(OP == OverflowPolicy::SATURATE)
- {
- using type = typename traits::promote<T>::type;
- type val = static_cast<type>(x.raw()) - static_cast<type>(y.raw());
- val = constant_expr<T>::saturate_cast(val);
- return fixed_point<T>(static_cast<T>(val), p, true);
- }
- else
- {
- return fixed_point<T>(x.raw() - y.raw(), p, true);
- }
- }
- /** Perform multiplication among two fixed point numbers
- *
- * @param[in] x First fixed point operand
- * @param[in] y Second fixed point operand
- *
- * @return Result fixed point with precision equal to minimum precision of both operands
- */
- template <OverflowPolicy OP = OverflowPolicy::SATURATE, typename T>
- static fixed_point<T> mul(fixed_point<T> x, fixed_point<T> y)
- {
- using promoted_T = typename traits::promote<T>::type;
- uint8_t p_min = std::min(x.precision(), y.precision());
- uint8_t p_max = std::max(x.precision(), y.precision());
- promoted_T round_factor = (1 << (p_max - 1));
- promoted_T val = ((static_cast<promoted_T>(x.raw()) * static_cast<promoted_T>(y.raw())) + round_factor) >> p_max;
- if(OP == OverflowPolicy::SATURATE)
- {
- val = constant_expr<T>::saturate_cast(val);
- }
- return fixed_point<T>(static_cast<T>(val), p_min, true);
- }
- /** Perform division among two fixed point numbers
- *
- * @param[in] x First fixed point operand
- * @param[in] y Second fixed point operand
- *
- * @return Result fixed point with precision equal to minimum precision of both operands
- */
- template <OverflowPolicy OP = OverflowPolicy::SATURATE, typename T>
- static fixed_point<T> div(fixed_point<T> x, fixed_point<T> y)
- {
- using promoted_T = typename traits::promote<T>::type;
- uint8_t p = std::min(x.precision(), y.precision());
- promoted_T denom = static_cast<promoted_T>(y.raw());
- if(denom != 0)
- {
- promoted_T val = (static_cast<promoted_T>(x.raw()) << std::max(x.precision(), y.precision())) / denom;
- if(OP == OverflowPolicy::SATURATE)
- {
- val = constant_expr<T>::saturate_cast(val);
- }
- return fixed_point<T>(static_cast<T>(val), p, true);
- }
- else
- {
- T val = (x.raw() < 0) ? std::numeric_limits<T>::min() : std::numeric_limits<T>::max();
- return fixed_point<T>(val, p, true);
- }
- }
- /** Shift left
- *
- * @param[in] x Fixed point operand
- * @param[in] shift Shift value
- *
- * @return Shifted value
- */
- template <OverflowPolicy OP = OverflowPolicy::SATURATE, typename T>
- static fixed_point<T> shift_left(fixed_point<T> x, size_t shift)
- {
- using promoted_T = typename traits::promote<T>::type;
- promoted_T val = static_cast<promoted_T>(x.raw()) << shift;
- if(OP == OverflowPolicy::SATURATE)
- {
- val = constant_expr<T>::saturate_cast(val);
- }
- return fixed_point<T>(static_cast<T>(val), x.precision(), true);
- }
- /** Shift right
- *
- * @param[in] x Fixed point operand
- * @param[in] shift Shift value
- *
- * @return Shifted value
- */
- template <typename T>
- static fixed_point<T> shift_right(fixed_point<T> x, size_t shift)
- {
- return fixed_point<T>(x.raw() >> shift, x.precision(), true);
- }
- /** Calculate absolute value
- *
- * @param[in] x Fixed point operand
- *
- * @return Absolute value of operand
- */
- template <typename T>
- static fixed_point<T> abs(fixed_point<T> x)
- {
- using promoted_T = typename traits::promote<T>::type;
- T val = (x.raw() < 0) ? constant_expr<T>::saturate_cast(-static_cast<promoted_T>(x.raw())) : x.raw();
- return fixed_point<T>(val, x.precision(), true);
- }
- /** Calculate the logarithm of a fixed point number
- *
- * @param[in] x Fixed point operand
- *
- * @return Logarithm value of operand
- */
- template <typename T>
- static fixed_point<T> log(fixed_point<T> x)
- {
- uint8_t p = x.precision();
- auto const_one = fixed_point<T>(static_cast<T>(1), p);
-
- // Logarithm of 1 is zero and logarithm of negative values is not defined in R, so return 0.
- // Also, log(x) == -log(1/x) for 0 < x < 1.
- if(isequal(x, const_one) || islessequal(x, fixed_point<T>(static_cast<T>(0), p)))
- {
- return fixed_point<T>(static_cast<T>(0), p, true);
- }
- else if(isless(x, const_one))
- {
- return mul(log(div(const_one, x)), fixed_point<T>(-1, p));
- }
-
- // Remove even powers of 2
- T shift_val = 31 - __builtin_clz(x.raw() >> p);
- x = shift_right(x, shift_val);
- x = sub(x, const_one);
-
- // Constants
- auto ln2 = fixed_point<T>(0.6931471, p);
- auto A = fixed_point<T>(1.4384189, p);
- auto B = fixed_point<T>(-0.67719, p);
- auto C = fixed_point<T>(0.3218538, p);
- auto D = fixed_point<T>(-0.0832229, p);
-
- // Polynomial expansion
- auto sum = add(mul(x, D), C);
- sum = add(mul(x, sum), B);
- sum = add(mul(x, sum), A);
- sum = mul(x, sum);
-
- return mul(add(sum, fixed_point<T>(static_cast<T>(shift_val), p)), ln2);
- }
- /** Calculate the exponential of a fixed point number.
- *
- * exp(x) = exp(floor(x)) * exp(x - floor(x))
- * = pow(2, floor(x) / ln(2)) * exp(x - floor(x))
- * = exp(x - floor(x)) << (floor(x) / ln(2))
- *
- * @param[in] x Fixed point operand
- *
- * @return Exponential value of operand
- */
- template <typename T>
- static fixed_point<T> exp(fixed_point<T> x)
- {
- uint8_t p = x.precision();
- // Constants
- auto const_one = fixed_point<T>(1, p);
- auto ln2 = fixed_point<T>(0.6931471, p);
- auto inv_ln2 = fixed_point<T>(1.442695, p);
- auto A = fixed_point<T>(0.9978546, p);
- auto B = fixed_point<T>(0.4994721, p);
- auto C = fixed_point<T>(0.1763723, p);
- auto D = fixed_point<T>(0.0435108, p);
-
- T scaled_int_part = detail::constant_expr<T>::to_int(mul(x, inv_ln2).raw(), p);
-
- // Polynomial expansion
- auto frac_part = sub(x, mul(ln2, fixed_point<T>(scaled_int_part, p)));
- auto taylor = add(mul(frac_part, D), C);
- taylor = add(mul(frac_part, taylor), B);
- taylor = add(mul(frac_part, taylor), A);
- taylor = mul(frac_part, taylor);
- taylor = add(taylor, const_one);
-
- // Saturate value
- if(static_cast<T>(clz(taylor.raw())) <= scaled_int_part)
- {
- return fixed_point<T>(std::numeric_limits<T>::max(), p, true);
- }
-
- return (scaled_int_part < 0) ? shift_right(taylor, -scaled_int_part) : shift_left(taylor, scaled_int_part);
- }
- /** Calculate the inverse square root of a fixed point number
- *
- * @param[in] x Fixed point operand
- *
- * @return Inverse square root value of operand
- */
- template <typename T>
- static fixed_point<T> inv_sqrt(fixed_point<T> x)
- {
- const uint8_t p = x.precision();
- int8_t shift = std::numeric_limits<T>::digits - (p + detail::clz(x.raw()));
-
- shift += std::numeric_limits<T>::is_signed ? 1 : 0;
-
- // Use volatile to restrict compiler optimizations on shift as compiler reports maybe-uninitialized error on Android
- volatile int8_t *shift_ptr = &shift;
-
- auto const_three = fixed_point<T>(3, p);
- auto a = (*shift_ptr < 0) ? shift_left(x, -(shift)) : shift_right(x, shift);
- fixed_point<T> x2 = a;
-
- // We need three iterations to find the result for QS8 and five for QS16
- constexpr int num_iterations = std::is_same<T, int8_t>::value ? 3 : 5;
- for(int i = 0; i < num_iterations; ++i)
- {
- fixed_point<T> three_minus_dx = sub(const_three, mul(a, mul(x2, x2)));
- x2 = shift_right(mul(x2, three_minus_dx), 1);
- }
-
- return (shift < 0) ? shift_left(x2, (-shift) >> 1) : shift_right(x2, shift >> 1);
- }
- /** Calculate the hyperbolic tangent of a fixed point number
- *
- * @param[in] x Fixed point operand
- *
- * @return Hyperbolic tangent of the operand
- */
- template <typename T>
- static fixed_point<T> tanh(fixed_point<T> x)
- {
- uint8_t p = x.precision();
- // Constants
- auto const_one = fixed_point<T>(1, p);
- auto const_two = fixed_point<T>(2, p);
-
- auto exp2x = exp(const_two * x);
- auto num = exp2x - const_one;
- auto den = exp2x + const_one;
- auto tanh = num / den;
-
- return tanh;
- }
- /** Calculate the a-th power of a fixed point number.
- *
- * The power is computed as x^a = e^(log(x) * a)
- *
- * @param[in] x Fixed point operand
- * @param[in] a Fixed point exponent
- *
- * @return a-th power of the operand
- */
- template <typename T>
- static fixed_point<T> pow(fixed_point<T> x, fixed_point<T> a)
- {
- return exp(log(x) * a);
- }
-};
-
-template <typename T>
-bool operator==(const fixed_point<T> &lhs, const fixed_point<T> &rhs)
-{
- return functions::isequal(lhs, rhs);
-}
-template <typename T>
-bool operator!=(const fixed_point<T> &lhs, const fixed_point<T> &rhs)
-{
- return !operator==(lhs, rhs);
-}
-template <typename T>
-bool operator<(const fixed_point<T> &lhs, const fixed_point<T> &rhs)
-{
- return functions::isless(lhs, rhs);
-}
-template <typename T>
-bool operator>(const fixed_point<T> &lhs, const fixed_point<T> &rhs)
-{
- return operator<(rhs, lhs);
-}
-template <typename T>
-bool operator<=(const fixed_point<T> &lhs, const fixed_point<T> &rhs)
-{
- return !operator>(lhs, rhs);
-}
-template <typename T>
-bool operator>=(const fixed_point<T> &lhs, const fixed_point<T> &rhs)
-{
- return !operator<(lhs, rhs);
-}
-template <typename T>
-fixed_point<T> operator+(const fixed_point<T> &lhs, const fixed_point<T> &rhs)
-{
- return functions::add(lhs, rhs);
-}
-template <typename T>
-fixed_point<T> operator-(const fixed_point<T> &lhs, const fixed_point<T> &rhs)
-{
- return functions::sub(lhs, rhs);
-}
-template <typename T>
-fixed_point<T> operator-(const fixed_point<T> &rhs)
-{
- return functions::negate(rhs);
-}
-template <typename T>
-fixed_point<T> operator*(fixed_point<T> x, fixed_point<T> y)
-{
- return functions::mul(x, y);
-}
-template <typename T>
-fixed_point<T> operator/(fixed_point<T> x, fixed_point<T> y)
-{
- return functions::div(x, y);
-}
-template <typename T>
-fixed_point<T> operator>>(fixed_point<T> x, size_t shift)
-{
- return functions::shift_right(x, shift);
-}
-template <typename T>
-fixed_point<T> operator<<(fixed_point<T> x, size_t shift)
-{
- return functions::shift_left(x, shift);
-}
-template <typename T, typename U, typename traits>
-std::basic_ostream<T, traits> &operator<<(std::basic_ostream<T, traits> &s, fixed_point<U> x)
-{
- return functions::write(s, x);
-}
-template <typename T>
-inline fixed_point<T> min(fixed_point<T> x, fixed_point<T> y)
-{
- return x > y ? y : x;
-}
-template <typename T>
-inline fixed_point<T> max(fixed_point<T> x, fixed_point<T> y)
-{
- return x > y ? x : y;
-}
-template <OverflowPolicy OP = OverflowPolicy::SATURATE, typename T>
-inline fixed_point<T> add(fixed_point<T> x, fixed_point<T> y)
-{
- return functions::add<OP>(x, y);
-}
-template <OverflowPolicy OP = OverflowPolicy::SATURATE, typename T>
-inline fixed_point<T> sub(fixed_point<T> x, fixed_point<T> y)
-{
- return functions::sub<OP>(x, y);
-}
-template <OverflowPolicy OP = OverflowPolicy::SATURATE, typename T>
-inline fixed_point<T> mul(fixed_point<T> x, fixed_point<T> y)
-{
- return functions::mul<OP>(x, y);
-}
-template <typename T>
-inline fixed_point<T> div(fixed_point<T> x, fixed_point<T> y)
-{
- return functions::div(x, y);
-}
-template <typename T>
-inline fixed_point<T> abs(fixed_point<T> x)
-{
- return functions::abs(x);
-}
-template <typename T>
-inline fixed_point<T> clamp(fixed_point<T> x, T min, T max)
-{
- return functions::clamp(x, min, max);
-}
-template <typename T>
-inline fixed_point<T> exp(fixed_point<T> x)
-{
- return functions::exp(x);
-}
-template <typename T>
-inline fixed_point<T> log(fixed_point<T> x)
-{
- return functions::log(x);
-}
-template <typename T>
-inline fixed_point<T> inv_sqrt(fixed_point<T> x)
-{
- return functions::inv_sqrt(x);
-}
-template <typename T>
-inline fixed_point<T> tanh(fixed_point<T> x)
-{
- return functions::tanh(x);
-}
-template <typename T>
-inline fixed_point<T> pow(fixed_point<T> x, fixed_point<T> a)
-{
- return functions::pow(x, a);
-}
-} // namespace detail
-
-// Expose operators
-using detail::operator==;
-using detail::operator!=;
-using detail::operator<;
-using detail::operator>;
-using detail::operator<=;
-using detail::operator>=;
-using detail::operator+;
-using detail::operator-;
-using detail::operator*;
-using detail::operator/;
-using detail::operator>>;
-using detail::operator<<;
-
-// Expose additional functions
-using detail::min;
-using detail::max;
-using detail::add;
-using detail::sub;
-using detail::mul;
-using detail::div;
-using detail::abs;
-using detail::clamp;
-using detail::exp;
-using detail::log;
-using detail::inv_sqrt;
-using detail::tanh;
-using detail::pow;
-// TODO: floor
-// TODO: ceil
-// TODO: sqrt
-} // namespace fixed_point_arithmetic
-} // namespace test
-} // namespace arm_compute
-#endif /*__ARM_COMPUTE_TEST_VALIDATION_FIXEDPOINT_H__ */
diff --git a/tests/validation_new/Helpers.cpp b/tests/validation_new/Helpers.cpp
deleted file mode 100644
index c65966b06f..0000000000
--- a/tests/validation_new/Helpers.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 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 "tests/validation_new/Helpers.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-TensorShape calculate_depth_concatenate_shape(const std::vector<TensorShape> &input_shapes)
-{
- ARM_COMPUTE_ERROR_ON(input_shapes.empty());
-
- TensorShape out_shape = input_shapes[0];
-
- size_t max_x = 0;
- size_t max_y = 0;
- size_t depth = 0;
-
- for(const auto &shape : input_shapes)
- {
- max_x = std::max(shape.x(), max_x);
- max_y = std::max(shape.y(), max_y);
- depth += shape.z();
- }
-
- out_shape.set(0, max_x);
- out_shape.set(1, max_y);
- out_shape.set(2, depth);
-
- return out_shape;
-}
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/Helpers.h b/tests/validation_new/Helpers.h
deleted file mode 100644
index 30959161bb..0000000000
--- a/tests/validation_new/Helpers.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * 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_VALIDATION_HELPERS_H__
-#define __ARM_COMPUTE_TEST_VALIDATION_HELPERS_H__
-
-#include "arm_compute/core/Types.h"
-#include "arm_compute/core/Utils.h"
-#include "tests/validation/half.h"
-
-#include <random>
-#include <type_traits>
-#include <utility>
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-template <typename T>
-struct is_floating_point : public std::is_floating_point<T>
-{
-};
-
-template <>
-struct is_floating_point<half_float::half> : public std::true_type
-{
-};
-
-/** Helper function to get the testing range for each activation layer.
- *
- * @param[in] activation Activation function to test.
- * @param[in] data_type Data type.
- * @param[in] fixed_point_position Number of bits for the fractional part. Defaults to 1.
- *
- * @return A pair containing the lower upper testing bounds for a given function.
- */
-template <typename T>
-std::pair<T, T> get_activation_layer_test_bounds(ActivationLayerInfo::ActivationFunction activation, DataType data_type, int fixed_point_position = 0)
-{
- std::pair<T, T> bounds;
-
- switch(data_type)
- {
- case DataType::F16:
- {
- using namespace half_float::literal;
-
- switch(activation)
- {
- case ActivationLayerInfo::ActivationFunction::SQUARE:
- case ActivationLayerInfo::ActivationFunction::LOGISTIC:
- case ActivationLayerInfo::ActivationFunction::SOFT_RELU:
- // Reduce range as exponent overflows
- bounds = std::make_pair(-10._h, 10._h);
- break;
- case ActivationLayerInfo::ActivationFunction::SQRT:
- // Reduce range as sqrt should take a non-negative number
- bounds = std::make_pair(0._h, 255._h);
- break;
- default:
- bounds = std::make_pair(-255._h, 255._h);
- break;
- }
- break;
- }
- case DataType::F32:
- switch(activation)
- {
- case ActivationLayerInfo::ActivationFunction::LOGISTIC:
- case ActivationLayerInfo::ActivationFunction::SOFT_RELU:
- // Reduce range as exponent overflows
- bounds = std::make_pair(-40.f, 40.f);
- break;
- case ActivationLayerInfo::ActivationFunction::SQRT:
- // Reduce range as sqrt should take a non-negative number
- bounds = std::make_pair(0.f, 255.f);
- break;
- default:
- bounds = std::make_pair(-255.f, 255.f);
- break;
- }
- break;
- case DataType::QS8:
- case DataType::QS16:
- switch(activation)
- {
- case ActivationLayerInfo::ActivationFunction::LOGISTIC:
- case ActivationLayerInfo::ActivationFunction::SOFT_RELU:
- case ActivationLayerInfo::ActivationFunction::TANH:
- // Reduce range as exponent overflows
- bounds = std::make_pair(-(1 << fixed_point_position), 1 << fixed_point_position);
- break;
- case ActivationLayerInfo::ActivationFunction::SQRT:
- // Reduce range as sqrt should take a non-negative number
- // Can't be zero either as inv_sqrt is used in NEON.
- bounds = std::make_pair(1, std::numeric_limits<T>::max());
- break;
- default:
- bounds = std::make_pair(std::numeric_limits<T>::lowest(), std::numeric_limits<T>::max());
- break;
- }
- break;
- default:
- ARM_COMPUTE_ERROR("Unsupported data type");
- }
-
- return bounds;
-}
-
-/** Calculate output tensor shape give a vector of input tensor to concatenate
- *
- * @param[in] input_shapes Shapes of the tensors to concatenate across depth.
- *
- * @return The shape of output concatenated tensor.
- */
-TensorShape calculate_depth_concatenate_shape(const std::vector<TensorShape> &input_shapes);
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* __ARM_COMPUTE_TEST_VALIDATION_HELPERS_H__ */
diff --git a/tests/validation_new/NEON/ActivationLayer.cpp b/tests/validation_new/NEON/ActivationLayer.cpp
deleted file mode 100644
index bc2fe603fd..0000000000
--- a/tests/validation_new/NEON/ActivationLayer.cpp
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * 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/NEActivationLayer.h"
-#include "arm_compute/runtime/Tensor.h"
-#include "arm_compute/runtime/TensorAllocator.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/NEON/Accessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/ActivationFunctionsDataset.h"
-#include "tests/datasets_new/ShapeDatasets.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/ActivationLayerFixture.h"
-#include "tests/validation_new/half.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace
-{
-/** Define tolerance of the activation layer.
- *
- * @param[in] data_type The data type used.
- * @param[in] activation The activation function used.
- *
- * @return Tolerance depending on the activation function.
- */
-AbsoluteTolerance<float> tolerance(DataType data_type, ActivationLayerInfo::ActivationFunction activation)
-{
- switch(activation)
- {
- case ActivationLayerInfo::ActivationFunction::LOGISTIC:
- case ActivationLayerInfo::ActivationFunction::SOFT_RELU:
- case ActivationLayerInfo::ActivationFunction::SQRT:
- case ActivationLayerInfo::ActivationFunction::TANH:
- switch(data_type)
- {
- case DataType::QS8:
- return AbsoluteTolerance<float>(5.f);
- case DataType::QS16:
- return AbsoluteTolerance<float>(11.f);
- case DataType::F16:
- return AbsoluteTolerance<float>(0.01f);
- default:
- return AbsoluteTolerance<float>(0.00001f);
- }
- break;
- default:
- return AbsoluteTolerance<float>(0.f);
- }
-}
-
-/** CNN data types */
-const auto CNNDataTypes = framework::dataset::make("DataType",
-{
-#ifdef ARM_COMPUTE_ENABLE_FP16
- DataType::F16,
-#endif /* ARM_COMPUTE_ENABLE_FP16 */
- DataType::F32,
- DataType::QS8,
- DataType::QS16,
-});
-
-/** Input data sets. */
-const auto ActivationDataset = combine(combine(framework::dataset::make("InPlace", { false, true }), datasets::ActivationFunctions()), framework::dataset::make("AlphaBeta", { 0.5f, 1.f }));
-} // namespace
-
-TEST_SUITE(NEON)
-TEST_SUITE(ActivationLayer)
-
-DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), CNNDataTypes), framework::dataset::make("InPlace", { false, true })),
- shape, data_type, in_place)
-{
- // Set fixed point position data type allowed
- const int fixed_point_position = is_data_type_fixed_point(data_type) ? 3 : 0;
-
- // Create tensors
- Tensor src = create_tensor<Tensor>(shape, data_type, 1, fixed_point_position);
- Tensor dst = create_tensor<Tensor>(shape, data_type, 1, fixed_point_position);
-
- ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Create and configure function
- NEActivationLayer act_layer;
-
- if(in_place)
- {
- act_layer.configure(&src, nullptr, ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::ABS));
- }
- else
- {
- act_layer.configure(&src, &dst, ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::ABS));
- }
-
- // Validate valid region
- const ValidRegion valid_region = shape_to_valid_region(shape);
- validate(src.info()->valid_region(), valid_region);
-
- if(!in_place)
- {
- validate(dst.info()->valid_region(), valid_region);
- }
-
- // Validate padding
- const PaddingSize padding = PaddingCalculator(shape.x(), 16).required_padding();
- validate(src.info()->padding(), padding);
-
- if(!in_place)
- {
- validate(dst.info()->padding(), padding);
- }
-}
-
-template <typename T>
-using NEActivationLayerFixture = ActivationValidationFixture<Tensor, Accessor, NEActivationLayer, T>;
-
-TEST_SUITE(Float)
-#ifdef ARM_COMPUTE_ENABLE_FP16
-TEST_SUITE(FP16)
-FIXTURE_DATA_TEST_CASE(RunSmall, NEActivationLayerFixture<half_float::half>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallShapes(), ActivationDataset),
- framework::dataset::make("DataType",
- DataType::F16)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance(_data_type, _function));
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NEActivationLayerFixture<half_float::half>, framework::DatasetMode::NIGHTLY, combine(combine(datasets::LargeShapes(), ActivationDataset),
- framework::dataset::make("DataType",
- DataType::F16)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance(_data_type, _function));
-}
-TEST_SUITE_END()
-#endif /* ARM_COMPUTE_ENABLE_FP16 */
-
-TEST_SUITE(FP32)
-FIXTURE_DATA_TEST_CASE(RunSmall, NEActivationLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallShapes(), ActivationDataset), framework::dataset::make("DataType",
- DataType::F32)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance(_data_type, _function));
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NEActivationLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(datasets::LargeShapes(), ActivationDataset), framework::dataset::make("DataType",
- DataType::F32)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance(_data_type, _function));
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-template <typename T>
-using NEActivationLayerFixedPointFixture = ActivationValidationFixedPointFixture<Tensor, Accessor, NEActivationLayer, T>;
-
-TEST_SUITE(Quantized)
-TEST_SUITE(QS8)
-// We test for fixed point precision [3,5] because [1,2] and [6,7] ranges cause
-// overflowing issues in most of the transcendentals functions.
-FIXTURE_DATA_TEST_CASE(RunSmall, NEActivationLayerFixedPointFixture<int8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallShapes(), ActivationDataset),
- framework::dataset::make("DataType",
- DataType::QS8)),
- framework::dataset::make("FractionalBits", 3, 6)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance(_data_type, _function));
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NEActivationLayerFixedPointFixture<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeShapes(), ActivationDataset),
- framework::dataset::make("DataType",
- DataType::QS8)),
- framework::dataset::make("FractionalBits", 3, 6)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance(_data_type, _function));
-}
-TEST_SUITE_END()
-
-TEST_SUITE(QS16)
-// Testing for fixed point position [1,14) as reciprocal limits the maximum fixed point position to 14
-FIXTURE_DATA_TEST_CASE(RunSmall, NEActivationLayerFixedPointFixture<int16_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallShapes(), ActivationDataset),
- framework::dataset::make("DataType",
- DataType::QS16)),
- framework::dataset::make("FractionalBits", 1, 14)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance(_data_type, _function));
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NEActivationLayerFixedPointFixture<int16_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeShapes(), ActivationDataset),
- framework::dataset::make("DataType",
- DataType::QS16)),
- framework::dataset::make("FractionalBits", 1, 14)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance(_data_type, _function));
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/NEON/BitwiseAnd.cpp b/tests/validation_new/NEON/BitwiseAnd.cpp
deleted file mode 100644
index 5e6f9000e2..0000000000
--- a/tests/validation_new/NEON/BitwiseAnd.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * 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/NEBitwiseAnd.h"
-#include "arm_compute/runtime/Tensor.h"
-#include "arm_compute/runtime/TensorAllocator.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/NEON/Accessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/ShapeDatasets.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/BitwiseAndFixture.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-TEST_SUITE(NEON)
-TEST_SUITE(BitwiseAnd)
-
-DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), framework::dataset::make("DataType", DataType::U8)), shape, data_type)
-{
- // Create tensors
- Tensor src1 = create_tensor<Tensor>(shape, data_type);
- Tensor src2 = create_tensor<Tensor>(shape, data_type);
- Tensor dst = create_tensor<Tensor>(shape, data_type);
-
- ARM_COMPUTE_EXPECT(src1.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(src2.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Create and configure function
- NEBitwiseAnd bitwise_and;
- bitwise_and.configure(&src1, &src2, &dst);
-
- // Validate valid region
- const ValidRegion valid_region = shape_to_valid_region(shape);
- validate(src1.info()->valid_region(), valid_region);
- validate(src2.info()->valid_region(), valid_region);
- validate(dst.info()->valid_region(), valid_region);
-
- // Validate padding
- const PaddingSize padding = PaddingCalculator(shape.x(), 16).required_padding();
- validate(src1.info()->padding(), padding);
- validate(src2.info()->padding(), padding);
- validate(dst.info()->padding(), padding);
-}
-
-template <typename T>
-using NEBitwiseAndFixture = BitwiseAndValidationFixture<Tensor, Accessor, NEBitwiseAnd, T>;
-
-FIXTURE_DATA_TEST_CASE(RunSmall, NEBitwiseAndFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), framework::dataset::make("DataType",
- DataType::U8)))
-{
- // Validate output
- validate(Accessor(_target), _reference);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NEBitwiseAndFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(datasets::LargeShapes(), framework::dataset::make("DataType",
- DataType::U8)))
-{
- // Validate output
- validate(Accessor(_target), _reference);
-}
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/NEON/BitwiseNot.cpp b/tests/validation_new/NEON/BitwiseNot.cpp
deleted file mode 100644
index 3725379404..0000000000
--- a/tests/validation_new/NEON/BitwiseNot.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * 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/NEBitwiseNot.h"
-#include "arm_compute/runtime/Tensor.h"
-#include "arm_compute/runtime/TensorAllocator.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/NEON/Accessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/ShapeDatasets.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/BitwiseNotFixture.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-TEST_SUITE(NEON)
-TEST_SUITE(BitwiseNot)
-
-DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), framework::dataset::make("DataType", DataType::U8)), shape, data_type)
-{
- // Create tensors
- Tensor src = create_tensor<Tensor>(shape, data_type);
- Tensor dst = create_tensor<Tensor>(shape, data_type);
-
- ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Create and configure function
- NEBitwiseNot bitwise_not;
- bitwise_not.configure(&src, &dst);
-
- // Validate valid region
- const ValidRegion valid_region = shape_to_valid_region(shape);
- validate(src.info()->valid_region(), valid_region);
- validate(dst.info()->valid_region(), valid_region);
-
- // Validate padding
- const PaddingSize padding = PaddingCalculator(shape.x(), 16).required_padding();
- validate(src.info()->padding(), padding);
- validate(dst.info()->padding(), padding);
-}
-
-template <typename T>
-using NEBitwiseNotFixture = BitwiseNotValidationFixture<Tensor, Accessor, NEBitwiseNot, T>;
-
-FIXTURE_DATA_TEST_CASE(RunSmall, NEBitwiseNotFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), framework::dataset::make("DataType",
- DataType::U8)))
-{
- // Validate output
- validate(Accessor(_target), _reference);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NEBitwiseNotFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(datasets::LargeShapes(), framework::dataset::make("DataType",
- DataType::U8)))
-{
- // Validate output
- validate(Accessor(_target), _reference);
-}
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/NEON/BitwiseOr.cpp b/tests/validation_new/NEON/BitwiseOr.cpp
deleted file mode 100644
index 84ddf8ea47..0000000000
--- a/tests/validation_new/NEON/BitwiseOr.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * 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/NEBitwiseOr.h"
-#include "arm_compute/runtime/Tensor.h"
-#include "arm_compute/runtime/TensorAllocator.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/NEON/Accessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/ShapeDatasets.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/BitwiseOrFixture.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-TEST_SUITE(NEON)
-TEST_SUITE(BitwiseOr)
-
-DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), framework::dataset::make("DataType", DataType::U8)), shape, data_type)
-{
- // Create tensors
- Tensor src1 = create_tensor<Tensor>(shape, data_type);
- Tensor src2 = create_tensor<Tensor>(shape, data_type);
- Tensor dst = create_tensor<Tensor>(shape, data_type);
-
- ARM_COMPUTE_EXPECT(src1.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(src2.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Create and configure function
- NEBitwiseOr bitwise_or;
- bitwise_or.configure(&src1, &src2, &dst);
-
- // Validate valid region
- const ValidRegion valid_region = shape_to_valid_region(shape);
- validate(src1.info()->valid_region(), valid_region);
- validate(src2.info()->valid_region(), valid_region);
- validate(dst.info()->valid_region(), valid_region);
-
- // Validate padding
- const PaddingSize padding = PaddingCalculator(shape.x(), 16).required_padding();
- validate(src1.info()->padding(), padding);
- validate(src2.info()->padding(), padding);
- validate(dst.info()->padding(), padding);
-}
-
-template <typename T>
-using NEBitwiseOrFixture = BitwiseOrValidationFixture<Tensor, Accessor, NEBitwiseOr, T>;
-
-FIXTURE_DATA_TEST_CASE(RunSmall, NEBitwiseOrFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), framework::dataset::make("DataType",
- DataType::U8)))
-{
- // Validate output
- validate(Accessor(_target), _reference);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NEBitwiseOrFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(datasets::LargeShapes(), framework::dataset::make("DataType",
- DataType::U8)))
-{
- // Validate output
- validate(Accessor(_target), _reference);
-}
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/NEON/BitwiseXor.cpp b/tests/validation_new/NEON/BitwiseXor.cpp
deleted file mode 100644
index 5a5a650295..0000000000
--- a/tests/validation_new/NEON/BitwiseXor.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * 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/NEBitwiseXor.h"
-#include "arm_compute/runtime/Tensor.h"
-#include "arm_compute/runtime/TensorAllocator.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/NEON/Accessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/ShapeDatasets.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/BitwiseXorFixture.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-TEST_SUITE(NEON)
-TEST_SUITE(BitwiseXor)
-
-DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), framework::dataset::make("DataType", DataType::U8)), shape, data_type)
-{
- // Create tensors
- Tensor src1 = create_tensor<Tensor>(shape, data_type);
- Tensor src2 = create_tensor<Tensor>(shape, data_type);
- Tensor dst = create_tensor<Tensor>(shape, data_type);
-
- ARM_COMPUTE_EXPECT(src1.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(src2.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Create and configure function
- NEBitwiseXor bitwise_xor;
- bitwise_xor.configure(&src1, &src2, &dst);
-
- // Validate valid region
- const ValidRegion valid_region = shape_to_valid_region(shape);
- validate(src1.info()->valid_region(), valid_region);
- validate(src2.info()->valid_region(), valid_region);
- validate(dst.info()->valid_region(), valid_region);
-
- // Validate padding
- const PaddingSize padding = PaddingCalculator(shape.x(), 16).required_padding();
- validate(src1.info()->padding(), padding);
- validate(src2.info()->padding(), padding);
- validate(dst.info()->padding(), padding);
-}
-
-template <typename T>
-using NEBitwiseXorFixture = BitwiseXorValidationFixture<Tensor, Accessor, NEBitwiseXor, T>;
-
-FIXTURE_DATA_TEST_CASE(RunSmall, NEBitwiseXorFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), framework::dataset::make("DataType",
- DataType::U8)))
-{
- // Validate output
- validate(Accessor(_target), _reference);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NEBitwiseXorFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(datasets::LargeShapes(), framework::dataset::make("DataType",
- DataType::U8)))
-{
- // Validate output
- validate(Accessor(_target), _reference);
-}
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/NEON/ConvolutionLayer.cpp b/tests/validation_new/NEON/ConvolutionLayer.cpp
deleted file mode 100644
index 1efff02428..0000000000
--- a/tests/validation_new/NEON/ConvolutionLayer.cpp
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * 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/NEConvolutionLayer.h"
-#include "arm_compute/runtime/Tensor.h"
-#include "arm_compute/runtime/TensorAllocator.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/NEON/Accessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/LargeConvolutionLayerDataset.h"
-#include "tests/datasets_new/SmallConvolutionLayerDataset.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/ConvolutionLayerFixture.h"
-#include "tests/validation_new/half.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace
-{
-const AbsoluteTolerance<float> tolerance_f32(0.001f); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F32 */
-#ifdef ARM_COMPUTE_ENABLE_FP16
-const AbsoluteTolerance<float> tolerance_f16(0.01f); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F16 */
-#endif /* ARM_COMPUTE_ENABLE_FP16 */
-const AbsoluteTolerance<float> tolerance_q(1.0f); /**< Tolerance value for comparing reference's output against implementation's output for fixed point data types */
-
-/** CNN data types */
-const auto CNNDataTypes = framework::dataset::make("DataType",
-{
-#ifdef ARM_COMPUTE_ENABLE_FP16
- DataType::F16,
-#endif /* ARM_COMPUTE_ENABLE_FP16 */
- DataType::F32,
- DataType::QS8,
- DataType::QS16,
-});
-} // namespace
-
-TEST_SUITE(NEON)
-TEST_SUITE(ConvolutionLayer)
-
-DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(framework::dataset::concat(datasets::SmallConvolutionLayerDataset(), datasets::LargeConvolutionLayerDataset()), CNNDataTypes),
- input_shape, weights_shape, bias_shape, output_shape, info, data_type)
-{
- // Set fixed point position data type allowed
- int fixed_point_position = is_data_type_fixed_point(data_type) ? 3 : 0;
-
- // Create tensors
- Tensor src = create_tensor<Tensor>(input_shape, data_type, 1, fixed_point_position);
- Tensor weights = create_tensor<Tensor>(weights_shape, data_type, 1, fixed_point_position);
- Tensor bias = create_tensor<Tensor>(bias_shape, data_type, 1, fixed_point_position);
- Tensor dst = create_tensor<Tensor>(output_shape, data_type, 1, fixed_point_position);
-
- ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(weights.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(bias.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Create and configure function
- NEConvolutionLayer conv;
- conv.configure(&src, &weights, &bias, &dst, info);
-
- // Validate valid region
- const ValidRegion src_valid_region = shape_to_valid_region(input_shape);
- const ValidRegion weights_valid_region = shape_to_valid_region(weights_shape);
- const ValidRegion bias_valid_region = shape_to_valid_region(bias_shape);
- const ValidRegion dst_valid_region = shape_to_valid_region(output_shape);
-
- validate(src.info()->valid_region(), src_valid_region);
- validate(weights.info()->valid_region(), weights_valid_region);
- validate(bias.info()->valid_region(), bias_valid_region);
- validate(dst.info()->valid_region(), dst_valid_region);
-
- // Validate padding
- //TODO(COMPMID-415) Need to validate padding?
-}
-
-template <typename T>
-using NEConvolutionLayerFixture = ConvolutionValidationFixture<Tensor, Accessor, NEConvolutionLayer, T>;
-
-TEST_SUITE(Float)
-#ifdef ARM_COMPUTE_ENABLE_FP16
-TEST_SUITE(FP16)
-FIXTURE_DATA_TEST_CASE(RunSmall, NEConvolutionLayerFixture<half_float::half>, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallConvolutionLayerDataset(),
- framework::dataset::make("DataType",
- DataType::F16)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_f16);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NEConvolutionLayerFixture<half_float::half>, framework::DatasetMode::NIGHTLY, combine(datasets::LargeConvolutionLayerDataset(),
- framework::dataset::make("DataType",
- DataType::F16)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_f16);
-}
-TEST_SUITE_END()
-#endif /* ARM_COMPUTE_ENABLE_FP16 */
-
-TEST_SUITE(FP32)
-FIXTURE_DATA_TEST_CASE(RunSmall, NEConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallConvolutionLayerDataset(), framework::dataset::make("DataType",
- DataType::F32)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_f32);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NEConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(datasets::LargeConvolutionLayerDataset(), framework::dataset::make("DataType",
- DataType::F32)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_f32);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-template <typename T>
-using NEConvolutionLayerFixedPointFixture = ConvolutionValidationFixedPointFixture<Tensor, Accessor, NEConvolutionLayer, T>;
-
-TEST_SUITE(Quantized)
-TEST_SUITE(QS8)
-// We test for fixed point precision [4,6]
-FIXTURE_DATA_TEST_CASE(RunSmall, NEConvolutionLayerFixedPointFixture<int8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallConvolutionLayerDataset(),
- framework::dataset::make("DataType",
- DataType::QS8)),
- framework::dataset::make("FractionalBits", 4, 7)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_q);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NEConvolutionLayerFixedPointFixture<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(datasets::LargeConvolutionLayerDataset(),
- framework::dataset::make("DataType",
- DataType::QS8)),
- framework::dataset::make("FractionalBits", 4, 7)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_q);
-}
-TEST_SUITE_END()
-
-TEST_SUITE(QS16)
-// Testing for fixed point position [1,14)
-FIXTURE_DATA_TEST_CASE(RunSmall, NEConvolutionLayerFixedPointFixture<int16_t>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallConvolutionLayerDataset(),
- framework::dataset::make("DataType",
- DataType::QS16)),
- framework::dataset::make("FractionalBits", 1, 14)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_q);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NEConvolutionLayerFixedPointFixture<int16_t>, framework::DatasetMode::NIGHTLY, combine(combine(datasets::LargeConvolutionLayerDataset(),
- framework::dataset::make("DataType",
- DataType::QS16)),
- framework::dataset::make("FractionalBits", 1, 14)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_q);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/NEON/DepthConcatenateLayer.cpp b/tests/validation_new/NEON/DepthConcatenateLayer.cpp
deleted file mode 100644
index d6400d2df5..0000000000
--- a/tests/validation_new/NEON/DepthConcatenateLayer.cpp
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * 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/NEDepthConcatenate.h"
-#include "arm_compute/runtime/Tensor.h"
-#include "arm_compute/runtime/TensorAllocator.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/NEON/Accessor.h"
-#include "tests/datasets_new/ShapeDatasets.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/DepthConcatenateLayerFixture.h"
-#include "tests/validation_new/half.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-TEST_SUITE(NEON)
-TEST_SUITE(DepthConcatenateLayer)
-
-//TODO(COMPMID-415): Add configuration test?
-
-template <typename T>
-using NEDepthConcatenateLayerFixture = DepthConcatenateValidationFixture<Tensor, Accessor, NEDepthConcatenate, T>;
-
-TEST_SUITE(Float)
-#ifdef ARM_COMPUTE_ENABLE_FP16
-TEST_SUITE(FP16)
-FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthConcatenateLayerFixture<half_float::half>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), framework::dataset::make("DataType",
- DataType::F16)))
-{
- // Validate output
- validate(Accessor(_target), _reference);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthConcatenateLayerFixture<half_float::half>, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(), framework::dataset::make("DataType",
- DataType::F16)))
-{
- // Validate output
- validate(Accessor(_target), _reference);
-}
-TEST_SUITE_END()
-#endif /* ARM_COMPUTE_ENABLE_FP16 */
-
-TEST_SUITE(FP32)
-FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthConcatenateLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), framework::dataset::make("DataType",
- DataType::F32)))
-{
- // Validate output
- validate(Accessor(_target), _reference);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthConcatenateLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(), framework::dataset::make("DataType",
- DataType::F32)))
-{
- // Validate output
- validate(Accessor(_target), _reference);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-TEST_SUITE(Quantized)
-TEST_SUITE(QS8)
-FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthConcatenateLayerFixture<int8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(),
- framework::dataset::make("DataType",
- DataType::QS8)))
-{
- // Validate output
- validate(Accessor(_target), _reference);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthConcatenateLayerFixture<int8_t>, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(),
- framework::dataset::make("DataType",
- DataType::QS8)))
-{
- // Validate output
- validate(Accessor(_target), _reference);
-}
-TEST_SUITE_END()
-
-TEST_SUITE(QS16)
-FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthConcatenateLayerFixture<int16_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(),
- framework::dataset::make("DataType",
- DataType::QS16)))
-{
- // Validate output
- validate(Accessor(_target), _reference);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthConcatenateLayerFixture<int16_t>, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(),
- framework::dataset::make("DataType",
- DataType::QS16)))
-{
- // Validate output
- validate(Accessor(_target), _reference);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/NEON/DequantizationLayer.cpp b/tests/validation_new/NEON/DequantizationLayer.cpp
deleted file mode 100644
index 8b67a14d12..0000000000
--- a/tests/validation_new/NEON/DequantizationLayer.cpp
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * 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/NEDequantizationLayer.h"
-#include "arm_compute/runtime/Tensor.h"
-#include "arm_compute/runtime/TensorAllocator.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/NEON/Accessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/ShapeDatasets.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/DequantizationLayerFixture.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace
-{
-/** Tolerance for float operations */
-constexpr AbsoluteTolerance<float> tolerance_f32(0.001f);
-} // namespace
-
-TEST_SUITE(NEON)
-TEST_SUITE(DequantizationLayer)
-
-DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(concat(datasets::Small2DShapes(), datasets::Large2DShapes()), framework::dataset::make("DataType", DataType::U8)), shape, data_type)
-{
- // Create tensors
- Tensor src = create_tensor<Tensor>(shape, data_type);
- Tensor dst = create_tensor<Tensor>(shape, DataType::F32);
-
- ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Create and configure function
- float min = 0.f;
- float max = 0.f;
- NEDequantizationLayer dequant_layer;
- dequant_layer.configure(&src, &dst, &min, &max);
-
- // Validate valid region
- const ValidRegion valid_region = shape_to_valid_region(shape);
- validate(src.info()->valid_region(), valid_region);
- validate(dst.info()->valid_region(), valid_region);
-
- // Validate padding
- const PaddingSize padding = PaddingCalculator(shape.x(), 8).required_padding();
- validate(src.info()->padding(), padding);
- validate(dst.info()->padding(), padding);
-}
-
-template <typename T>
-using NEDequantizationLayerFixture = DequantizationValidationFixture<Tensor, Accessor, NEDequantizationLayer, T>;
-
-TEST_SUITE(Integer)
-TEST_SUITE(U8)
-FIXTURE_DATA_TEST_CASE(RunSmall, NEDequantizationLayerFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), framework::dataset::make("DataType", DataType::U8)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_f32);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NEDequantizationLayerFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(), framework::dataset::make("DataType", DataType::U8)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_f32);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/NEON/DirectConvolutionLayer.cpp b/tests/validation_new/NEON/DirectConvolutionLayer.cpp
deleted file mode 100644
index 68cbe54b32..0000000000
--- a/tests/validation_new/NEON/DirectConvolutionLayer.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * 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/NEDirectConvolutionLayer.h"
-#include "arm_compute/runtime/Tensor.h"
-#include "arm_compute/runtime/TensorAllocator.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/NEON/Accessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/ShapeDatasets.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/DirectConvolutionLayerFixture.h"
-#include "tests/validation_new/half.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace
-{
-constexpr AbsoluteTolerance<float> tolerance_qs(1.f); /**< Tolerance for fixed point tests */
-#ifdef ARM_COMPUTE_ENABLE_FP16
-constexpr AbsoluteTolerance<float> tolerance_fp16(0.01f); /**< Tolerance for half precision floating point tests */
-#endif /* ARM_COMPUTE_ENABLE_FP16 */
-constexpr AbsoluteTolerance<float> tolerance_fp32(0.001f); /**< Tolerance for floating point tests */
-
-/** Direct convolution data set. */
-const auto data_pad_f32 = concat(concat(combine(framework::dataset::make("PadX", 0),
- combine(framework::dataset::make("PadY", 0),
- framework::dataset::make("KernelSize", 1))),
- combine(framework::dataset::make("PadX", 0, 2),
- combine(framework::dataset::make("PadY", 0, 2),
- framework::dataset::make("KernelSize", 3)))),
- combine(framework::dataset::make("PadX", 0, 3),
- combine(framework::dataset::make("PadY", 0, 3),
- framework::dataset::make("KernelSize", 5))));
-
-const auto data_pad_qs8 = concat(combine(framework::dataset::make("PadX", 0),
- combine(framework::dataset::make("PadY", 0),
- framework::dataset::make("KernelSize", 1))),
- combine(framework::dataset::make("PadX", 0, 2),
- combine(framework::dataset::make("PadY", 0, 2),
- framework::dataset::make("KernelSize", 3))));
-
-const auto data_f32 = combine(datasets::SmallDirectConvolutionShapes(),
- combine(framework::dataset::make("StrideX", 1, 3),
- combine(framework::dataset::make("StrideY", 1, 3),
- combine(data_pad_f32,
- framework::dataset::make("NumKernels", { 1, 4, 8, 16 })))));
-
-const auto data_qs8 = combine(datasets::SmallDirectConvolutionShapes(),
- combine(framework::dataset::make("StrideX", 1, 3),
- combine(framework::dataset::make("StrideY", 1, 3),
- combine(data_pad_qs8,
- framework::dataset::make("NumKernels", { 1, 4, 8, 16 })))));
-
-/** Direct convolution QS16 data set. */
-const auto data_qs16 = combine(datasets::SmallDirectConvolutionShapes(),
- combine(framework::dataset::make("StrideX", 1, 3),
- combine(framework::dataset::make("StrideY", 1, 3),
- combine(framework::dataset::make("PadX", 0),
- combine(framework::dataset::make("PadY", 0),
- combine(framework::dataset::make("KernelSize", 1),
- framework::dataset::make("NumKernels", { 1, 4, 8, 16 })))))));
-} // namespace
-
-TEST_SUITE(NEON)
-TEST_SUITE(DirectConvolutionLayer)
-
-//TODO(COMPMID-415): Configuration tests?
-
-template <typename T>
-using NEDirectConvolutionLayerFixture = DirectConvolutionValidationFixture<Tensor, Accessor, NEDirectConvolutionLayer, T>;
-
-TEST_SUITE(Float)
-#ifdef ARM_COMPUTE_ENABLE_FP16
-TEST_SUITE(FP16)
-FIXTURE_DATA_TEST_CASE(Run, NEDirectConvolutionLayerFixture<half_float::half>, framework::DatasetMode::ALL, combine(data_f32, framework::dataset::make("DataType", DataType::F16)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_fp16);
-}
-TEST_SUITE_END()
-#endif /* ARM_COMPUTE_ENABLE_FP16 */
-
-TEST_SUITE(FP32)
-FIXTURE_DATA_TEST_CASE(Run, NEDirectConvolutionLayerFixture<float>, framework::DatasetMode::ALL, combine(data_f32, framework::dataset::make("DataType", DataType::F32)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_fp32);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-template <typename T>
-using NEDirectConvolutionLayerFixedPointFixture = DirectConvolutionValidationFixedPointFixture<Tensor, Accessor, NEDirectConvolutionLayer, T>;
-
-TEST_SUITE(Quantized)
-TEST_SUITE(QS8)
-// We test for fixed point precision [4,6]
-FIXTURE_DATA_TEST_CASE(Run, NEDirectConvolutionLayerFixedPointFixture<int8_t>, framework::DatasetMode::ALL, combine(combine(data_qs8, framework::dataset::make("DataType", DataType::QS8)),
- framework::dataset::make("FractionalBits", 4, 7)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_qs);
-}
-TEST_SUITE_END()
-
-TEST_SUITE(QS16)
-// We test for fixed point precision [4,13]
-FIXTURE_DATA_TEST_CASE(Run, NEDirectConvolutionLayerFixedPointFixture<int16_t>, framework::DatasetMode::ALL, combine(combine(data_qs16, framework::dataset::make("DataType", DataType::QS16)),
- framework::dataset::make("FractionalBits", 4, 14)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_qs);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/NEON/Floor.cpp b/tests/validation_new/NEON/Floor.cpp
deleted file mode 100644
index e100c3035b..0000000000
--- a/tests/validation_new/NEON/Floor.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * 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/NEFloor.h"
-#include "arm_compute/runtime/Tensor.h"
-#include "arm_compute/runtime/TensorAllocator.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/NEON/Accessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/ShapeDatasets.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/FloorFixture.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-TEST_SUITE(NEON)
-TEST_SUITE(Floor)
-
-template <typename T>
-using NEFloorFixture = FloorValidationFixture<Tensor, Accessor, NEFloor, T>;
-
-TEST_SUITE(FP32)
-FIXTURE_DATA_TEST_CASE(RunSmall, NEFloorFixture<float>, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F32)))
-{
- // Validate output
- validate(Accessor(_target), _reference);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NEFloorFixture<float>, framework::DatasetMode::NIGHTLY, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F32)))
-{
- // 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_new/NEON/FullyConnectedLayer.cpp b/tests/validation_new/NEON/FullyConnectedLayer.cpp
deleted file mode 100644
index e859fb3872..0000000000
--- a/tests/validation_new/NEON/FullyConnectedLayer.cpp
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * 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/NEFullyConnectedLayer.h"
-#include "arm_compute/runtime/Tensor.h"
-#include "arm_compute/runtime/TensorAllocator.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/NEON/Accessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/FullyConnectedLayerDataset.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/FullyConnectedLayerFixture.h"
-#include "tests/validation_new/half.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace
-{
-/** Tolerance for float operations */
-constexpr AbsoluteTolerance<float> tolerance_f32(0.001f);
-#ifdef ARM_COMPUTE_ENABLE_FP16
-constexpr AbsoluteTolerance<float> tolerance_f16(0.01f);
-#endif /* ARM_COMPUTE_ENABLE_FP16*/
-/** Tolerance for fixed point operations */
-constexpr AbsoluteTolerance<float> tolerance_fixed_point(1.f);
-
-/** CNN data types */
-const auto CNNDataTypes = framework::dataset::make("DataType",
-{
-#ifdef ARM_COMPUTE_ENABLE_FP16
- DataType::F16,
-#endif /* ARM_COMPUTE_ENABLE_FP16 */
- DataType::F32,
- DataType::QS8,
- DataType::QS16,
-});
-
-const auto FullyConnectedParameters = combine(framework::dataset::make("TransposeWeights", { false, true }), framework::dataset::make("ReshapeWeights", { false, true }));
-} // namespace
-
-TEST_SUITE(NEON)
-TEST_SUITE(FullyConnectedLayer)
-
-DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(framework::dataset::concat(datasets::SmallFullyConnectedLayerDataset(), datasets::LargeFullyConnectedLayerDataset()),
- FullyConnectedParameters),
- CNNDataTypes),
- src_shape, weights_shape, bias_shape, dst_shape, transpose_weights, reshape_weights, data_type)
-{
- // Set fixed point position data type allowed
- int fixed_point_position = is_data_type_fixed_point(data_type) ? 3 : 0;
-
- TensorShape ws(weights_shape);
-
- // Transpose weights if not done in the function
- if(!reshape_weights || !transpose_weights)
- {
- const size_t shape_x = ws.x();
- ws.set(0, ws.y());
- ws.set(1, shape_x);
-
- // Weights have to be passed reshaped
- // Transpose 1xW for batched version
- if(!reshape_weights && dst_shape.y() > 1)
- {
- const float transpose_width = 16.0f / data_size_from_type(data_type);
- const size_t shape_x = ws.x();
- ws.set(0, ws.y() * static_cast<unsigned int>(transpose_width));
- ws.set(1, static_cast<unsigned int>(std::ceil(shape_x / transpose_width)));
- }
- }
-
- // Create tensors
- Tensor src = create_tensor<Tensor>(src_shape, data_type, 1, fixed_point_position);
- Tensor weights = create_tensor<Tensor>(ws, data_type, 1, fixed_point_position);
- Tensor bias = create_tensor<Tensor>(bias_shape, data_type, 1, fixed_point_position);
- Tensor dst = create_tensor<Tensor>(dst_shape, data_type, 1, fixed_point_position);
-
- ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(weights.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(bias.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Create and configure function.
- NEFullyConnectedLayer fc;
- fc.configure(&src, &weights, &bias, &dst, transpose_weights, !reshape_weights);
-
- // Validate valid region
- const ValidRegion dst_valid_region = shape_to_valid_region(dst_shape);
- validate(dst.info()->valid_region(), dst_valid_region);
-}
-
-template <typename T>
-using NEFullyConnectedLayerFixture = FullyConnectedLayerValidationFixture<Tensor, Accessor, NEFullyConnectedLayer, T, true>;
-
-TEST_SUITE(Float)
-#ifdef ARM_COMPUTE_ENABLE_FP16
-TEST_SUITE(FP16)
-FIXTURE_DATA_TEST_CASE(RunSmall, NEFullyConnectedLayerFixture<half_float::half>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallFullyConnectedLayerDataset(),
- FullyConnectedParameters),
- framework::dataset::make("DataType", DataType::F16)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_f16);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NEFullyConnectedLayerFixture<half_float::half>, framework::DatasetMode::NIGHTLY, combine(combine(datasets::LargeFullyConnectedLayerDataset(),
- FullyConnectedParameters),
- framework::dataset::make("DataType", DataType::F16)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_f16);
-}
-TEST_SUITE_END()
-#endif /* ARM_COMPUTE_ENABLE_FP16 */
-
-TEST_SUITE(FP32)
-FIXTURE_DATA_TEST_CASE(RunSmall, NEFullyConnectedLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallFullyConnectedLayerDataset(), FullyConnectedParameters),
- framework::dataset::make("DataType", DataType::F32)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_f32);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NEFullyConnectedLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(datasets::LargeFullyConnectedLayerDataset(), FullyConnectedParameters),
- framework::dataset::make("DataType", DataType::F32)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_f32);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-template <typename T>
-using NEFullyConnectedLayerFixedPointFixture = FullyConnectedLayerValidationFixedPointFixture<Tensor, Accessor, NEFullyConnectedLayer, T, true>;
-
-TEST_SUITE(Quantized)
-TEST_SUITE(QS8)
-// Testing for fixed point position [1,6) as reciprocal limits the maximum fixed point position to 5
-FIXTURE_DATA_TEST_CASE(RunSmall, NEFullyConnectedLayerFixedPointFixture<int8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallFullyConnectedLayerDataset(),
- FullyConnectedParameters),
- framework::dataset::make("DataType",
- DataType::QS8)),
- framework::dataset::make("FractionalBits", 1, 6)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_fixed_point);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NEFullyConnectedLayerFixedPointFixture<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeFullyConnectedLayerDataset(),
- FullyConnectedParameters),
- framework::dataset::make("DataType",
- DataType::QS8)),
- framework::dataset::make("FractionalBits", 1, 6)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_fixed_point);
-}
-TEST_SUITE_END()
-
-TEST_SUITE(QS16)
-// Testing for fixed point position [1,14) as reciprocal limits the maximum fixed point position to 14
-FIXTURE_DATA_TEST_CASE(RunSmall, NEFullyConnectedLayerFixedPointFixture<int16_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallFullyConnectedLayerDataset(),
- FullyConnectedParameters),
- framework::dataset::make("DataType",
- DataType::QS16)),
- framework::dataset::make("FractionalBits", 1, 14)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_fixed_point);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NEFullyConnectedLayerFixedPointFixture<int16_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeFullyConnectedLayerDataset(),
- FullyConnectedParameters),
- framework::dataset::make("DataType",
- DataType::QS16)),
- framework::dataset::make("FractionalBits", 1, 14)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_fixed_point);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/NEON/GEMM.cpp b/tests/validation_new/NEON/GEMM.cpp
deleted file mode 100644
index 453b183d1e..0000000000
--- a/tests/validation_new/NEON/GEMM.cpp
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * 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/NEGEMM.h"
-#include "arm_compute/runtime/Tensor.h"
-#include "arm_compute/runtime/TensorAllocator.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/NEON/Accessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/LargeGEMMDataset.h"
-#include "tests/datasets_new/SmallGEMMDataset.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/GEMMFixture.h"
-#include "tests/validation_new/half.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace
-{
-constexpr AbsoluteTolerance<float> tolerance_f(0.001f); /**< Tolerance value for comparing reference's output against implementation's output for floating point data types */
-constexpr AbsoluteTolerance<float> tolerance_q(1.0f); /**< Tolerance value for comparing reference's output against implementation's output for fixed point data types */
-
-/** CNN data types */
-const auto CNNDataTypes = framework::dataset::make("DataType",
-{
-#ifdef ARM_COMPUTE_ENABLE_FP16
- DataType::F16,
-#endif /* ARM_COMPUTE_ENABLE_FP16 */
- DataType::F32,
- DataType::QS8,
- DataType::QS16,
-});
-} // namespace
-
-TEST_SUITE(NEON)
-TEST_SUITE(GEMM)
-
-DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(framework::dataset::concat(datasets::SmallGEMMDataset(), datasets::LargeGEMMDataset()), CNNDataTypes),
- shape_a, shape_b, shape_c, output_shape, alpha, beta, data_type)
-{
- // Set fixed point position data type allowed
- const int fixed_point_position = is_data_type_fixed_point(data_type) ? 3 : 0;
-
- // Create tensors
- Tensor a = create_tensor<Tensor>(shape_a, data_type, 1, fixed_point_position);
- Tensor b = create_tensor<Tensor>(shape_b, data_type, 1, fixed_point_position);
- Tensor c = create_tensor<Tensor>(shape_c, data_type, 1, fixed_point_position);
- Tensor dst = create_tensor<Tensor>(output_shape, data_type, 1, fixed_point_position);
-
- ARM_COMPUTE_EXPECT(a.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(b.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(c.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Create and configure function
- NEGEMM gemm;
- gemm.configure(&a, &b, &c, &dst, alpha, beta);
-
- //TODO(COMPMID-415): Validate valid region
-}
-
-template <typename T>
-using NEGEMMFixture = GEMMValidationFixture<Tensor, Accessor, NEGEMM, T>;
-
-TEST_SUITE(Float)
-#ifdef ARM_COMPUTE_ENABLE_FP16
-TEST_SUITE(FP16)
-FIXTURE_DATA_TEST_CASE(RunSmall, NEGEMMFixture<half_float::half>, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallGEMMDataset(), framework::dataset::make("DataType", DataType::F16)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_f);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NEGEMMFixture<half_float::half>, framework::DatasetMode::NIGHTLY, combine(datasets::LargeGEMMDataset(), framework::dataset::make("DataType",
- DataType::F16)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_f);
-}
-TEST_SUITE_END()
-#endif /* ARM_COMPUTE_ENABLE_FP16 */
-
-TEST_SUITE(FP32)
-FIXTURE_DATA_TEST_CASE(RunSmall, NEGEMMFixture<float>, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallGEMMDataset(), framework::dataset::make("DataType", DataType::F32)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_f);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NEGEMMFixture<float>, framework::DatasetMode::NIGHTLY, combine(datasets::LargeGEMMDataset(), framework::dataset::make("DataType", DataType::F32)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_f);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-template <typename T>
-using NEGEMMFixedPointFixture = GEMMValidationFixedPointFixture<Tensor, Accessor, NEGEMM, T>;
-
-TEST_SUITE(Quantized)
-TEST_SUITE(QS8)
-FIXTURE_DATA_TEST_CASE(RunSmall, NEGEMMFixedPointFixture<int8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallGEMMDataset(),
- framework::dataset::make("DataType",
- DataType::QS8)),
- framework::dataset::make("FractionalBits", 1, 7)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_q);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NEGEMMFixedPointFixture<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(datasets::LargeGEMMDataset(),
- framework::dataset::make("DataType",
- DataType::QS8)),
- framework::dataset::make("FractionalBits", 1, 7)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_q);
-}
-TEST_SUITE_END()
-
-TEST_SUITE(QS16)
-FIXTURE_DATA_TEST_CASE(RunSmall, NEGEMMFixedPointFixture<int16_t>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallGEMMDataset(),
- framework::dataset::make("DataType",
- DataType::QS16)),
- framework::dataset::make("FractionalBits", 1, 14)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_q);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NEGEMMFixedPointFixture<int16_t>, framework::DatasetMode::NIGHTLY, combine(combine(datasets::LargeGEMMDataset(),
- framework::dataset::make("DataType",
- DataType::QS16)),
- framework::dataset::make("FractionalBits", 1, 14)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_q);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/NEON/L2Normalize.cpp b/tests/validation_new/NEON/L2Normalize.cpp
deleted file mode 100644
index 20804d2a94..0000000000
--- a/tests/validation_new/NEON/L2Normalize.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * 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/NEL2Normalize.h"
-#include "arm_compute/runtime/Tensor.h"
-#include "arm_compute/runtime/TensorAllocator.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/NEON/Accessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/ShapeDatasets.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/L2NormalizeFixture.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace
-{
-/** Tolerance for float operations */
-constexpr RelativeTolerance tolerance_f32(0.00001f);
-} // namespace
-
-TEST_SUITE(NEON)
-TEST_SUITE(L2Normalize)
-
-template <typename T>
-using NEL2NormalizeFixture = L2NormalizeValidationFixture<Tensor, Accessor, NEL2Normalize, T>;
-
-TEST_SUITE(FP32)
-FIXTURE_DATA_TEST_CASE(RunSmall, NEL2NormalizeFixture<float>, framework::DatasetMode::PRECOMMIT,
- combine(combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F32)), framework::dataset::make("Axis", { 0 })), framework::dataset::make("Epsilon", { 1e-12 })))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_f32);
-}
-
-FIXTURE_DATA_TEST_CASE(RunLarge, NEL2NormalizeFixture<float>, framework::DatasetMode::NIGHTLY,
- combine(combine(combine(datasets::LargeShapes(), framework::dataset::make("DataType", DataType::F32)), framework::dataset::make("Axis", { 0 })), framework::dataset::make("Epsilon", { 1e-12 })))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_f32);
-}
-TEST_SUITE_END()
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/NEON/MeanStdDev.cpp b/tests/validation_new/NEON/MeanStdDev.cpp
deleted file mode 100644
index 6214261afb..0000000000
--- a/tests/validation_new/NEON/MeanStdDev.cpp
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * 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/runtime/NEON/functions/NEMeanStdDev.h"
-#include "framework/Macros.h"
-#include "tests/NEON/Accessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/ShapeDatasets.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/MeanStdDevFixture.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace
-{
-constexpr RelativeTolerance tolerance_rel_high_error(0.05f);
-constexpr RelativeTolerance tolerance_rel_low_error(0.0005f);
-} // namespace
-
-TEST_SUITE(NEON)
-TEST_SUITE(MeanStdDev)
-
-DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(concat(datasets::Small2DShapes(), datasets::Large2DShapes()), framework::dataset::make("DataType", DataType::U8)), shape, data_type)
-{
- // Create tensors
- Tensor src = create_tensor<Tensor>(shape, data_type);
-
- // Create output variables
- float mean = 0.f;
- float std_dev = 0.f;
-
- ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Create configure function
- NEMeanStdDev mean_std_dev_image;
- mean_std_dev_image.configure(&src, &mean, &std_dev);
-
- // Validate padding
- const PaddingSize padding = PaddingCalculator(shape.x(), 16).required_padding();
- validate(src.info()->padding(), padding);
-}
-
-template <typename T>
-using NEMeanStdDevFixture = MeanStdDevValidationFixture<Tensor, Accessor, NEMeanStdDev, T>;
-
-FIXTURE_DATA_TEST_CASE(RunSmall, NEMeanStdDevFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), framework::dataset::make("DataType",
- DataType::U8)))
-{
- // Validate mean output
- validate(_target.first, _reference.first);
-
- // Validate std_dev output
- validate(_target.second, _reference.second, tolerance_rel_high_error);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NEMeanStdDevFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(), framework::dataset::make("DataType",
- DataType::U8)))
-{
- // Validate mean output
- validate(_target.first, _reference.first, tolerance_rel_low_error);
-
- // Validate std_dev output
- validate(_target.second, _reference.second, tolerance_rel_high_error);
-}
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/NEON/NormalizationLayer.cpp b/tests/validation_new/NEON/NormalizationLayer.cpp
deleted file mode 100644
index 1da2ed0874..0000000000
--- a/tests/validation_new/NEON/NormalizationLayer.cpp
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * 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/NENormalizationLayer.h"
-#include "arm_compute/runtime/Tensor.h"
-#include "arm_compute/runtime/TensorAllocator.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/NEON/Accessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/NormalizationTypesDataset.h"
-#include "tests/datasets_new/ShapeDatasets.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/NormalizationLayerFixture.h"
-#include "tests/validation_new/half.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace
-{
-/** Tolerance for float operations */
-#ifdef ARM_COMPUTE_ENABLE_FP16
-constexpr AbsoluteTolerance<float> tolerance_f16(0.001f);
-#endif /* ARM_COMPUTE_ENABLE_FP16 */
-constexpr AbsoluteTolerance<float> tolerance_f32(0.00001f);
-/** Tolerance for fixed point operations */
-constexpr AbsoluteTolerance<int8_t> tolerance_qs8(2);
-constexpr AbsoluteTolerance<int16_t> tolerance_qs16(3);
-
-/** Input data set. */
-const auto NormalizationDataset = combine(combine(combine(datasets::SmallShapes(), datasets::NormalizationTypes()), framework::dataset::make("NormalizationSize", 3, 9, 2)),
- framework::dataset::make("Beta", { 0.5f, 1.f, 2.f }));
-} // namespace
-
-TEST_SUITE(NEON)
-TEST_SUITE(NormalizationLayer)
-
-//TODO(COMPMID-415): Missing configuration?
-
-template <typename T>
-using NENormalizationLayerFixture = NormalizationValidationFixture<Tensor, Accessor, NENormalizationLayer, T>;
-
-TEST_SUITE(Float)
-#ifdef ARM_COMPUTE_ENABLE_FP16
-TEST_SUITE(FP16)
-FIXTURE_DATA_TEST_CASE(RunSmall, NENormalizationLayerFixture<half_float::half>, framework::DatasetMode::PRECOMMIT, combine(NormalizationDataset, framework::dataset::make("DataType", DataType::F16)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_f16);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NENormalizationLayerFixture<half_float::half>, framework::DatasetMode::NIGHTLY, combine(NormalizationDataset, framework::dataset::make("DataType", DataType::F16)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_f16);
-}
-TEST_SUITE_END()
-#endif /* ARM_COMPUTE_ENABLE_FP16 */
-
-TEST_SUITE(FP32)
-FIXTURE_DATA_TEST_CASE(RunSmall, NENormalizationLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(NormalizationDataset, framework::dataset::make("DataType", DataType::F32)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_f32);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NENormalizationLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(NormalizationDataset, framework::dataset::make("DataType", DataType::F32)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_f32);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-template <typename T>
-using NENormalizationLayerFixedPointFixture = NormalizationValidationFixedPointFixture<Tensor, Accessor, NENormalizationLayer, T>;
-
-TEST_SUITE(Quantized)
-TEST_SUITE(QS8)
-// Testing for fixed point position [1,6) as reciprocal limits the maximum fixed point position to 5
-FIXTURE_DATA_TEST_CASE(RunSmall, NENormalizationLayerFixedPointFixture<int8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(NormalizationDataset, framework::dataset::make("DataType",
- DataType::QS8)),
- framework::dataset::make("FractionalBits", 1, 6)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_qs8);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NENormalizationLayerFixedPointFixture<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(NormalizationDataset, framework::dataset::make("DataType",
- DataType::QS8)),
- framework::dataset::make("FractionalBits", 1, 6)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_qs8);
-}
-TEST_SUITE_END()
-
-TEST_SUITE(QS16)
-// Testing for fixed point position [1,14) as reciprocal limits the maximum fixed point position to 14
-FIXTURE_DATA_TEST_CASE(RunSmall, NENormalizationLayerFixedPointFixture<int16_t>, framework::DatasetMode::PRECOMMIT, combine(combine(NormalizationDataset, framework::dataset::make("DataType",
- DataType::QS16)),
- framework::dataset::make("FractionalBits", 1, 14)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_qs16);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NENormalizationLayerFixedPointFixture<int16_t>, framework::DatasetMode::NIGHTLY, combine(combine(NormalizationDataset, framework::dataset::make("DataType",
- DataType::QS16)),
- framework::dataset::make("FractionalBits", 1, 14)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_qs16);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/NEON/PoolingLayer.cpp b/tests/validation_new/NEON/PoolingLayer.cpp
deleted file mode 100644
index 20fce3d73a..0000000000
--- a/tests/validation_new/NEON/PoolingLayer.cpp
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * 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/NEPoolingLayer.h"
-#include "arm_compute/runtime/Tensor.h"
-#include "arm_compute/runtime/TensorAllocator.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/NEON/Accessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/PoolingTypesDataset.h"
-#include "tests/datasets_new/ShapeDatasets.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/PoolingLayerFixture.h"
-#include "tests/validation_new/half.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace
-{
-/** Input data set for float data types */
-const auto PoolingLayerDatasetFP = combine(combine(datasets::PoolingTypes(), framework::dataset::make("PoolingSize", { 2, 3, 7 })),
- framework::dataset::make("PadStride", { PadStrideInfo(1, 1, 0, 0), PadStrideInfo(2, 1, 0, 0), PadStrideInfo(1, 2, 1, 1), PadStrideInfo(2, 2, 1, 0) }));
-
-/** Input data set for quantized data types */
-const auto PoolingLayerDatasetQS = combine(combine(datasets::PoolingTypes(), framework::dataset::make("PoolingSize", { 2, 3 })),
- framework::dataset::make("PadStride", { PadStrideInfo(1, 1, 0, 0), PadStrideInfo(2, 1, 0, 0), PadStrideInfo(1, 2, 1, 1), PadStrideInfo(2, 2, 1, 0) }));
-
-constexpr AbsoluteTolerance<float> tolerance_f32(0.001f); /**< Tolerance value for comparing reference's output against implementation's output for float types */
-#ifdef ARM_COMPUTE_ENABLE_FP16
-constexpr AbsoluteTolerance<float> tolerance_f16(0.01f); /**< Tolerance value for comparing reference's output against implementation's output for float types */
-#endif /* ARM_COMPUTE_ENABLE_FP16 */
-constexpr AbsoluteTolerance<float> tolerance_qs8(0); /**< Tolerance value for comparing reference's output against implementation's output for quantized input */
-constexpr AbsoluteTolerance<float> tolerance_qs16(0); /**< Tolerance value for comparing reference's output against implementation's output for quantized input */
-} // namespace
-
-TEST_SUITE(NEON)
-TEST_SUITE(PoolingLayer)
-
-//TODO(COMPMID-415): Configuration tests?
-
-template <typename T>
-using NEPoolingLayerFixture = PoolingLayerValidationFixture<Tensor, Accessor, NEPoolingLayer, T>;
-
-TEST_SUITE(Float)
-TEST_SUITE(FP32)
-FIXTURE_DATA_TEST_CASE(RunSmall, NEPoolingLayerFixture<float>, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), combine(PoolingLayerDatasetFP, framework::dataset::make("DataType",
- DataType::F32))))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_f32);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NEPoolingLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(datasets::LargeShapes(), combine(PoolingLayerDatasetFP, framework::dataset::make("DataType",
- DataType::F32))))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_f32);
-}
-TEST_SUITE_END()
-
-#ifdef ARM_COMPUTE_ENABLE_FP16
-TEST_SUITE(FP16)
-FIXTURE_DATA_TEST_CASE(RunSmall, NEPoolingLayerFixture<half_float::half>, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), combine(PoolingLayerDatasetFP,
- framework::dataset::make("DataType", DataType::F16))))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_f16);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NEPoolingLayerFixture<half_float::half>, framework::DatasetMode::NIGHTLY, combine(datasets::LargeShapes(), combine(PoolingLayerDatasetFP,
- framework::dataset::make("DataType", DataType::F16))))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_f16);
-}
-TEST_SUITE_END()
-#endif /* ARM_COMPUTE_ENABLE_FP16 */
-TEST_SUITE_END()
-
-template <typename T>
-using NEPoolingLayerFixedPointFixture = PoolingLayerValidationFixedPointFixture<Tensor, Accessor, NEPoolingLayer, T>;
-
-TEST_SUITE(Quantized)
-TEST_SUITE(QS8)
-FIXTURE_DATA_TEST_CASE(RunSmall, NEPoolingLayerFixedPointFixture<int8_t>, framework::DatasetMode::ALL, combine(combine(datasets::SmallShapes(), combine(PoolingLayerDatasetQS,
- framework::dataset::make("DataType", DataType::QS8))),
- framework::dataset::make("FractionalBits", 1, 5)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_qs8);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NEPoolingLayerFixedPointFixture<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(datasets::LargeShapes(), combine(PoolingLayerDatasetQS,
- framework::dataset::make("DataType", DataType::QS8))),
- framework::dataset::make("FractionalBits", 1, 5)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_qs8);
-}
-TEST_SUITE_END()
-
-TEST_SUITE(QS16)
-FIXTURE_DATA_TEST_CASE(RunSmall, NEPoolingLayerFixedPointFixture<int16_t>, framework::DatasetMode::ALL, combine(combine(datasets::SmallShapes(), combine(PoolingLayerDatasetQS,
- framework::dataset::make("DataType", DataType::QS16))),
- framework::dataset::make("FractionalBits", 1, 13)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_qs16);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NEPoolingLayerFixedPointFixture<int16_t>, framework::DatasetMode::NIGHTLY, combine(combine(datasets::LargeShapes(), combine(PoolingLayerDatasetQS,
- framework::dataset::make("DataType", DataType::QS16))),
- framework::dataset::make("FractionalBits", 1, 13)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_qs16);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/NEON/QuantizationLayer.cpp b/tests/validation_new/NEON/QuantizationLayer.cpp
deleted file mode 100644
index 8b2acd6331..0000000000
--- a/tests/validation_new/NEON/QuantizationLayer.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * 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/NEQuantizationLayer.h"
-#include "arm_compute/runtime/Tensor.h"
-#include "arm_compute/runtime/TensorAllocator.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/NEON/Accessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/ShapeDatasets.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/QuantizationLayerFixture.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace
-{
-/** Tolerance for quantization */
-constexpr AbsoluteTolerance<uint8_t> tolerance_u8(1);
-} // namespace
-
-TEST_SUITE(NEON)
-TEST_SUITE(QuantizationLayer)
-
-DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(concat(datasets::Small2DShapes(), datasets::Large2DShapes()), framework::dataset::make("DataType", DataType::F32)), shape, data_type)
-{
- // Create tensors
- Tensor src = create_tensor<Tensor>(shape, data_type);
- Tensor dst = create_tensor<Tensor>(shape, DataType::U8);
-
- ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Create and configure function
- NEQuantizationLayer quant_layer;
- quant_layer.configure(&src, &dst);
-
- // Validate valid region
- const ValidRegion valid_region = shape_to_valid_region(shape);
- validate(src.info()->valid_region(), valid_region);
- validate(dst.info()->valid_region(), valid_region);
-
- // Validate padding
- const PaddingSize padding = PaddingCalculator(shape.x(), 8).required_padding();
- validate(src.info()->padding(), padding);
- validate(dst.info()->padding(), padding);
-}
-
-template <typename T>
-using NEQuantizationLayerFixture = QuantizationValidationFixture<Tensor, Accessor, NEQuantizationLayer, T>;
-
-TEST_SUITE(Float)
-TEST_SUITE(FP32)
-FIXTURE_DATA_TEST_CASE(RunSmall, NEQuantizationLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), framework::dataset::make("DataType", DataType::F32)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_u8);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NEQuantizationLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(datasets::Large2DShapes(), framework::dataset::make("DataType", DataType::F32)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_u8);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/NEON/ReductionOperation.cpp b/tests/validation_new/NEON/ReductionOperation.cpp
deleted file mode 100644
index 4048af09e7..0000000000
--- a/tests/validation_new/NEON/ReductionOperation.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * 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/NEReductionOperation.h"
-#include "arm_compute/runtime/Tensor.h"
-#include "arm_compute/runtime/TensorAllocator.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/NEON/Accessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/ReductionOperationDataset.h"
-#include "tests/datasets_new/ShapeDatasets.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/ReductionOperationFixture.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace
-{
-/** Tolerance for float operations */
-constexpr RelativeTolerance tolerance_f32(0.00001f);
-} // namespace
-
-TEST_SUITE(NEON)
-TEST_SUITE(ReductionOperation)
-
-template <typename T>
-using NEReductionOperationFixture = ReductionOperationValidationFixture<Tensor, Accessor, NEReductionOperation, T>;
-
-TEST_SUITE(FP32)
-FIXTURE_DATA_TEST_CASE(RunSmall, NEReductionOperationFixture<float>, framework::DatasetMode::PRECOMMIT,
- combine(combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F32)), framework::dataset::make("Axis", { 0 })), datasets::ReductionOperations()))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_f32);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NEReductionOperationFixture<float>, framework::DatasetMode::NIGHTLY,
- combine(combine(combine(datasets::LargeShapes(), framework::dataset::make("DataType", DataType::F32)), framework::dataset::make("Axis", { 0 })), datasets::ReductionOperations()))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_f32);
-}
-TEST_SUITE_END()
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/NEON/Scale.cpp b/tests/validation_new/NEON/Scale.cpp
deleted file mode 100644
index 1036f98c23..0000000000
--- a/tests/validation_new/NEON/Scale.cpp
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * 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/Helpers.h"
-#include "arm_compute/core/Types.h"
-#include "arm_compute/runtime/NEON/functions/NEScale.h"
-#include "arm_compute/runtime/Tensor.h"
-#include "arm_compute/runtime/TensorAllocator.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/NEON/Accessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/BorderModeDataset.h"
-#include "tests/datasets_new/InterpolationPolicyDataset.h"
-#include "tests/datasets_new/ShapeDatasets.h"
-#include "tests/validation_new/Helpers.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/ScaleFixture.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-TEST_SUITE(NEON)
-TEST_SUITE(Scale)
-
-DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), framework::dataset::make("DataType", DataType::U8)),
- framework::dataset::make("InterpolationPolicy", { InterpolationPolicy::NEAREST_NEIGHBOR, InterpolationPolicy::BILINEAR })),
- datasets::BorderModes()),
- shape, data_type, policy, border_mode)
-{
- std::mt19937 generator(library->seed());
- std::uniform_real_distribution<float> distribution_float(0.25, 2);
- const float scale_x = distribution_float(generator);
- const float scale_y = distribution_float(generator);
- uint8_t constant_border_value = 0;
- if(border_mode == BorderMode::CONSTANT)
- {
- std::uniform_int_distribution<uint8_t> distribution_u8(0, 255);
- constant_border_value = distribution_u8(generator);
- }
-
- // Create tensors
- Tensor src = create_tensor<Tensor>(shape, data_type);
- TensorShape shape_scaled(shape);
- shape_scaled.set(0, shape[0] * scale_x);
- shape_scaled.set(1, shape[1] * scale_y);
- Tensor dst = create_tensor<Tensor>(shape_scaled, data_type);
-
- ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Create and configure function
- NEScale nescale;
- nescale.configure(&src, &dst, policy, border_mode, constant_border_value);
-
- // Validate valid region
- const ValidRegion dst_valid_region = calculate_valid_region_scale(*(src.info()), shape_scaled, policy, BorderSize(1), (border_mode == BorderMode::UNDEFINED));
-
- validate(dst.info()->valid_region(), dst_valid_region);
-
- // Validate padding
- PaddingCalculator calculator(shape_scaled.x(), 16);
- calculator.set_border_mode(border_mode);
-
- const PaddingSize read_padding(1);
- const PaddingSize write_padding = calculator.required_padding(PaddingCalculator::Option::EXCLUDE_BORDER);
- validate(src.info()->padding(), read_padding);
- validate(dst.info()->padding(), write_padding);
-}
-
-template <typename T>
-using NEScaleFixture = ScaleValidationFixture<Tensor, Accessor, NEScale, T>;
-
-FIXTURE_DATA_TEST_CASE(RunSmall, NEScaleFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType",
- DataType::U8)),
- framework::dataset::make("InterpolationPolicy", { InterpolationPolicy::NEAREST_NEIGHBOR, InterpolationPolicy::BILINEAR })),
- datasets::BorderModes()))
-{
- //Create valid region
- TensorInfo src_info(_shape, 1, _data_type);
- ValidRegion valid_region = calculate_valid_region_scale(src_info, _reference.shape(), _policy, BorderSize(1), (_border_mode == BorderMode::UNDEFINED));
-
- // Validate output
- validate(Accessor(_target), _reference, valid_region);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NEScaleFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeShapes(), framework::dataset::make("DataType",
- DataType::U8)),
- framework::dataset::make("InterpolationPolicy", { InterpolationPolicy::NEAREST_NEIGHBOR, InterpolationPolicy::BILINEAR })),
- datasets::BorderModes()))
-{
- //Create valid region
- TensorInfo src_info(_shape, 1, _data_type);
- ValidRegion valid_region = calculate_valid_region_scale(src_info, _reference.shape(), _policy, BorderSize(1), (_border_mode == BorderMode::UNDEFINED));
-
- // Validate output
- validate(Accessor(_target), _reference, valid_region);
-}
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/NEON/SoftmaxLayer.cpp b/tests/validation_new/NEON/SoftmaxLayer.cpp
deleted file mode 100644
index 337ee29986..0000000000
--- a/tests/validation_new/NEON/SoftmaxLayer.cpp
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * 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/NESoftmaxLayer.h"
-#include "arm_compute/runtime/Tensor.h"
-#include "arm_compute/runtime/TensorAllocator.h"
-#include "framework/Asserts.h"
-#include "framework/Macros.h"
-#include "framework/datasets/Datasets.h"
-#include "tests/NEON/Accessor.h"
-#include "tests/PaddingCalculator.h"
-#include "tests/datasets_new/ShapeDatasets.h"
-#include "tests/validation_new/Validation.h"
-#include "tests/validation_new/fixtures/SoftmaxLayerFixture.h"
-#include "tests/validation_new/half.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace
-{
-/** Tolerance for float operations */
-constexpr AbsoluteTolerance<float> tolerance_f32(0.000001f);
-#ifdef ARM_COMPUTE_ENABLE_FP16
-constexpr AbsoluteTolerance<float> tolerance_f16(0.0001f);
-#endif /* ARM_COMPUTE_ENABLE_FP16*/
-/** Tolerance for fixed point operations */
-constexpr AbsoluteTolerance<int8_t> tolerance_fixed_point(2);
-
-/** CNN data types */
-const auto CNNDataTypes = framework::dataset::make("DataType",
-{
-#ifdef ARM_COMPUTE_ENABLE_FP16
- DataType::F16,
-#endif /* ARM_COMPUTE_ENABLE_FP16 */
- DataType::F32,
- DataType::QS8,
- DataType::QS16,
-});
-} // namespace
-
-TEST_SUITE(NEON)
-TEST_SUITE(SoftmaxLayer)
-
-DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), CNNDataTypes), shape, data_type)
-{
- // Set fixed point position data type allowed
- const int fixed_point_position = is_data_type_fixed_point(data_type) ? 3 : 0;
-
- // Create tensors
- Tensor src = create_tensor<Tensor>(shape, data_type, 1, fixed_point_position);
- Tensor dst = create_tensor<Tensor>(shape, data_type, 1, fixed_point_position);
-
- ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Create and configure function
- NESoftmaxLayer smx_layer;
- smx_layer.configure(&src, &dst);
-
- // Validate valid region
- const ValidRegion valid_region = shape_to_valid_region(shape);
- validate(src.info()->valid_region(), valid_region);
- validate(dst.info()->valid_region(), valid_region);
-
- // Validate padding
- const int step = 16 / data_size_from_type(data_type);
- const PaddingSize padding = PaddingCalculator(shape.x(), step).required_padding();
- validate(src.info()->padding(), padding);
- validate(dst.info()->padding(), padding);
-}
-
-template <typename T>
-using NESoftmaxLayerFixture = SoftmaxValidationFixture<Tensor, Accessor, NESoftmaxLayer, T>;
-
-TEST_SUITE(Float)
-#ifdef ARM_COMPUTE_ENABLE_FP16
-TEST_SUITE(FP16)
-FIXTURE_DATA_TEST_CASE(RunSmall, NESoftmaxLayerFixture<half_float::half>, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F16)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_f16);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NESoftmaxLayerFixture<half_float::half>, framework::DatasetMode::NIGHTLY, combine(datasets::LargeShapes(), framework::dataset::make("DataType", DataType::F16)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_f16);
-}
-TEST_SUITE_END()
-#endif /* ARM_COMPUTE_ENABLE_FP16 */
-
-TEST_SUITE(FP32)
-FIXTURE_DATA_TEST_CASE(RunSmall, NESoftmaxLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F32)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_f32);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NESoftmaxLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(datasets::LargeShapes(), framework::dataset::make("DataType", DataType::F32)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_f32);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-template <typename T>
-using NESoftmaxLayerFixedPointFixture = SoftmaxValidationFixedPointFixture<Tensor, Accessor, NESoftmaxLayer, T>;
-
-TEST_SUITE(Quantized)
-TEST_SUITE(QS8)
-// Testing for fixed point position [1,6) as reciprocal limits the maximum fixed point position to 5
-FIXTURE_DATA_TEST_CASE(RunSmall, NESoftmaxLayerFixedPointFixture<int8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType",
- DataType::QS8)),
- framework::dataset::make("FractionalBits", 1, 6)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_fixed_point);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NESoftmaxLayerFixedPointFixture<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(datasets::LargeShapes(), framework::dataset::make("DataType",
- DataType::QS8)),
- framework::dataset::make("FractionalBits", 1, 6)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_fixed_point);
-}
-TEST_SUITE_END()
-
-TEST_SUITE(QS16)
-// Testing for fixed point position [1,14) as reciprocal limits the maximum fixed point position to 14
-FIXTURE_DATA_TEST_CASE(RunSmall, NESoftmaxLayerFixedPointFixture<int16_t>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType",
- DataType::QS16)),
- framework::dataset::make("FractionalBits", 1, 14)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_fixed_point);
-}
-FIXTURE_DATA_TEST_CASE(RunLarge, NESoftmaxLayerFixedPointFixture<int16_t>, framework::DatasetMode::NIGHTLY, combine(combine(datasets::LargeShapes(), framework::dataset::make("DataType",
- DataType::QS16)),
- framework::dataset::make("FractionalBits", 1, 14)))
-{
- // Validate output
- validate(Accessor(_target), _reference, tolerance_fixed_point);
-}
-TEST_SUITE_END()
-TEST_SUITE_END()
-
-TEST_SUITE_END()
-TEST_SUITE_END()
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/Validation.cpp b/tests/validation_new/Validation.cpp
deleted file mode 100644
index fec7c10939..0000000000
--- a/tests/validation_new/Validation.cpp
+++ /dev/null
@@ -1,307 +0,0 @@
-/*
- * 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 "Validation.h"
-
-#include "arm_compute/core/Coordinates.h"
-#include "arm_compute/core/Error.h"
-#include "arm_compute/core/TensorShape.h"
-#include "arm_compute/runtime/Tensor.h"
-#include "tests/validation/half.h"
-
-#include <array>
-#include <cmath>
-#include <cstddef>
-#include <cstdint>
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace
-{
-/** Get the data from *ptr after casting according to @p data_type and then convert the data to double.
- *
- * @param[in] ptr Pointer to value.
- * @param[in] data_type Data type of both values.
- *
- * @return The data from the ptr after converted to double.
- */
-double get_double_data(const void *ptr, DataType data_type)
-{
- if(ptr == nullptr)
- {
- ARM_COMPUTE_ERROR("Can't dereference a null pointer!");
- }
-
- switch(data_type)
- {
- case DataType::U8:
- return *reinterpret_cast<const uint8_t *>(ptr);
- case DataType::S8:
- return *reinterpret_cast<const int8_t *>(ptr);
- case DataType::QS8:
- return *reinterpret_cast<const qint8_t *>(ptr);
- case DataType::U16:
- return *reinterpret_cast<const uint16_t *>(ptr);
- case DataType::S16:
- return *reinterpret_cast<const int16_t *>(ptr);
- case DataType::QS16:
- return *reinterpret_cast<const qint16_t *>(ptr);
- case DataType::U32:
- return *reinterpret_cast<const uint32_t *>(ptr);
- case DataType::S32:
- return *reinterpret_cast<const int32_t *>(ptr);
- case DataType::U64:
- return *reinterpret_cast<const uint64_t *>(ptr);
- case DataType::S64:
- return *reinterpret_cast<const int64_t *>(ptr);
- case DataType::F16:
- return *reinterpret_cast<const half_float::half *>(ptr);
- case DataType::F32:
- return *reinterpret_cast<const float *>(ptr);
- case DataType::F64:
- return *reinterpret_cast<const double *>(ptr);
- case DataType::SIZET:
- return *reinterpret_cast<const size_t *>(ptr);
- default:
- ARM_COMPUTE_ERROR("NOT SUPPORTED!");
- }
-}
-
-void check_border_element(const IAccessor &tensor, const Coordinates &id,
- const BorderMode &border_mode, const void *border_value,
- int64_t &num_elements, int64_t &num_mismatches)
-{
- const size_t channel_size = element_size_from_data_type(tensor.data_type());
- const auto ptr = static_cast<const uint8_t *>(tensor(id));
-
- if(border_mode == BorderMode::REPLICATE)
- {
- Coordinates border_id{ id };
-
- if(id.x() < 0)
- {
- border_id.set(0, 0);
- }
- else if(static_cast<size_t>(id.x()) >= tensor.shape().x())
- {
- border_id.set(0, tensor.shape().x() - 1);
- }
-
- if(id.y() < 0)
- {
- border_id.set(1, 0);
- }
- else if(static_cast<size_t>(id.y()) >= tensor.shape().y())
- {
- border_id.set(1, tensor.shape().y() - 1);
- }
-
- border_value = tensor(border_id);
- }
-
- // Iterate over all channels within one element
- for(int channel = 0; channel < tensor.num_channels(); ++channel)
- {
- const size_t channel_offset = channel * channel_size;
- const double target = get_double_data(ptr + channel_offset, tensor.data_type());
- const double reference = get_double_data(static_cast<const uint8_t *>(border_value) + channel_offset, tensor.data_type());
-
- if(!compare<AbsoluteTolerance<double>, double>(target, reference))
- {
- ARM_COMPUTE_TEST_INFO("id = " << id);
- ARM_COMPUTE_TEST_INFO("channel = " << channel);
- ARM_COMPUTE_TEST_INFO("target = " << std::setprecision(5) << target);
- ARM_COMPUTE_TEST_INFO("reference = " << std::setprecision(5) << reference);
- ARM_COMPUTE_EXPECT_EQUAL(target, reference, framework::LogLevel::DEBUG);
-
- ++num_mismatches;
- }
-
- ++num_elements;
- }
-}
-} // namespace
-
-void validate(const arm_compute::ValidRegion &region, const arm_compute::ValidRegion &reference)
-{
- ARM_COMPUTE_EXPECT_EQUAL(region.anchor.num_dimensions(), reference.anchor.num_dimensions(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT_EQUAL(region.shape.num_dimensions(), reference.shape.num_dimensions(), framework::LogLevel::ERRORS);
-
- for(unsigned int d = 0; d < region.anchor.num_dimensions(); ++d)
- {
- ARM_COMPUTE_EXPECT_EQUAL(region.anchor[d], reference.anchor[d], framework::LogLevel::ERRORS);
- }
-
- for(unsigned int d = 0; d < region.shape.num_dimensions(); ++d)
- {
- ARM_COMPUTE_EXPECT_EQUAL(region.shape[d], reference.shape[d], framework::LogLevel::ERRORS);
- }
-}
-
-void validate(const arm_compute::PaddingSize &padding, const arm_compute::PaddingSize &reference)
-{
- ARM_COMPUTE_EXPECT_EQUAL(padding.top, reference.top, framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT_EQUAL(padding.right, reference.right, framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT_EQUAL(padding.bottom, reference.bottom, framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT_EQUAL(padding.left, reference.left, framework::LogLevel::ERRORS);
-}
-
-void validate(const IAccessor &tensor, const void *reference_value)
-{
- ARM_COMPUTE_ASSERT(reference_value != nullptr);
-
- int64_t num_mismatches = 0;
- int64_t num_elements = 0;
- const size_t channel_size = element_size_from_data_type(tensor.data_type());
-
- // Iterate over all elements, e.g. U8, S16, RGB888, ...
- for(int element_idx = 0; element_idx < tensor.num_elements(); ++element_idx)
- {
- const Coordinates id = index2coord(tensor.shape(), element_idx);
-
- const auto ptr = static_cast<const uint8_t *>(tensor(id));
-
- // Iterate over all channels within one element
- for(int channel = 0; channel < tensor.num_channels(); ++channel)
- {
- const size_t channel_offset = channel * channel_size;
- const double target = get_double_data(ptr + channel_offset, tensor.data_type());
- const double reference = get_double_data(reference_value, tensor.data_type());
-
- if(!compare<AbsoluteTolerance<double>, double>(target, reference))
- {
- ARM_COMPUTE_TEST_INFO("id = " << id);
- ARM_COMPUTE_TEST_INFO("channel = " << channel);
- ARM_COMPUTE_TEST_INFO("target = " << std::setprecision(5) << target);
- ARM_COMPUTE_TEST_INFO("reference = " << std::setprecision(5) << reference);
- ARM_COMPUTE_EXPECT_EQUAL(target, reference, framework::LogLevel::DEBUG);
-
- ++num_mismatches;
- }
-
- ++num_elements;
- }
- }
-
- if(num_elements > 0)
- {
- const float percent_mismatches = static_cast<float>(num_mismatches) / num_elements * 100.f;
-
- ARM_COMPUTE_TEST_INFO(num_mismatches << " values (" << std::fixed << std::setprecision(2) << percent_mismatches << "%) mismatched");
- ARM_COMPUTE_EXPECT_EQUAL(num_mismatches, 0, framework::LogLevel::ERRORS);
- }
-}
-
-void validate(const IAccessor &tensor, BorderSize border_size, const BorderMode &border_mode, const void *border_value)
-{
- if(border_mode == BorderMode::UNDEFINED)
- {
- return;
- }
- else if(border_mode == BorderMode::CONSTANT)
- {
- ARM_COMPUTE_ASSERT(border_value != nullptr);
- }
-
- int64_t num_mismatches = 0;
- int64_t num_elements = 0;
- const int slice_size = tensor.shape()[0] * tensor.shape()[1];
-
- for(int element_idx = 0; element_idx < tensor.num_elements(); element_idx += slice_size)
- {
- Coordinates id = index2coord(tensor.shape(), element_idx);
-
- // Top border
- for(int y = -border_size.top; y < 0; ++y)
- {
- id.set(1, y);
-
- for(int x = -border_size.left; x < static_cast<int>(tensor.shape()[0]) + static_cast<int>(border_size.right); ++x)
- {
- id.set(0, x);
-
- check_border_element(tensor, id, border_mode, border_value, num_elements, num_mismatches);
- }
- }
-
- // Bottom border
- for(int y = tensor.shape()[1]; y < static_cast<int>(tensor.shape()[1]) + static_cast<int>(border_size.bottom); ++y)
- {
- id.set(1, y);
-
- for(int x = -border_size.left; x < static_cast<int>(tensor.shape()[0]) + static_cast<int>(border_size.right); ++x)
- {
- id.set(0, x);
-
- check_border_element(tensor, id, border_mode, border_value, num_elements, num_mismatches);
- }
- }
-
- // Left/right border
- for(int y = 0; y < static_cast<int>(tensor.shape()[1]); ++y)
- {
- id.set(1, y);
-
- // Left border
- for(int x = -border_size.left; x < 0; ++x)
- {
- id.set(0, x);
-
- check_border_element(tensor, id, border_mode, border_value, num_elements, num_mismatches);
- }
-
- // Right border
- for(int x = tensor.shape()[0]; x < static_cast<int>(tensor.shape()[0]) + static_cast<int>(border_size.right); ++x)
- {
- id.set(0, x);
-
- check_border_element(tensor, id, border_mode, border_value, num_elements, num_mismatches);
- }
- }
- }
-
- if(num_elements > 0)
- {
- const float percent_mismatches = static_cast<float>(num_mismatches) / num_elements * 100.f;
-
- ARM_COMPUTE_TEST_INFO(num_mismatches << " values (" << std::fixed << std::setprecision(2) << percent_mismatches << "%) mismatched");
- ARM_COMPUTE_EXPECT_EQUAL(num_mismatches, 0, framework::LogLevel::ERRORS);
- }
-}
-
-void validate(std::vector<unsigned int> classified_labels, std::vector<unsigned int> expected_labels)
-{
- ARM_COMPUTE_EXPECT_EQUAL(classified_labels.size(), expected_labels.size(), framework::LogLevel::ERRORS);
-
- for(unsigned int i = 0; i < expected_labels.size(); ++i)
- {
- ARM_COMPUTE_EXPECT_EQUAL(classified_labels[i], expected_labels[i], framework::LogLevel::ERRORS);
- }
-}
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/Validation.h b/tests/validation_new/Validation.h
deleted file mode 100644
index d3c3541982..0000000000
--- a/tests/validation_new/Validation.h
+++ /dev/null
@@ -1,351 +0,0 @@
-/*
- * 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_VALIDATION_H__
-#define __ARM_COMPUTE_TEST_VALIDATION_H__
-
-#include "SimpleTensor.h"
-#include "arm_compute/core/FixedPoint.h"
-#include "arm_compute/core/Types.h"
-#include "framework/Asserts.h"
-#include "framework/Exceptions.h"
-#include "tests/IAccessor.h"
-#include "tests/TypePrinter.h"
-#include "tests/Utils.h"
-
-#include <iomanip>
-#include <ios>
-#include <vector>
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-/** Class reprensenting an absolute tolerance value. */
-template <typename T>
-class AbsoluteTolerance
-{
-public:
- /** Underlying type. */
- using value_type = T;
-
- /* Default constructor.
- *
- * Initialises the tolerance to 0.
- */
- AbsoluteTolerance() = default;
-
- /** Constructor.
- *
- * @param[in] value Absolute tolerance value.
- */
- explicit constexpr AbsoluteTolerance(T value)
- : _value{ value }
- {
- }
-
- /** Implicit conversion to the underlying type. */
- constexpr operator T() const
- {
- return _value;
- }
-
-private:
- T _value{ std::numeric_limits<T>::epsilon() };
-};
-
-/** Class reprensenting a relative tolerance value. */
-class RelativeTolerance
-{
-public:
- /** Underlying type. */
- using value_type = double;
-
- /* Default constructor.
- *
- * Initialises the tolerance to 0.
- */
- RelativeTolerance() = default;
-
- /** Constructor.
- *
- * @param[in] value Relative tolerance value.
- */
- explicit constexpr RelativeTolerance(value_type value)
- : _value{ value }
- {
- }
-
- /** Implicit conversion to the underlying type. */
- constexpr operator value_type() const
- {
- return _value;
- }
-
-private:
- value_type _value{ 0 };
-};
-
-/** Print AbsoluteTolerance type. */
-template <typename T>
-inline ::std::ostream &operator<<(::std::ostream &os, const AbsoluteTolerance<T> &tolerance)
-{
- os << static_cast<typename AbsoluteTolerance<T>::value_type>(tolerance);
-
- return os;
-}
-
-/** Print RelativeTolerance type. */
-inline ::std::ostream &operator<<(::std::ostream &os, const RelativeTolerance &tolerance)
-{
- os << static_cast<typename RelativeTolerance::value_type>(tolerance);
-
- return os;
-}
-
-template <typename T>
-bool compare_dimensions(const Dimensions<T> &dimensions1, const Dimensions<T> &dimensions2)
-{
- if(dimensions1.num_dimensions() != dimensions2.num_dimensions())
- {
- return false;
- }
-
- for(unsigned int i = 0; i < dimensions1.num_dimensions(); ++i)
- {
- if(dimensions1[i] != dimensions2[i])
- {
- return false;
- }
- }
-
- return true;
-}
-
-/** Validate valid regions.
- *
- * - Dimensionality has to be the same.
- * - Anchors have to match.
- * - Shapes have to match.
- */
-void validate(const arm_compute::ValidRegion &region, const arm_compute::ValidRegion &reference);
-
-/** Validate padding.
- *
- * Padding on all sides has to be the same.
- */
-void validate(const arm_compute::PaddingSize &padding, const arm_compute::PaddingSize &reference);
-
-/** Validate tensors.
- *
- * - Dimensionality has to be the same.
- * - All values have to match.
- *
- * @note: wrap_range allows cases where reference tensor rounds up to the wrapping point, causing it to wrap around to
- * zero while the test tensor stays at wrapping point to pass. This may permit true erroneous cases (difference between
- * reference tensor and test tensor is multiple of wrap_range), but such errors would be detected by
- * other test cases.
- */
-template <typename T, typename U = AbsoluteTolerance<T>>
-void validate(const IAccessor &tensor, const SimpleTensor<T> &reference, U tolerance_value = U(), float tolerance_number = 0.f);
-
-/** Validate tensors with valid region.
- *
- * - Dimensionality has to be the same.
- * - All values have to match.
- *
- * @note: wrap_range allows cases where reference tensor rounds up to the wrapping point, causing it to wrap around to
- * zero while the test tensor stays at wrapping point to pass. This may permit true erroneous cases (difference between
- * reference tensor and test tensor is multiple of wrap_range), but such errors would be detected by
- * other test cases.
- */
-template <typename T, typename U = AbsoluteTolerance<T>>
-void validate(const IAccessor &tensor, const SimpleTensor<T> &reference, const ValidRegion &valid_region, U tolerance_value = U(), float tolerance_number = 0.f);
-
-/** Validate tensors against constant value.
- *
- * - All values have to match.
- */
-void validate(const IAccessor &tensor, const void *reference_value);
-
-/** Validate border against a constant value.
- *
- * - All border values have to match the specified value if mode is CONSTANT.
- * - All border values have to be replicated if mode is REPLICATE.
- * - Nothing is validated for mode UNDEFINED.
- */
-void validate(const IAccessor &tensor, BorderSize border_size, const BorderMode &border_mode, const void *border_value);
-
-/** Validate classified labels against expected ones.
- *
- * - All values should match
- */
-void validate(std::vector<unsigned int> classified_labels, std::vector<unsigned int> expected_labels);
-
-/** Validate float value.
- *
- * - All values should match
- */
-template <typename T, typename U>
-void validate(T target, T reference, U tolerance = AbsoluteTolerance<T>());
-
-template <typename T>
-struct compare_base
-{
- compare_base(typename T::value_type target, typename T::value_type reference, T tolerance = T(0))
- : _target{ target }, _reference{ reference }, _tolerance{ tolerance }
- {
- }
-
- typename T::value_type _target{};
- typename T::value_type _reference{};
- T _tolerance{};
-};
-
-template <typename T, typename U>
-struct compare;
-
-template <typename U>
-struct compare<AbsoluteTolerance<U>, U> : public compare_base<AbsoluteTolerance<U>>
-{
- using compare_base<AbsoluteTolerance<U>>::compare_base;
-
- operator bool() const
- {
- if(!std::isfinite(this->_target) || !std::isfinite(this->_reference))
- {
- return false;
- }
- else if(this->_target == this->_reference)
- {
- return true;
- }
-
- return static_cast<U>(std::abs(this->_target - this->_reference)) <= static_cast<U>(this->_tolerance);
- }
-};
-
-template <typename U>
-struct compare<RelativeTolerance, U> : public compare_base<RelativeTolerance>
-{
- using compare_base<RelativeTolerance>::compare_base;
-
- operator bool() const
- {
- if(!std::isfinite(_target) || !std::isfinite(_reference))
- {
- return false;
- }
- else if(_target == _reference)
- {
- return true;
- }
-
- const double relative_change = std::abs(static_cast<double>(_target - _reference)) / _reference;
-
- return relative_change <= _tolerance;
- }
-};
-
-template <typename T, typename U>
-void validate(const IAccessor &tensor, const SimpleTensor<T> &reference, U tolerance_value, float tolerance_number)
-{
- // Validate with valid region covering the entire shape
- validate(tensor, reference, shape_to_valid_region(tensor.shape()), tolerance_value, tolerance_number);
-}
-
-template <typename T, typename U>
-void validate(const IAccessor &tensor, const SimpleTensor<T> &reference, const ValidRegion &valid_region, U tolerance_value, float tolerance_number)
-{
- int64_t num_mismatches = 0;
- int64_t num_elements = 0;
-
- ARM_COMPUTE_EXPECT_EQUAL(tensor.element_size(), reference.element_size(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT_EQUAL(tensor.data_type(), reference.data_type(), framework::LogLevel::ERRORS);
-
- if(reference.format() != Format::UNKNOWN)
- {
- ARM_COMPUTE_EXPECT_EQUAL(tensor.format(), reference.format(), framework::LogLevel::ERRORS);
- }
-
- ARM_COMPUTE_EXPECT_EQUAL(tensor.num_channels(), reference.num_channels(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(compare_dimensions(tensor.shape(), reference.shape()), framework::LogLevel::ERRORS);
-
- const int min_elements = std::min(tensor.num_elements(), reference.num_elements());
- const int min_channels = std::min(tensor.num_channels(), reference.num_channels());
-
- // Iterate over all elements within valid region, e.g. U8, S16, RGB888, ...
- for(int element_idx = 0; element_idx < min_elements; ++element_idx)
- {
- const Coordinates id = index2coord(reference.shape(), element_idx);
-
- if(is_in_valid_region(valid_region, id))
- {
- // Iterate over all channels within one element
- for(int c = 0; c < min_channels; ++c)
- {
- const T &target_value = reinterpret_cast<const T *>(tensor(id))[c];
- const T &reference_value = reinterpret_cast<const T *>(reference(id))[c];
-
- if(!compare<U, typename U::value_type>(target_value, reference_value, tolerance_value))
- {
- ARM_COMPUTE_TEST_INFO("id = " << id);
- ARM_COMPUTE_TEST_INFO("channel = " << c);
- ARM_COMPUTE_TEST_INFO("target = " << std::setprecision(5) << framework::make_printable(target_value));
- ARM_COMPUTE_TEST_INFO("reference = " << std::setprecision(5) << framework::make_printable(reference_value));
- ARM_COMPUTE_TEST_INFO("tolerance = " << std::setprecision(5) << framework::make_printable(static_cast<typename U::value_type>(tolerance_value)));
- ARM_COMPUTE_EXPECT_EQUAL(target_value, reference_value, framework::LogLevel::DEBUG);
-
- ++num_mismatches;
- }
-
- ++num_elements;
- }
- }
- }
-
- if(num_elements > 0)
- {
- const int64_t absolute_tolerance_number = tolerance_number * num_elements;
- const float percent_mismatches = static_cast<float>(num_mismatches) / num_elements * 100.f;
-
- ARM_COMPUTE_TEST_INFO(num_mismatches << " values (" << std::fixed << std::setprecision(2) << percent_mismatches
- << "%) mismatched (maximum tolerated " << std::setprecision(2) << tolerance_number << "%)");
- ARM_COMPUTE_EXPECT(num_mismatches <= absolute_tolerance_number, framework::LogLevel::ERRORS);
- }
-}
-
-template <typename T, typename U>
-void validate(T target, T reference, U tolerance)
-{
- ARM_COMPUTE_TEST_INFO("reference = " << std::setprecision(5) << framework::make_printable(reference));
- ARM_COMPUTE_TEST_INFO("target = " << std::setprecision(5) << framework::make_printable(target));
- ARM_COMPUTE_TEST_INFO("tolerance = " << std::setprecision(5) << framework::make_printable(static_cast<typename U::value_type>(tolerance)));
- ARM_COMPUTE_EXPECT((compare<U, typename U::value_type>(target, reference, tolerance)), framework::LogLevel::ERRORS);
-}
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* __ARM_COMPUTE_TEST_REFERENCE_VALIDATION_H__ */
diff --git a/tests/validation_new/fixtures/ActivationLayerFixture.h b/tests/validation_new/fixtures/ActivationLayerFixture.h
deleted file mode 100644
index bf0e7ba6ea..0000000000
--- a/tests/validation_new/fixtures/ActivationLayerFixture.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * 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_ACTIVATION_LAYER_FIXTURE
-#define ARM_COMPUTE_TEST_ACTIVATION_LAYER_FIXTURE
-
-#include "arm_compute/core/TensorShape.h"
-#include "arm_compute/core/Types.h"
-#include "framework/Asserts.h"
-#include "framework/Fixture.h"
-#include "tests/AssetsLibrary.h"
-#include "tests/Globals.h"
-#include "tests/IAccessor.h"
-#include "tests/validation_new/CPP/ActivationLayer.h"
-#include "tests/validation_new/Helpers.h"
-
-#include <random>
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
-class ActivationValidationFixedPointFixture : public framework::Fixture
-{
-public:
- template <typename...>
- void setup(TensorShape shape, bool in_place, ActivationLayerInfo::ActivationFunction function, float alpha_beta, DataType data_type, int fractional_bits)
- {
- _fractional_bits = fractional_bits;
- _data_type = data_type;
- _function = function;
-
- ActivationLayerInfo info(function, alpha_beta, alpha_beta);
-
- _target = compute_target(shape, in_place, info, data_type, fractional_bits);
- _reference = compute_reference(shape, info, data_type, fractional_bits);
- }
-
-protected:
- template <typename U>
- void fill(U &&tensor)
- {
- if(is_data_type_float(_data_type))
- {
- float min_bound = 0;
- float max_bound = 0;
- std::tie(min_bound, max_bound) = get_activation_layer_test_bounds<T>(_function, _data_type);
- std::uniform_real_distribution<> distribution(min_bound, max_bound);
- library->fill(tensor, distribution, 0);
- }
- else
- {
- int min_bound = 0;
- int max_bound = 0;
- std::tie(min_bound, max_bound) = get_activation_layer_test_bounds<T>(_function, _data_type, _fractional_bits);
- std::uniform_int_distribution<> distribution(min_bound, max_bound);
- library->fill(tensor, distribution, 0);
- }
- }
-
- TensorType compute_target(const TensorShape &shape, bool in_place, ActivationLayerInfo info, DataType data_type, int fixed_point_position = 0)
- {
- // Create tensors
- TensorType src = create_tensor<TensorType>(shape, data_type, 1, fixed_point_position);
- TensorType dst = create_tensor<TensorType>(shape, data_type, 1, fixed_point_position);
-
- // Create and configure function
- FunctionType act_layer;
-
- TensorType *dst_ptr = in_place ? &src : &dst;
-
- act_layer.configure(&src, dst_ptr, info);
-
- ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Allocate tensors
- src.allocator()->allocate();
- ARM_COMPUTE_EXPECT(!src.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- if(!in_place)
- {
- dst.allocator()->allocate();
- ARM_COMPUTE_EXPECT(!dst.info()->is_resizable(), framework::LogLevel::ERRORS);
- }
-
- // Fill tensors
- fill(AccessorType(src));
-
- // Compute function
- act_layer.run();
-
- if(in_place)
- {
- return src;
- }
- else
- {
- return dst;
- }
- }
-
- SimpleTensor<T> compute_reference(const TensorShape &shape, ActivationLayerInfo info, DataType data_type, int fixed_point_position = 0)
- {
- // Create reference
- SimpleTensor<T> src{ shape, data_type, 1, fixed_point_position };
-
- // Fill reference
- fill(src);
-
- return reference::activation_layer<T>(src, info);
- }
-
- TensorType _target{};
- SimpleTensor<T> _reference{};
- int _fractional_bits{};
- DataType _data_type{};
- ActivationLayerInfo::ActivationFunction _function{};
-};
-
-template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
-class ActivationValidationFixture : public ActivationValidationFixedPointFixture<TensorType, AccessorType, FunctionType, T>
-{
-public:
- template <typename...>
- void setup(TensorShape shape, bool in_place, ActivationLayerInfo::ActivationFunction function, float alpha_beta, DataType data_type)
- {
- ActivationValidationFixedPointFixture<TensorType, AccessorType, FunctionType, T>::setup(shape, in_place, function, alpha_beta, data_type, 0);
- }
-};
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* ARM_COMPUTE_TEST_ACTIVATION_LAYER_FIXTURE */
diff --git a/tests/validation_new/fixtures/BitwiseAndFixture.h b/tests/validation_new/fixtures/BitwiseAndFixture.h
deleted file mode 100644
index 1769ecdb1f..0000000000
--- a/tests/validation_new/fixtures/BitwiseAndFixture.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * 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_BITWISE_AND_FIXTURE
-#define ARM_COMPUTE_TEST_BITWISE_AND_FIXTURE
-
-#include "arm_compute/core/TensorShape.h"
-#include "arm_compute/core/Types.h"
-#include "framework/Asserts.h"
-#include "framework/Fixture.h"
-#include "tests/AssetsLibrary.h"
-#include "tests/Globals.h"
-#include "tests/IAccessor.h"
-#include "tests/validation_new/CPP/BitwiseAnd.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
-class BitwiseAndValidationFixture : public framework::Fixture
-{
-public:
- template <typename...>
- void setup(TensorShape shape, DataType data_type)
- {
- _target = compute_target(shape, data_type);
- _reference = compute_reference(shape, data_type);
- }
-
-protected:
- template <typename U>
- void fill(U &&tensor, int i)
- {
- library->fill_tensor_uniform(tensor, i);
- }
-
- TensorType compute_target(const TensorShape &shape, DataType data_type)
- {
- // Create tensors
- TensorType src1 = create_tensor<TensorType>(shape, data_type);
- TensorType src2 = create_tensor<TensorType>(shape, data_type);
- TensorType dst = create_tensor<TensorType>(shape, data_type);
-
- // Create and configure function
- FunctionType bitwise_and;
-
- bitwise_and.configure(&src1, &src2, &dst);
-
- ARM_COMPUTE_EXPECT(src1.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(src2.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Allocate tensors
- src1.allocator()->allocate();
- src2.allocator()->allocate();
- dst.allocator()->allocate();
- ARM_COMPUTE_EXPECT(!src1.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(!src2.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(!dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Fill tensors
- fill(AccessorType(src1), 0);
- fill(AccessorType(src2), 1);
-
- // Compute function
- bitwise_and.run();
-
- return dst;
- }
-
- SimpleTensor<T> compute_reference(const TensorShape &shape, DataType data_type)
- {
- // Create reference
- SimpleTensor<T> src1{ shape, data_type };
- SimpleTensor<T> src2{ shape, data_type };
-
- // Fill reference
- fill(src1, 0);
- fill(src2, 1);
-
- return reference::bitwise_and<T>(src1, src2);
- }
-
- TensorType _target{};
- SimpleTensor<T> _reference{};
-};
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* ARM_COMPUTE_TEST_BITWISE_AND_FIXTURE */
diff --git a/tests/validation_new/fixtures/BitwiseNotFixture.h b/tests/validation_new/fixtures/BitwiseNotFixture.h
deleted file mode 100644
index 5954c8639e..0000000000
--- a/tests/validation_new/fixtures/BitwiseNotFixture.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * 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_BITWISE_NOT_FIXTURE
-#define ARM_COMPUTE_TEST_BITWISE_NOT_FIXTURE
-
-#include "arm_compute/core/TensorShape.h"
-#include "arm_compute/core/Types.h"
-#include "framework/Asserts.h"
-#include "framework/Fixture.h"
-#include "tests/AssetsLibrary.h"
-#include "tests/Globals.h"
-#include "tests/IAccessor.h"
-#include "tests/validation_new/CPP/BitwiseNot.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
-class BitwiseNotValidationFixture : public framework::Fixture
-{
-public:
- template <typename...>
- void setup(TensorShape shape, DataType data_type)
- {
- _target = compute_target(shape, data_type);
- _reference = compute_reference(shape, data_type);
- }
-
-protected:
- template <typename U>
- void fill(U &&tensor)
- {
- library->fill_tensor_uniform(tensor, 0);
- }
-
- TensorType compute_target(const TensorShape &shape, DataType data_type)
- {
- // Create tensors
- TensorType src = create_tensor<TensorType>(shape, data_type);
- TensorType dst = create_tensor<TensorType>(shape, data_type);
-
- // Create and configure function
- FunctionType bitwise_not;
-
- bitwise_not.configure(&src, &dst);
-
- ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Allocate tensors
- src.allocator()->allocate();
- dst.allocator()->allocate();
- ARM_COMPUTE_EXPECT(!src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(!dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Fill tensors
- fill(AccessorType(src));
-
- // Compute function
- bitwise_not.run();
-
- return dst;
- }
-
- SimpleTensor<T> compute_reference(const TensorShape &shape, DataType data_type)
- {
- // Create reference
- SimpleTensor<T> src{ shape, data_type };
-
- // Fill reference
- fill(src);
-
- return reference::bitwise_not<T>(src);
- }
-
- TensorType _target{};
- SimpleTensor<T> _reference{};
-};
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* ARM_COMPUTE_TEST_BITWISE_NOT_FIXTURE */
diff --git a/tests/validation_new/fixtures/BitwiseOrFixture.h b/tests/validation_new/fixtures/BitwiseOrFixture.h
deleted file mode 100644
index b39b46e813..0000000000
--- a/tests/validation_new/fixtures/BitwiseOrFixture.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * 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_BITWISE_OR_FIXTURE
-#define ARM_COMPUTE_TEST_BITWISE_OR_FIXTURE
-
-#include "arm_compute/core/TensorShape.h"
-#include "arm_compute/core/Types.h"
-#include "framework/Asserts.h"
-#include "framework/Fixture.h"
-#include "tests/AssetsLibrary.h"
-#include "tests/Globals.h"
-#include "tests/IAccessor.h"
-#include "tests/validation_new/CPP/BitwiseOr.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
-class BitwiseOrValidationFixture : public framework::Fixture
-{
-public:
- template <typename...>
- void setup(TensorShape shape, DataType data_type)
- {
- _target = compute_target(shape, data_type);
- _reference = compute_reference(shape, data_type);
- }
-
-protected:
- template <typename U>
- void fill(U &&tensor, int i)
- {
- library->fill_tensor_uniform(tensor, i);
- }
-
- TensorType compute_target(const TensorShape &shape, DataType data_type)
- {
- // Create tensors
- TensorType src1 = create_tensor<TensorType>(shape, data_type);
- TensorType src2 = create_tensor<TensorType>(shape, data_type);
- TensorType dst = create_tensor<TensorType>(shape, data_type);
-
- // Create and configure function
- FunctionType bitwise_or;
-
- bitwise_or.configure(&src1, &src2, &dst);
-
- ARM_COMPUTE_EXPECT(src1.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(src2.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Allocate tensors
- src1.allocator()->allocate();
- src2.allocator()->allocate();
- dst.allocator()->allocate();
- ARM_COMPUTE_EXPECT(!src1.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(!src2.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(!dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Fill tensors
- fill(AccessorType(src1), 0);
- fill(AccessorType(src2), 1);
-
- // Compute function
- bitwise_or.run();
-
- return dst;
- }
-
- SimpleTensor<T> compute_reference(const TensorShape &shape, DataType data_type)
- {
- // Create reference
- SimpleTensor<T> src1{ shape, data_type };
- SimpleTensor<T> src2{ shape, data_type };
-
- // Fill reference
- fill(src1, 0);
- fill(src2, 1);
-
- return reference::bitwise_or<T>(src1, src2);
- }
-
- TensorType _target{};
- SimpleTensor<T> _reference{};
-};
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* ARM_COMPUTE_TEST_BITWISE_OR_FIXTURE */
diff --git a/tests/validation_new/fixtures/BitwiseXorFixture.h b/tests/validation_new/fixtures/BitwiseXorFixture.h
deleted file mode 100644
index 1dfbf1f784..0000000000
--- a/tests/validation_new/fixtures/BitwiseXorFixture.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * 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_BITWISE_XOR_FIXTURE
-#define ARM_COMPUTE_TEST_BITWISE_XOR_FIXTURE
-
-#include "arm_compute/core/TensorShape.h"
-#include "arm_compute/core/Types.h"
-#include "framework/Asserts.h"
-#include "framework/Fixture.h"
-#include "tests/AssetsLibrary.h"
-#include "tests/Globals.h"
-#include "tests/IAccessor.h"
-#include "tests/validation_new/CPP/BitwiseXor.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
-class BitwiseXorValidationFixture : public framework::Fixture
-{
-public:
- template <typename...>
- void setup(TensorShape shape, DataType data_type)
- {
- _target = compute_target(shape, data_type);
- _reference = compute_reference(shape, data_type);
- }
-
-protected:
- template <typename U>
- void fill(U &&tensor, int i)
- {
- library->fill_tensor_uniform(tensor, i);
- }
-
- TensorType compute_target(const TensorShape &shape, DataType data_type)
- {
- // Create tensors
- TensorType src1 = create_tensor<TensorType>(shape, data_type);
- TensorType src2 = create_tensor<TensorType>(shape, data_type);
- TensorType dst = create_tensor<TensorType>(shape, data_type);
-
- // Create and configure function
- FunctionType bitwise_xor;
-
- bitwise_xor.configure(&src1, &src2, &dst);
-
- ARM_COMPUTE_EXPECT(src1.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(src2.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Allocate tensors
- src1.allocator()->allocate();
- src2.allocator()->allocate();
- dst.allocator()->allocate();
- ARM_COMPUTE_EXPECT(!src1.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(!src2.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(!dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Fill tensors
- fill(AccessorType(src1), 0);
- fill(AccessorType(src2), 1);
-
- // Compute function
- bitwise_xor.run();
-
- return dst;
- }
-
- SimpleTensor<T> compute_reference(const TensorShape &shape, DataType data_type)
- {
- // Create reference
- SimpleTensor<T> src1{ shape, data_type };
- SimpleTensor<T> src2{ shape, data_type };
-
- // Fill reference
- fill(src1, 0);
- fill(src2, 1);
-
- return reference::bitwise_xor<T>(src1, src2);
- }
-
- TensorType _target{};
- SimpleTensor<T> _reference{};
-};
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* ARM_COMPUTE_TEST_BITWISE_XOR_FIXTURE */
diff --git a/tests/validation_new/fixtures/ConvolutionLayerFixture.h b/tests/validation_new/fixtures/ConvolutionLayerFixture.h
deleted file mode 100644
index 25a53d0c1d..0000000000
--- a/tests/validation_new/fixtures/ConvolutionLayerFixture.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * 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_CONVOLUTION_LAYER_FIXTURE
-#define ARM_COMPUTE_TEST_CONVOLUTION_LAYER_FIXTURE
-
-#include "arm_compute/core/TensorShape.h"
-#include "arm_compute/core/Types.h"
-#include "framework/Asserts.h"
-#include "framework/Fixture.h"
-#include "tests/AssetsLibrary.h"
-#include "tests/Globals.h"
-#include "tests/IAccessor.h"
-#include "tests/validation_new/CPP/ConvolutionLayer.h"
-#include "tests/validation_new/Helpers.h"
-
-#include <random>
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
-class ConvolutionValidationFixedPointFixture : public framework::Fixture
-{
-public:
- template <typename...>
- void setup(TensorShape input_shape, TensorShape weights_shape, TensorShape bias_shape, TensorShape output_shape, PadStrideInfo info, DataType data_type, int fractional_bits)
- {
- _fractional_bits = fractional_bits;
- _data_type = data_type;
-
- _target = compute_target(input_shape, weights_shape, bias_shape, output_shape, info, data_type, fractional_bits);
- _reference = compute_reference(input_shape, weights_shape, bias_shape, output_shape, info, data_type, fractional_bits);
- }
-
-protected:
- template <typename U>
- void fill(U &&tensor, int i)
- {
- switch(tensor.data_type())
- {
- case DataType::F16:
- case DataType::F32:
- {
- std::uniform_real_distribution<> distribution(-1.0f, 1.0f);
- library->fill(tensor, distribution, i);
- break;
- }
- default:
- library->fill_tensor_uniform(tensor, i);
- }
- }
-
- TensorType compute_target(const TensorShape &input_shape, const TensorShape &weights_shape, const TensorShape &bias_shape, const TensorShape &output_shape, const PadStrideInfo &info,
- DataType data_type, int fixed_point_position)
- {
- // Create tensors
- TensorType src = create_tensor<TensorType>(input_shape, data_type, 1, fixed_point_position);
- TensorType weights = create_tensor<TensorType>(weights_shape, data_type, 1, fixed_point_position);
- TensorType bias = create_tensor<TensorType>(bias_shape, data_type, 1, fixed_point_position);
- TensorType dst = create_tensor<TensorType>(output_shape, data_type, 1, fixed_point_position);
-
- // Create and configure function
- FunctionType conv;
- conv.configure(&src, &weights, &bias, &dst, info);
-
- ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(weights.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(bias.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Allocate tensors
- src.allocator()->allocate();
- weights.allocator()->allocate();
- bias.allocator()->allocate();
- dst.allocator()->allocate();
-
- ARM_COMPUTE_EXPECT(!src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(!weights.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(!bias.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(!dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Fill tensors
- fill(AccessorType(src), 0);
- fill(AccessorType(weights), 1);
- fill(AccessorType(bias), 2);
-
- // Compute NEConvolutionLayer function
- conv.run();
-
- return dst;
- }
-
- SimpleTensor<T> compute_reference(const TensorShape &input_shape, const TensorShape &weights_shape, const TensorShape &bias_shape, const TensorShape &output_shape, const PadStrideInfo &info,
- DataType data_type, int fixed_point_position)
- {
- // Create reference
- SimpleTensor<T> src{ input_shape, data_type, 1, fixed_point_position };
- SimpleTensor<T> weights{ weights_shape, data_type, 1, fixed_point_position };
- SimpleTensor<T> bias{ bias_shape, data_type, 1, fixed_point_position };
-
- // Fill reference
- fill(src, 0);
- fill(weights, 1);
- fill(bias, 2);
-
- return reference::convolution_layer<T>(src, weights, bias, output_shape, info);
- }
-
- TensorType _target{};
- SimpleTensor<T> _reference{};
- int _fractional_bits{};
- DataType _data_type{};
-};
-
-template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
-class ConvolutionValidationFixture : public ConvolutionValidationFixedPointFixture<TensorType, AccessorType, FunctionType, T>
-{
-public:
- template <typename...>
- void setup(TensorShape input_shape, TensorShape weights_shape, TensorShape bias_shape, TensorShape output_shape, PadStrideInfo info, DataType data_type)
- {
- ConvolutionValidationFixedPointFixture<TensorType, AccessorType, FunctionType, T>::setup(input_shape, weights_shape, bias_shape, output_shape, info, data_type, 0);
- }
-};
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* ARM_COMPUTE_TEST_CONVOLUTION_LAYER_FIXTURE */
diff --git a/tests/validation_new/fixtures/DepthConcatenateLayerFixture.h b/tests/validation_new/fixtures/DepthConcatenateLayerFixture.h
deleted file mode 100644
index 601758f80e..0000000000
--- a/tests/validation_new/fixtures/DepthConcatenateLayerFixture.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * 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_DEPTHCONCATENATE_LAYER_FIXTURE
-#define ARM_COMPUTE_TEST_DEPTHCONCATENATE_LAYER_FIXTURE
-
-#include "arm_compute/core/TensorShape.h"
-#include "arm_compute/core/Types.h"
-#include "framework/Asserts.h"
-#include "framework/Fixture.h"
-#include "tests/AssetsLibrary.h"
-#include "tests/Globals.h"
-#include "tests/IAccessor.h"
-#include "tests/validation_new/CPP/DepthConcatenateLayer.h"
-#include "tests/validation_new/Helpers.h"
-
-#include <random>
-
-namespace arm_compute
-{
-class ITensor;
-class Tensor;
-class ICLTensor;
-class CLTensor;
-
-namespace test
-{
-namespace validation
-{
-template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
-class DepthConcatenateValidationFixture : public framework::Fixture
-{
-public:
- template <typename...>
- void setup(TensorShape shape, DataType data_type)
- {
- // Create input shapes
- std::mt19937 gen(library->seed());
- std::uniform_int_distribution<> num_dis(2, 6);
- const int num_tensors = num_dis(gen);
-
- std::vector<TensorShape> shapes(num_tensors, shape);
- std::uniform_int_distribution<> depth_dis(1, 7);
- std::bernoulli_distribution mutate_dis(0.25f);
- std::uniform_real_distribution<> change_dis(-0.25f, 0.f);
-
- // Generate more shapes based on the input
- for(auto &s : shapes)
- {
- // Set the depth of the tensor
- s.set(2, depth_dis(gen));
-
- // Randomly change the first dimension
- if(mutate_dis(gen))
- {
- // Decrease the dimension by a small percentage. Don't increase
- // as that could make tensor too large. Also the change must be
- // an even number. Otherwise out depth concatenate fails.
- s.set(0, s[0] + 2 * static_cast<int>(s[0] * change_dis(gen)));
- }
-
- // Repeat the same as above for the second dimension
- if(mutate_dis(gen))
- {
- s.set(1, s[1] + 2 * static_cast<int>(s[1] * change_dis(gen)));
- }
- }
-
- _target = compute_target(shapes, data_type);
- _reference = compute_reference(shapes, data_type);
- }
-
-protected:
- template <typename U>
- void fill(U &&tensor, int i)
- {
- library->fill_tensor_uniform(tensor, i);
- }
-
- TensorType compute_target(std::vector<TensorShape> shapes, DataType data_type)
- {
- using ITensorType = typename std::conditional<std::is_same<TensorType, Tensor>::value, ITensor, ICLTensor>::type;
-
- std::vector<TensorType> srcs;
- std::vector<ITensorType *> src_ptrs;
-
- // Create tensors
- srcs.reserve(shapes.size());
-
- for(const auto &shape : shapes)
- {
- srcs.emplace_back(create_tensor<TensorType>(shape, data_type, 1, _fractional_bits));
- src_ptrs.emplace_back(&srcs.back());
- }
-
- TensorShape dst_shape = calculate_depth_concatenate_shape(shapes);
- TensorType dst = create_tensor<TensorType>(dst_shape, data_type, 1, _fractional_bits);
-
- // Create and configure function
- FunctionType depth_concat;
- depth_concat.configure(src_ptrs, &dst);
-
- for(auto &src : srcs)
- {
- ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
- }
-
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Allocate tensors
- for(auto &src : srcs)
- {
- src.allocator()->allocate();
- ARM_COMPUTE_EXPECT(!src.info()->is_resizable(), framework::LogLevel::ERRORS);
- }
-
- dst.allocator()->allocate();
- ARM_COMPUTE_EXPECT(!dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Fill tensors
- int i = 0;
- for(auto &src : srcs)
- {
- fill(AccessorType(src), i++);
- }
-
- // Compute function
- depth_concat.run();
-
- return dst;
- }
-
- SimpleTensor<T> compute_reference(std::vector<TensorShape> shapes, DataType data_type)
- {
- std::vector<SimpleTensor<T>> srcs;
-
- // Create and fill tensors
- int i = 0;
- for(const auto &shape : shapes)
- {
- srcs.emplace_back(shape, data_type, 1, _fractional_bits);
- fill(srcs.back(), i++);
- }
-
- return reference::depthconcatenate_layer<T>(srcs);
- }
-
- TensorType _target{};
- SimpleTensor<T> _reference{};
-
-private:
- int _fractional_bits{ 1 };
-};
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* ARM_COMPUTE_TEST_DEPTHCONCATENATE_LAYER_FIXTURE */
diff --git a/tests/validation_new/fixtures/DepthwiseConvolutionFixture.h b/tests/validation_new/fixtures/DepthwiseConvolutionFixture.h
deleted file mode 100644
index b745c7e53c..0000000000
--- a/tests/validation_new/fixtures/DepthwiseConvolutionFixture.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * 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_DEPTHWISE_CONVOLUTION_FIXTURE
-#define ARM_COMPUTE_TEST_DEPTHWISE_CONVOLUTION_FIXTURE
-
-#include "arm_compute/core/TensorShape.h"
-#include "arm_compute/core/Types.h"
-#include "framework/Asserts.h"
-#include "framework/Fixture.h"
-#include "tests/AssetsLibrary.h"
-#include "tests/Globals.h"
-#include "tests/IAccessor.h"
-#include "tests/validation_new/CPP/DepthwiseConvolution.h"
-#include "tests/validation_new/Helpers.h"
-
-#include <random>
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
-class DepthwiseConvolutionValidationFixture : public framework::Fixture
-{
-public:
- template <typename...>
- void setup(TensorShape in_shape, TensorShape weights_shape, TensorShape out_shape, PadStrideInfo pad_stride_info)
- {
- _target = compute_target(in_shape, weights_shape, out_shape, pad_stride_info);
- _reference = compute_reference(in_shape, weights_shape, out_shape, pad_stride_info);
- }
-
-protected:
- template <typename U>
- void fill(U &&tensor, int i)
- {
- switch(tensor.data_type())
- {
- case DataType::F32:
- {
- std::uniform_real_distribution<> distribution(-1.0f, 1.0f);
- library->fill(tensor, distribution, i);
- break;
- }
- default:
- library->fill_tensor_uniform(tensor, i);
- }
- }
-
- TensorType compute_target(const TensorShape &input_shape, const TensorShape &weights_shape, const TensorShape &output_shape, PadStrideInfo &pad_stride_info)
- {
- // Create tensors
- TensorType src = create_tensor<TensorType>(input_shape, DataType::F32);
- TensorType weights = create_tensor<TensorType>(weights_shape, DataType::F32);
- TensorType dst = create_tensor<TensorType>(output_shape, DataType::F32);
-
- // Create Depthwise Convolution configure function
- CLDepthwiseConvolution depthwise_convolution;
- depthwise_convolution.configure(&src, &dst, &weights, pad_stride_info);
-
- // Allocate tensors
- src.allocator()->allocate();
- weights.allocator()->allocate();
- dst.allocator()->allocate();
-
- ARM_COMPUTE_EXPECT(!src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(!weights.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(!dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Fill tensors
- fill(AccessorType(src), 0);
- fill(AccessorType(weights), 1);
-
- // Compute function
- depthwise_convolution.run();
-
- return dst;
- }
-
- SimpleTensor<T> compute_reference(const TensorShape &in_shape, const TensorShape &weights_shape, const TensorShape &out_shape, const PadStrideInfo &pad_stride_info)
- {
- SimpleTensor<T> src(in_shape, DataType::F32);
- SimpleTensor<T> weights(weights_shape, DataType::F32);
-
- fill(src, 0);
- fill(weights, 1);
-
- return reference::depthwise_convolution(src, weights, out_shape, pad_stride_info);
- }
-
- TensorType _target{};
- SimpleTensor<T> _reference{};
-};
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* ARM_COMPUTE_TEST_DEPTHWISE_CONVOLUTION_FIXTURE */
diff --git a/tests/validation_new/fixtures/DepthwiseSeparableConvolutionLayerFixture.h b/tests/validation_new/fixtures/DepthwiseSeparableConvolutionLayerFixture.h
deleted file mode 100644
index c2578a9ce0..0000000000
--- a/tests/validation_new/fixtures/DepthwiseSeparableConvolutionLayerFixture.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * 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_DEPTHWISE_SEPARABLE_CONVOLUTION_LAYER_FIXTURE
-#define ARM_COMPUTE_TEST_DEPTHWISE_SEPARABLE_CONVOLUTION_LAYER_FIXTURE
-
-#include "arm_compute/core/TensorShape.h"
-#include "arm_compute/core/Types.h"
-#include "framework/Asserts.h"
-#include "framework/Fixture.h"
-#include "tests/AssetsLibrary.h"
-#include "tests/Globals.h"
-#include "tests/IAccessor.h"
-#include "tests/validation_new/CPP/DepthwiseSeparableConvolutionLayer.h"
-#include "tests/validation_new/Helpers.h"
-
-#include <random>
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
-class DepthwiseSeparableConvolutionValidationFixture : public framework::Fixture
-{
-public:
- template <typename...>
- void setup(TensorShape in_shape, TensorShape depthwise_weights_shape, TensorShape depthwise_out_shape, TensorShape pointwise_weights_shape, TensorShape biases_shape, TensorShape output_shape,
- PadStrideInfo pad_stride_depthwise_info, PadStrideInfo pad_stride_pointwise_info)
- {
- _target = compute_target(in_shape, depthwise_weights_shape, depthwise_out_shape, pointwise_weights_shape, biases_shape, output_shape, pad_stride_depthwise_info, pad_stride_pointwise_info);
- _reference = compute_reference(in_shape, depthwise_weights_shape, depthwise_out_shape, pointwise_weights_shape, biases_shape, output_shape, pad_stride_depthwise_info, pad_stride_pointwise_info);
- }
-
-protected:
- template <typename U>
- void fill(U &&tensor, int i)
- {
- switch(tensor.data_type())
- {
- case DataType::F32:
- {
- std::uniform_real_distribution<> distribution(-1.0f, 1.0f);
- library->fill(tensor, distribution, i);
- break;
- }
- default:
- library->fill_tensor_uniform(tensor, i);
- }
- }
-
- TensorType compute_target(const TensorShape &input_shape, const TensorShape &depthwise_weights_shape, const TensorShape &depthwise_out_shape, const TensorShape &pointwise_weights_shape,
- const TensorShape &biases_shape,
- const TensorShape &output_shape, const PadStrideInfo &pad_stride_depthwise_info, const PadStrideInfo &pad_stride_pointwise_info)
- {
- // Create tensors
- TensorType src = create_tensor<TensorType>(input_shape, DataType::F32);
- TensorType depthwise_weights = create_tensor<TensorType>(depthwise_weights_shape, DataType::F32);
- TensorType depthwise_out = create_tensor<TensorType>(depthwise_out_shape, DataType::F32);
- TensorType pointwise_weights = create_tensor<TensorType>(pointwise_weights_shape, DataType::F32);
- TensorType biases = create_tensor<TensorType>(biases_shape, DataType::F32);
- TensorType dst = create_tensor<TensorType>(output_shape, DataType::F32);
-
- // Create Depthwise Separable Convolution Layer configure function
- CLDepthwiseSeparableConvolutionLayer depthwise_separable_convolution_layer;
- depthwise_separable_convolution_layer.configure(&src, &depthwise_weights, &depthwise_out, &pointwise_weights, &biases, &dst, pad_stride_depthwise_info, pad_stride_pointwise_info);
-
- // Allocate tensors
- src.allocator()->allocate();
- depthwise_weights.allocator()->allocate();
- depthwise_out.allocator()->allocate();
- pointwise_weights.allocator()->allocate();
- biases.allocator()->allocate();
- dst.allocator()->allocate();
-
- ARM_COMPUTE_EXPECT(!src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(!depthwise_weights.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(!depthwise_out.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(!pointwise_weights.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(!biases.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(!dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Fill tensors
- fill(AccessorType(src), 0);
- fill(AccessorType(depthwise_weights), 1);
- fill(AccessorType(pointwise_weights), 2);
- fill(AccessorType(biases), 3);
-
- // Compute function
- depthwise_separable_convolution_layer.run();
-
- return dst;
- }
-
- SimpleTensor<T> compute_reference(const TensorShape &in_shape, const TensorShape &depthwise_weights_shape, const TensorShape &depthwise_out_shape, const TensorShape &pointwise_weights_shape,
- const TensorShape &biases_shape, const TensorShape &dst_shape, const PadStrideInfo &pad_stride_depthwise_info, const PadStrideInfo &pad_stride_pointwise_info)
- {
- SimpleTensor<T> src(in_shape, DataType::F32);
- SimpleTensor<T> depthwise_weights(depthwise_weights_shape, DataType::F32);
- SimpleTensor<T> pointwise_weights(pointwise_weights_shape, DataType::F32);
- SimpleTensor<T> biases(biases_shape, DataType::F32);
-
- fill(src, 0);
- fill(depthwise_weights, 1);
- fill(pointwise_weights, 2);
- fill(biases, 3);
-
- return reference::depthwise_separable_convolution_layer(src, depthwise_weights, depthwise_out_shape, pointwise_weights, biases, dst_shape, pad_stride_depthwise_info, pad_stride_pointwise_info);
- }
-
- TensorType _target{};
- SimpleTensor<T> _reference{};
-};
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* ARM_COMPUTE_TEST_DEPTHWISE_SEPARABLE_CONVOLUTION_LAYER_FIXTURE */
diff --git a/tests/validation_new/fixtures/DequantizationLayerFixture.h b/tests/validation_new/fixtures/DequantizationLayerFixture.h
deleted file mode 100644
index 35c536d6a0..0000000000
--- a/tests/validation_new/fixtures/DequantizationLayerFixture.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * 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_DEQUANTIZATION_LAYER_FIXTURE
-#define ARM_COMPUTE_TEST_DEQUANTIZATION_LAYER_FIXTURE
-
-#include "arm_compute/core/TensorShape.h"
-#include "arm_compute/core/Types.h"
-#include "arm_compute/runtime/Tensor.h"
-#include "framework/Asserts.h"
-#include "framework/Fixture.h"
-#include "tests/AssetsLibrary.h"
-#include "tests/Globals.h"
-#include "tests/IAccessor.h"
-#include "tests/validation_new/CPP/DequantizationLayer.h"
-
-#include <random>
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
-class DequantizationValidationFixedPointFixture : public framework::Fixture
-{
-public:
- template <typename...>
- void setup(TensorShape shape, DataType data_type)
- {
- // Initialize random min and max values
- rand_min_max(&_min, &_max);
-
- _target = compute_target(shape, data_type, _min, _max);
- _reference = compute_reference(shape, data_type, _min, _max);
- }
-
-protected:
- template <typename U>
- void fill(U &&tensor)
- {
- library->fill_tensor_uniform(tensor, 0);
- }
-
- TensorType compute_target(const TensorShape &shape, DataType data_type, float min, float max)
- {
- // Create tensors
- TensorType src = create_tensor<TensorType>(shape, data_type);
- TensorType dst = create_tensor<TensorType>(shape, DataType::F32);
-
- // Create and configure function
- FunctionType dequantization_layer;
- dequantization_layer.configure(&src, &dst, &min, &max);
-
- ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Allocate tensors
- src.allocator()->allocate();
- dst.allocator()->allocate();
-
- ARM_COMPUTE_EXPECT(!src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(!dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Fill tensors
- fill(AccessorType(src));
-
- // Compute function
- dequantization_layer.run();
-
- return dst;
- }
-
- SimpleTensor<float> compute_reference(const TensorShape &shape, DataType data_type, float min, float max)
- {
- // Create reference
- SimpleTensor<T> src{ shape, data_type };
-
- // Fill reference
- fill(src);
-
- return reference::dequantization_layer<T>(src, min, max);
- }
-
- /** Generate random constant values to be used as min and max for dequantization.
- */
- void rand_min_max(float *min, float *max)
- {
- std::mt19937 gen(library->seed());
- std::uniform_real_distribution<float> distribution(-10000.0, 10000.0);
-
- const float n1 = distribution(gen);
- const float n2 = distribution(gen);
-
- if(n1 < n2)
- {
- *min = n1;
- *max = n2;
- }
- else
- {
- *min = n2;
- *max = n1;
- }
- }
-
- TensorType _target{};
- SimpleTensor<float> _reference{};
- float _min = 0.f;
- float _max = 0.f;
-};
-
-template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
-class DequantizationValidationFixture : public DequantizationValidationFixedPointFixture<TensorType, AccessorType, FunctionType, T>
-{
-public:
- template <typename...>
- void setup(TensorShape shape, DataType data_type)
- {
- DequantizationValidationFixedPointFixture<TensorType, AccessorType, FunctionType, T>::setup(shape, data_type);
- }
-};
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* ARM_COMPUTE_TEST_DEQUANTIZATION_LAYER_FIXTURE */
diff --git a/tests/validation_new/fixtures/DirectConvolutionLayerFixture.h b/tests/validation_new/fixtures/DirectConvolutionLayerFixture.h
deleted file mode 100644
index 0d138b47d9..0000000000
--- a/tests/validation_new/fixtures/DirectConvolutionLayerFixture.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * 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/TensorShape.h"
-#include "arm_compute/core/Types.h"
-#include "framework/Asserts.h"
-#include "framework/Fixture.h"
-#include "tests/AssetsLibrary.h"
-#include "tests/Globals.h"
-#include "tests/IAccessor.h"
-#include "tests/validation_new/CPP/ConvolutionLayer.h"
-#include "tests/validation_new/Helpers.h"
-#include "tests/validation_new/fixtures/ConvolutionLayerFixture.h"
-
-#include <random>
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
-class DirectConvolutionValidationFixedPointFixture : public ConvolutionValidationFixedPointFixture<TensorType, AccessorType, FunctionType, T>
-{
-public:
- template <typename...>
- void setup(TensorShape input_shape, int stride_x, int stride_y, int pad_x, int pad_y, unsigned int kernel_size, unsigned int num_kernels, DataType data_type, int fractional_bits)
- {
- const TensorShape weights_shape(kernel_size, kernel_size, input_shape.z(), num_kernels);
- const TensorShape bias_shape(num_kernels);
- const PadStrideInfo info(stride_x, stride_y, pad_x, pad_y, DimensionRoundingType::FLOOR);
- const TensorShape output_shape = get_output_shape(input_shape, weights_shape, info);
-
- ConvolutionValidationFixedPointFixture<TensorType, AccessorType, FunctionType, T>::setup(input_shape, weights_shape, bias_shape, output_shape, info, data_type, fractional_bits);
- }
-
-private:
- TensorShape get_output_shape(TensorShape in_shape, TensorShape kernel_shape, const PadStrideInfo &info)
- {
- TensorShape out_shape(in_shape);
- const std::pair<unsigned int, unsigned int> scaled_dims = scaled_dimensions(in_shape.x(),
- in_shape.y(),
- kernel_shape.x(),
- kernel_shape.y(),
- info);
- out_shape.set(0, scaled_dims.first);
- out_shape.set(1, scaled_dims.second);
- out_shape.set(2, kernel_shape[3]);
- return out_shape;
- }
-};
-
-template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
-class DirectConvolutionValidationFixture : public DirectConvolutionValidationFixedPointFixture<TensorType, AccessorType, FunctionType, T>
-{
-public:
- template <typename...>
- void setup(TensorShape input_shape, int stride_x, int stride_y, int pad_x, int pad_y, unsigned int kernel_size, unsigned int num_kernels, DataType data_type)
- {
- DirectConvolutionValidationFixedPointFixture<TensorType, AccessorType, FunctionType, T>::setup(input_shape, stride_x, stride_y, pad_x, pad_y, kernel_size, num_kernels, data_type, 0);
- }
-};
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
diff --git a/tests/validation_new/fixtures/FloorFixture.h b/tests/validation_new/fixtures/FloorFixture.h
deleted file mode 100644
index ab4c5c7e1e..0000000000
--- a/tests/validation_new/fixtures/FloorFixture.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * 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_FLOOR_FIXTURE
-#define ARM_COMPUTE_TEST_FLOOR_FIXTURE
-
-#include "arm_compute/core/TensorShape.h"
-#include "arm_compute/core/Types.h"
-#include "arm_compute/runtime/Tensor.h"
-#include "framework/Asserts.h"
-#include "framework/Fixture.h"
-#include "tests/AssetsLibrary.h"
-#include "tests/Globals.h"
-#include "tests/IAccessor.h"
-#include "tests/validation_new/CPP/Floor.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
-class FloorValidationFixture : public framework::Fixture
-{
-public:
- template <typename...>
- void setup(TensorShape shape, DataType data_type)
- {
- _target = compute_target(shape, data_type);
- _reference = compute_reference(shape, data_type);
- }
-
-protected:
- template <typename U>
- void fill(U &&tensor)
- {
- library->fill_tensor_uniform(tensor, 0);
- }
-
- TensorType compute_target(const TensorShape &shape, DataType data_type)
- {
- // Create tensors
- TensorType src = create_tensor<TensorType>(shape, data_type);
- TensorType dst = create_tensor<TensorType>(shape, data_type);
-
- // Create and configure function
- FunctionType floor_func;
- floor_func.configure(&src, &dst);
-
- ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Allocate tensors
- src.allocator()->allocate();
- dst.allocator()->allocate();
-
- ARM_COMPUTE_EXPECT(!src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(!dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Fill tensors
- fill(AccessorType(src));
-
- // Compute function
- floor_func.run();
-
- return dst;
- }
-
- SimpleTensor<T> compute_reference(const TensorShape &shape, DataType data_type)
- {
- // Create reference
- SimpleTensor<T> src{ shape, data_type };
-
- // Fill reference
- fill(src);
-
- return reference::floor_layer<T>(src);
- }
-
- TensorType _target{};
- SimpleTensor<T> _reference{};
-};
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* ARM_COMPUTE_TEST_FLOOR_FIXTURE */
diff --git a/tests/validation_new/fixtures/FullyConnectedLayerFixture.h b/tests/validation_new/fixtures/FullyConnectedLayerFixture.h
deleted file mode 100644
index 0953b0b67e..0000000000
--- a/tests/validation_new/fixtures/FullyConnectedLayerFixture.h
+++ /dev/null
@@ -1,250 +0,0 @@
-/*
- * 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_FULLY_CONNECTED_LAYER_FIXTURE
-#define ARM_COMPUTE_TEST_FULLY_CONNECTED_LAYER_FIXTURE
-
-#include "arm_compute/core/TensorShape.h"
-#include "arm_compute/core/Types.h"
-#include "arm_compute/core/Utils.h"
-#include "framework/Asserts.h"
-#include "framework/Fixture.h"
-#include "tests/AssetsLibrary.h"
-#include "tests/Globals.h"
-#include "tests/IAccessor.h"
-#include "tests/RawTensor.h"
-#include "tests/validation_new/CPP/FullyConnectedLayer.h"
-#include "tests/validation_new/Helpers.h"
-
-#include <random>
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-namespace
-{
-RawTensor transpose(const RawTensor &src, int interleave = 1)
-{
- // Create reference
- TensorShape dst_shape(src.shape());
- dst_shape.set(0, src.shape().y() * interleave);
- dst_shape.set(1, std::ceil(src.shape().x() / static_cast<float>(interleave)));
-
- RawTensor dst{ dst_shape, src.data_type() };
-
- // Compute reference
- uint8_t *out_ptr = dst.data();
-
- for(int i = 0; i < dst.num_elements(); i += interleave)
- {
- Coordinates coord = index2coord(dst.shape(), i);
- size_t coord_x = coord.x();
- coord.set(0, coord.y() * interleave);
- coord.set(1, coord_x / interleave);
-
- const int num_elements = std::min<int>(interleave, src.shape().x() - coord.x());
-
- std::copy_n(static_cast<const uint8_t *>(src(coord)), num_elements * src.element_size(), out_ptr);
-
- out_ptr += interleave * dst.element_size();
- }
-
- return dst;
-}
-} // namespace
-
-template <typename TensorType, typename AccessorType, typename FunctionType, typename T, bool run_interleave>
-class FullyConnectedLayerValidationFixedPointFixture : public framework::Fixture
-{
-public:
- template <typename...>
- void setup(TensorShape input_shape, TensorShape weights_shape, TensorShape bias_shape, TensorShape output_shape, bool transpose_weights, bool reshape_weights, DataType data_type, int fractional_bits)
- {
- ARM_COMPUTE_UNUSED(weights_shape);
- ARM_COMPUTE_UNUSED(bias_shape);
-
- _fractional_bits = fractional_bits;
- _data_type = data_type;
-
- _target = compute_target(input_shape, weights_shape, bias_shape, output_shape, transpose_weights, reshape_weights, data_type, fractional_bits);
- _reference = compute_reference(input_shape, weights_shape, bias_shape, output_shape, transpose_weights, reshape_weights, data_type, fractional_bits);
- }
-
-protected:
- template <typename U>
- void fill(U &&tensor, int i)
- {
- if(is_data_type_float(_data_type))
- {
- std::uniform_real_distribution<> distribution(0.5f, 1.f);
- library->fill(tensor, distribution, i);
- }
- else
- {
- library->fill_tensor_uniform(tensor, i);
- }
- }
-
- TensorType compute_target(const TensorShape &input_shape, const TensorShape &weights_shape, const TensorShape &bias_shape, const TensorShape &output_shape, bool transpose_weights,
- bool reshape_weights, DataType data_type, int fixed_point_position)
- {
- TensorShape reshaped_weights_shape(weights_shape);
-
- // Test actions depending on the target settings
- //
- // | reshape | !reshape
- // -----------+-----------+---------------------------
- // transpose | | ***
- // -----------+-----------+---------------------------
- // !transpose | transpose | transpose &
- // | | transpose1xW (if required)
- //
- // ***: That combination is invalid. But we can ignore the transpose flag and handle all !reshape the same
- if(!reshape_weights || !transpose_weights)
- {
- const size_t shape_x = reshaped_weights_shape.x();
- reshaped_weights_shape.set(0, reshaped_weights_shape.y());
- reshaped_weights_shape.set(1, shape_x);
-
- // Weights have to be passed reshaped
- // Transpose 1xW for batched version
- if(!reshape_weights && output_shape.y() > 1 && run_interleave)
- {
- const int transpose_width = 16 / data_size_from_type(data_type);
- const float shape_x = reshaped_weights_shape.x();
- reshaped_weights_shape.set(0, reshaped_weights_shape.y() * transpose_width);
- reshaped_weights_shape.set(1, static_cast<unsigned int>(std::ceil(shape_x / transpose_width)));
- }
- }
-
- // Create tensors
- TensorType src = create_tensor<TensorType>(input_shape, data_type, 1, fixed_point_position);
- TensorType weights = create_tensor<TensorType>(reshaped_weights_shape, data_type, 1, fixed_point_position);
- TensorType bias = create_tensor<TensorType>(bias_shape, data_type, 1, fixed_point_position);
- TensorType dst = create_tensor<TensorType>(output_shape, data_type, 1, fixed_point_position);
-
- // Create and configure function.
- FunctionType fc;
- fc.configure(&src, &weights, &bias, &dst, transpose_weights, !reshape_weights);
-
- ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(weights.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(bias.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Allocate tensors
- src.allocator()->allocate();
- weights.allocator()->allocate();
- bias.allocator()->allocate();
- dst.allocator()->allocate();
-
- ARM_COMPUTE_EXPECT(!src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(!weights.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(!bias.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(!dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Fill tensors
- fill(AccessorType(src), 0);
- fill(AccessorType(bias), 2);
-
- if(!reshape_weights || !transpose_weights)
- {
- TensorShape tmp_shape(weights_shape);
- RawTensor tmp(tmp_shape, data_type, 1, fixed_point_position);
-
- // Fill with original shape
- fill(tmp, 1);
-
- // Transpose elementwise
- tmp = transpose(tmp);
-
- // Reshape weights for batched runs
- if(!reshape_weights && output_shape.y() > 1 && run_interleave)
- {
- // Transpose with interleave
- const int interleave_size = 16 / tmp.element_size();
- tmp = transpose(tmp, interleave_size);
- }
-
- AccessorType weights_accessor(weights);
-
- for(int i = 0; i < tmp.num_elements(); ++i)
- {
- Coordinates coord = index2coord(tmp.shape(), i);
- std::copy_n(static_cast<const RawTensor::value_type *>(tmp(coord)),
- tmp.element_size(),
- static_cast<RawTensor::value_type *>(weights_accessor(coord)));
- }
- }
- else
- {
- fill(AccessorType(weights), 1);
- }
-
- // Compute NEFullyConnectedLayer function
- fc.run();
-
- return dst;
- }
-
- SimpleTensor<T> compute_reference(const TensorShape &input_shape, const TensorShape &weights_shape, const TensorShape &bias_shape, const TensorShape &output_shape, bool transpose_weights,
- bool reshape_weights, DataType data_type, int fixed_point_position = 0)
- {
- // Create reference
- SimpleTensor<T> src{ input_shape, data_type, 1, fixed_point_position };
- SimpleTensor<T> weights{ weights_shape, data_type, 1, fixed_point_position };
- SimpleTensor<T> bias{ bias_shape, data_type, 1, fixed_point_position };
-
- // Fill reference
- fill(src, 0);
- fill(weights, 1);
- fill(bias, 2);
-
- return reference::fully_connected_layer<T>(src, weights, bias, output_shape);
- }
-
- TensorType _target{};
- SimpleTensor<T> _reference{};
- int _fractional_bits{};
- DataType _data_type{};
-};
-
-template <typename TensorType, typename AccessorType, typename FunctionType, typename T, bool run_interleave>
-class FullyConnectedLayerValidationFixture : public FullyConnectedLayerValidationFixedPointFixture<TensorType, AccessorType, FunctionType, T, run_interleave>
-{
-public:
- template <typename...>
- void setup(TensorShape input_shape, TensorShape weights_shape, TensorShape bias_shape, TensorShape output_shape, bool transpose_weights, bool reshape_weights, DataType data_type)
- {
- FullyConnectedLayerValidationFixedPointFixture<TensorType, AccessorType, FunctionType, T, run_interleave>::setup(input_shape, weights_shape, bias_shape, output_shape, transpose_weights,
- reshape_weights, data_type,
- 0);
- }
-};
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* ARM_COMPUTE_TEST_FULLY_CONNECTED_LAYER_FIXTURE */
diff --git a/tests/validation_new/fixtures/GEMMFixture.h b/tests/validation_new/fixtures/GEMMFixture.h
deleted file mode 100644
index a6ab518d74..0000000000
--- a/tests/validation_new/fixtures/GEMMFixture.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * 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_GEMM_FIXTURE
-#define ARM_COMPUTE_TEST_GEMM_FIXTURE
-
-#include "arm_compute/core/TensorShape.h"
-#include "arm_compute/core/Types.h"
-#include "framework/Asserts.h"
-#include "framework/Fixture.h"
-#include "tests/AssetsLibrary.h"
-#include "tests/Globals.h"
-#include "tests/IAccessor.h"
-#include "tests/validation_new/CPP/GEMM.h"
-#include "tests/validation_new/Helpers.h"
-
-#include <random>
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
-class GEMMValidationFixedPointFixture : public framework::Fixture
-{
-public:
- template <typename...>
- void setup(TensorShape shape_a, TensorShape shape_b, TensorShape shape_c, TensorShape output_shape, float alpha, float beta, DataType data_type, int fractional_bits)
- {
- _fractional_bits = fractional_bits;
- _data_type = data_type;
-
- _target = compute_target(shape_a, shape_b, shape_c, output_shape, alpha, beta, data_type, fractional_bits);
- _reference = compute_reference(shape_a, shape_b, shape_c, output_shape, alpha, beta, data_type, fractional_bits);
- }
-
-protected:
- template <typename U>
- void fill(U &&tensor, int i)
- {
- switch(tensor.data_type())
- {
- case DataType::F16:
- case DataType::F32:
- {
- std::uniform_real_distribution<> distribution(-1.0f, 1.0f);
- library->fill(tensor, distribution, i);
- break;
- }
- default:
- library->fill_tensor_uniform(tensor, i);
- }
- }
-
- TensorType compute_target(const TensorShape &shape_a, const TensorShape &shape_b, const TensorShape &shape_c, const TensorShape &output_shape, float alpha, float beta,
- DataType data_type, int fixed_point_position)
- {
- // Create tensors
- TensorType a = create_tensor<TensorType>(shape_a, data_type, 1, fixed_point_position);
- TensorType b = create_tensor<TensorType>(shape_b, data_type, 1, fixed_point_position);
- TensorType c = create_tensor<TensorType>(shape_c, data_type, 1, fixed_point_position);
- TensorType dst = create_tensor<TensorType>(output_shape, data_type, 1, fixed_point_position);
-
- // Create and configure function
- FunctionType gemm;
- gemm.configure(&a, &b, &c, &dst, alpha, beta);
-
- ARM_COMPUTE_EXPECT(a.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(b.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(c.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Allocate tensors
- a.allocator()->allocate();
- b.allocator()->allocate();
- c.allocator()->allocate();
- dst.allocator()->allocate();
-
- ARM_COMPUTE_EXPECT(!a.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(!b.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(!c.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(!dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Fill tensors
- fill(AccessorType(a), 0);
- fill(AccessorType(b), 1);
- fill(AccessorType(c), 2);
-
- // Compute GEMM function
- gemm.run();
-
- return dst;
- }
-
- SimpleTensor<T> compute_reference(const TensorShape &shape_a, const TensorShape &shape_b, const TensorShape &shape_c, const TensorShape &output_shape, float alpha, float beta,
- DataType data_type, int fixed_point_position)
- {
- // Create reference
- SimpleTensor<T> a{ shape_a, data_type, 1, fixed_point_position };
- SimpleTensor<T> b{ shape_b, data_type, 1, fixed_point_position };
- SimpleTensor<T> c{ shape_c, data_type, 1, fixed_point_position };
-
- // Fill reference
- fill(a, 0);
- fill(b, 1);
- fill(c, 2);
-
- return reference::gemm<T>(a, b, c, alpha, beta);
- }
-
- TensorType _target{};
- SimpleTensor<T> _reference{};
- int _fractional_bits{};
- DataType _data_type{};
-};
-
-template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
-class GEMMValidationFixture : public GEMMValidationFixedPointFixture<TensorType, AccessorType, FunctionType, T>
-{
-public:
- template <typename...>
- void setup(TensorShape shape_a, TensorShape shape_b, TensorShape shape_c, TensorShape output_shape, float alpha, float beta, DataType data_type)
- {
- GEMMValidationFixedPointFixture<TensorType, AccessorType, FunctionType, T>::setup(shape_a, shape_b, shape_c, output_shape, alpha, beta, data_type, 0);
- }
-};
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* ARM_COMPUTE_TEST_GEMM_FIXTURE */
diff --git a/tests/validation_new/fixtures/L2NormalizeFixture.h b/tests/validation_new/fixtures/L2NormalizeFixture.h
deleted file mode 100644
index 5102b93f51..0000000000
--- a/tests/validation_new/fixtures/L2NormalizeFixture.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * 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_L2NORMALIZE_FIXTURE
-#define ARM_COMPUTE_TEST_L2NORMALIZE_FIXTURE
-
-#include "arm_compute/core/TensorShape.h"
-#include "arm_compute/core/Types.h"
-#include "arm_compute/runtime/Tensor.h"
-#include "framework/Asserts.h"
-#include "framework/Fixture.h"
-#include "tests/AssetsLibrary.h"
-#include "tests/Globals.h"
-#include "tests/IAccessor.h"
-#include "tests/validation_new/CPP/L2Normalize.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
-class L2NormalizeValidationFixture : public framework::Fixture
-{
-public:
- template <typename...>
- void setup(TensorShape shape, DataType data_type, unsigned int axis, float epsilon)
- {
- _target = compute_target(shape, data_type, axis, epsilon);
- _reference = compute_reference(shape, data_type, axis, epsilon);
- }
-
-protected:
- template <typename U>
- void fill(U &&tensor)
- {
- library->fill_tensor_uniform(tensor, 0);
- }
-
- TensorType compute_target(const TensorShape &shape, DataType data_type, unsigned int axis, float epsilon)
- {
- // Create tensors
- TensorType src = create_tensor<TensorType>(shape, data_type);
- TensorType dst = create_tensor<TensorType>(shape, data_type);
-
- // Create and configure function
- FunctionType l2_norm_func;
- l2_norm_func.configure(&src, &dst, axis, epsilon);
-
- ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Allocate tensors
- src.allocator()->allocate();
- dst.allocator()->allocate();
-
- ARM_COMPUTE_EXPECT(!src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(!dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Fill tensors
- fill(AccessorType(src));
-
- // Compute function
- l2_norm_func.run();
-
- return dst;
- }
-
- SimpleTensor<T> compute_reference(const TensorShape &shape, DataType data_type, unsigned int axis, float epsilon)
- {
- // Create reference
- SimpleTensor<T> src{ shape, data_type };
-
- // Fill reference
- fill(src);
-
- return reference::l2_normalize<T>(src, axis, epsilon);
- }
-
- TensorType _target{};
- SimpleTensor<T> _reference{};
-};
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* ARM_COMPUTE_TEST_L2NORMALIZE_FIXTURE */
diff --git a/tests/validation_new/fixtures/MeanStdDevFixture.h b/tests/validation_new/fixtures/MeanStdDevFixture.h
deleted file mode 100644
index 65622fca07..0000000000
--- a/tests/validation_new/fixtures/MeanStdDevFixture.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * 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_MEAN_STD_DEV_FIXTURE
-#define ARM_COMPUTE_TEST_MEAN_STD_DEV_FIXTURE
-
-#include "framework/Asserts.h"
-#include "framework/Fixture.h"
-#include "tests/Globals.h"
-#include "tests/validation_new/CPP/MeanStdDev.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
-class MeanStdDevValidationFixture : public framework::Fixture
-{
-public:
- template <typename...>
- void setup(TensorShape shape, DataType data_type)
- {
- _target = compute_target(shape, data_type);
- _reference = compute_reference(shape, data_type);
- }
-
-protected:
- template <typename U>
- void fill(U &&tensor)
- {
- library->fill_tensor_uniform(tensor, 0);
- }
-
- std::pair<float, float> compute_target(const TensorShape &shape, DataType data_type)
- {
- // Create tensors
- TensorType src = create_tensor<TensorType>(shape, data_type);
-
- // Create output variables
- float mean = 0.0f;
- float std_dev = 0.0f;
-
- // Create and configure function
- FunctionType mean_std_dev;
- mean_std_dev.configure(&src, &mean, &std_dev);
-
- ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Allocate tensors
- src.allocator()->allocate();
- ARM_COMPUTE_EXPECT(!src.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Fill tensors
- fill(AccessorType(src));
-
- // Compute function
- mean_std_dev.run();
-
- return std::make_pair(mean, std_dev);
- }
-
- std::pair<float, float> compute_reference(const TensorShape &shape, DataType data_type)
- {
- // Create reference
- SimpleTensor<T> src{ shape, data_type };
-
- // Fill reference
- fill(src);
-
- // Compute reference
- return reference::mean_and_standard_deviation<T>(src);
- }
-
- std::pair<float, float> _target{};
- std::pair<float, float> _reference{};
-};
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* ARM_COMPUTE_TEST_MEAN_STD_DEV_FIXTURE */
diff --git a/tests/validation_new/fixtures/NormalizationLayerFixture.h b/tests/validation_new/fixtures/NormalizationLayerFixture.h
deleted file mode 100644
index 044405473b..0000000000
--- a/tests/validation_new/fixtures/NormalizationLayerFixture.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * 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_NORMALIZATION_LAYER_FIXTURE
-#define ARM_COMPUTE_TEST_NORMALIZATION_LAYER_FIXTURE
-
-#include "arm_compute/core/TensorShape.h"
-#include "arm_compute/core/Types.h"
-#include "arm_compute/runtime/Tensor.h"
-#include "framework/Asserts.h"
-#include "framework/Fixture.h"
-#include "tests/AssetsLibrary.h"
-#include "tests/Globals.h"
-#include "tests/IAccessor.h"
-#include "tests/validation_new/CPP/NormalizationLayer.h"
-
-#include <random>
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
-class NormalizationValidationFixedPointFixture : public framework::Fixture
-{
-public:
- template <typename...>
- void setup(TensorShape shape, NormType norm_type, int norm_size, float beta, DataType data_type, int fractional_bits)
- {
- _fractional_bits = fractional_bits;
- NormalizationLayerInfo info(norm_type, norm_size, 5, beta);
-
- _target = compute_target(shape, info, data_type, fractional_bits);
- _reference = compute_reference(shape, info, data_type, fractional_bits);
- }
-
-protected:
- template <typename U>
- void fill(U &&tensor)
- {
- if(_fractional_bits == 0)
- {
- library->fill_tensor_uniform(tensor, 0);
- }
- else
- {
- const int one_fixed = 1 << _fractional_bits;
- std::uniform_int_distribution<> distribution(-one_fixed, one_fixed);
- library->fill(tensor, distribution, 0);
- }
- }
-
- TensorType compute_target(const TensorShape &shape, NormalizationLayerInfo info, DataType data_type, int fixed_point_position = 0)
- {
- // Create tensors
- TensorType src = create_tensor<TensorType>(shape, data_type, 1, fixed_point_position);
- TensorType dst = create_tensor<TensorType>(shape, data_type, 1, fixed_point_position);
-
- // Create and configure function
- FunctionType norm_layer;
- norm_layer.configure(&src, &dst, info);
-
- ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Allocate tensors
- src.allocator()->allocate();
- dst.allocator()->allocate();
-
- ARM_COMPUTE_EXPECT(!src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(!dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Fill tensors
- fill(AccessorType(src));
-
- // Compute function
- norm_layer.run();
-
- return dst;
- }
-
- SimpleTensor<T> compute_reference(const TensorShape &shape, NormalizationLayerInfo info, DataType data_type, int fixed_point_position = 0)
- {
- // Create reference
- SimpleTensor<T> src{ shape, data_type, 1, fixed_point_position };
-
- // Fill reference
- fill(src);
-
- return reference::normalization_layer<T>(src, info);
- }
-
- TensorType _target{};
- SimpleTensor<T> _reference{};
- int _fractional_bits{};
-};
-
-template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
-class NormalizationValidationFixture : public NormalizationValidationFixedPointFixture<TensorType, AccessorType, FunctionType, T>
-{
-public:
- template <typename...>
- void setup(TensorShape shape, NormType norm_type, int norm_size, float beta, DataType data_type)
- {
- NormalizationValidationFixedPointFixture<TensorType, AccessorType, FunctionType, T>::setup(shape, norm_type, norm_size, beta, data_type, 0);
- }
-};
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* ARM_COMPUTE_TEST_NORMALIZATION_LAYER_FIXTURE */
diff --git a/tests/validation_new/fixtures/PoolingLayerFixture.h b/tests/validation_new/fixtures/PoolingLayerFixture.h
deleted file mode 100644
index c0c818f3a0..0000000000
--- a/tests/validation_new/fixtures/PoolingLayerFixture.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * 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_POOLING_LAYER_FIXTURE
-#define ARM_COMPUTE_TEST_POOLING_LAYER_FIXTURE
-
-#include "arm_compute/core/TensorShape.h"
-#include "arm_compute/core/Types.h"
-#include "arm_compute/runtime/Tensor.h"
-#include "framework/Asserts.h"
-#include "framework/Fixture.h"
-#include "tests/AssetsLibrary.h"
-#include "tests/Globals.h"
-#include "tests/IAccessor.h"
-#include "tests/validation_new/CPP/PoolingLayer.h"
-
-#include <random>
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
-class PoolingLayerValidationFixedPointFixture : public framework::Fixture
-{
-public:
- template <typename...>
- void setup(TensorShape shape, PoolingType pool_type, int pool_size, PadStrideInfo pad_stride_info, DataType data_type, int fractional_bits)
- {
- _fractional_bits = fractional_bits;
- PoolingLayerInfo info(pool_type, pool_size, pad_stride_info);
-
- _target = compute_target(shape, info, data_type, fractional_bits);
- _reference = compute_reference(shape, info, data_type, fractional_bits);
- }
-
-protected:
- template <typename U>
- void fill(U &&tensor)
- {
- if(_fractional_bits == 0)
- {
- std::uniform_real_distribution<> distribution(-1.f, 1.f);
- library->fill(tensor, distribution, 0);
- }
- else
- {
- const int one_fixed = 1 << _fractional_bits;
- std::uniform_int_distribution<> distribution(-one_fixed, one_fixed);
- library->fill(tensor, distribution, 0);
- }
- }
-
- TensorType compute_target(const TensorShape &shape, PoolingLayerInfo info, DataType data_type, int fixed_point_position = 0)
- {
- // Create tensors
- TensorType src = create_tensor<TensorType>(shape, data_type, 1, fixed_point_position);
- TensorType dst;
-
- // Create and configure function
- FunctionType pool_layer;
- pool_layer.configure(&src, &dst, info);
-
- ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Allocate tensors
- src.allocator()->allocate();
- dst.allocator()->allocate();
-
- ARM_COMPUTE_EXPECT(!src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(!dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Fill tensors
- fill(AccessorType(src));
-
- // Compute function
- pool_layer.run();
-
- return dst;
- }
-
- SimpleTensor<T> compute_reference(const TensorShape &shape, PoolingLayerInfo info, DataType data_type, int fixed_point_position = 0)
- {
- // Create reference
- SimpleTensor<T> src{ shape, data_type, 1, fixed_point_position };
-
- // Fill reference
- fill(src);
-
- return reference::pooling_layer<T>(src, info);
- }
-
- TensorType _target{};
- SimpleTensor<T> _reference{};
- int _fractional_bits{};
-};
-
-template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
-class PoolingLayerValidationFixture : public PoolingLayerValidationFixedPointFixture<TensorType, AccessorType, FunctionType, T>
-{
-public:
- template <typename...>
- void setup(TensorShape shape, PoolingType pool_type, int pool_size, PadStrideInfo pad_stride_info, DataType data_type)
- {
- PoolingLayerValidationFixedPointFixture<TensorType, AccessorType, FunctionType, T>::setup(shape, pool_type, pool_size, pad_stride_info, data_type, 0);
- }
-};
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* ARM_COMPUTE_TEST_POOLING_LAYER_FIXTURE */
diff --git a/tests/validation_new/fixtures/QuantizationLayerFixture.h b/tests/validation_new/fixtures/QuantizationLayerFixture.h
deleted file mode 100644
index 469fd5f231..0000000000
--- a/tests/validation_new/fixtures/QuantizationLayerFixture.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * 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_QUANTIZATION_LAYER_FIXTURE
-#define ARM_COMPUTE_TEST_QUANTIZATION_LAYER_FIXTURE
-
-#include "arm_compute/core/TensorShape.h"
-#include "arm_compute/core/Types.h"
-#include "arm_compute/runtime/Tensor.h"
-#include "framework/Asserts.h"
-#include "framework/Fixture.h"
-#include "tests/AssetsLibrary.h"
-#include "tests/Globals.h"
-#include "tests/IAccessor.h"
-#include "tests/validation_new/CPP/QuantizationLayer.h"
-
-#include <random>
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
-class QuantizationValidationFixedPointFixture : public framework::Fixture
-{
-public:
- template <typename...>
- void setup(TensorShape shape, DataType data_type)
- {
- _target = compute_target(shape, data_type);
- _reference = compute_reference(shape, data_type);
- }
-
-protected:
- template <typename U>
- void fill(U &&tensor)
- {
- library->fill_tensor_uniform(tensor, 0);
- }
-
- TensorType compute_target(const TensorShape &shape, DataType data_type)
- {
- // Create tensors
- TensorType src = create_tensor<TensorType>(shape, data_type);
- TensorType dst = create_tensor<TensorType>(shape, DataType::U8);
-
- // Create and configure function
- FunctionType quantization_layer;
- quantization_layer.configure(&src, &dst);
-
- ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Allocate tensors
- src.allocator()->allocate();
- dst.allocator()->allocate();
-
- ARM_COMPUTE_EXPECT(!src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(!dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Fill tensors
- fill(AccessorType(src));
-
- // Compute function
- quantization_layer.run();
-
- return dst;
- }
-
- SimpleTensor<uint8_t> compute_reference(const TensorShape &shape, DataType data_type)
- {
- // Create reference
- SimpleTensor<T> src{ shape, data_type };
-
- // Fill reference
- fill(src);
-
- return reference::quantization_layer<T>(src);
- }
-
- TensorType _target{};
- SimpleTensor<uint8_t> _reference{};
-};
-
-template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
-class QuantizationValidationFixture : public QuantizationValidationFixedPointFixture<TensorType, AccessorType, FunctionType, T>
-{
-public:
- template <typename...>
- void setup(TensorShape shape, DataType data_type)
- {
- QuantizationValidationFixedPointFixture<TensorType, AccessorType, FunctionType, T>::setup(shape, data_type);
- }
-};
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* ARM_COMPUTE_TEST_QUANTIZATION_LAYER_FIXTURE */
diff --git a/tests/validation_new/fixtures/ReductionOperationFixture.h b/tests/validation_new/fixtures/ReductionOperationFixture.h
deleted file mode 100644
index 416aadf8d7..0000000000
--- a/tests/validation_new/fixtures/ReductionOperationFixture.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * 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_REDUCTION_OPERATION_FIXTURE
-#define ARM_COMPUTE_TEST_REDUCTION_OPERATION_FIXTURE
-
-#include "arm_compute/core/TensorShape.h"
-#include "arm_compute/core/Types.h"
-#include "arm_compute/runtime/Tensor.h"
-#include "framework/Asserts.h"
-#include "framework/Fixture.h"
-#include "tests/AssetsLibrary.h"
-#include "tests/Globals.h"
-#include "tests/IAccessor.h"
-#include "tests/validation_new/CPP/ReductionOperation.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
-class ReductionOperationValidationFixture : public framework::Fixture
-{
-public:
- template <typename...>
- void setup(TensorShape shape, DataType data_type, unsigned int axis, ReductionOperation op)
- {
- const TensorShape output_shape = get_output_shape(shape, axis);
- _target = compute_target(shape, output_shape, data_type, axis, op);
- _reference = compute_reference(shape, output_shape, data_type, axis, op);
- }
-
-protected:
- template <typename U>
- void fill(U &&tensor)
- {
- library->fill_tensor_uniform(tensor, 0);
- }
-
- TensorType compute_target(const TensorShape &src_shape, const TensorShape &dst_shape, DataType data_type, unsigned int axis, ReductionOperation op)
- {
- // Create tensors
- TensorType src = create_tensor<TensorType>(src_shape, data_type);
- TensorType dst = create_tensor<TensorType>(dst_shape, data_type);
-
- // Create and configure function
- FunctionType reduction_func;
- reduction_func.configure(&src, &dst, axis, op);
-
- ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Allocate tensors
- src.allocator()->allocate();
- dst.allocator()->allocate();
-
- ARM_COMPUTE_EXPECT(!src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(!dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Fill tensors
- fill(AccessorType(src));
-
- // Compute function
- reduction_func.run();
-
- return dst;
- }
-
- SimpleTensor<T> compute_reference(const TensorShape &src_shape, const TensorShape &dst_shape, DataType data_type, unsigned int axis, ReductionOperation op)
- {
- // Create reference
- SimpleTensor<T> src{ src_shape, data_type };
-
- // Fill reference
- fill(src);
-
- return reference::reduction_operation<T>(src, dst_shape, axis, op);
- }
-
- TensorType _target{};
- SimpleTensor<T> _reference{};
-
-private:
- TensorShape get_output_shape(TensorShape shape, unsigned int axis)
- {
- TensorShape output_shape(shape);
- output_shape.set(axis, 1);
- return output_shape;
- }
-};
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* ARM_COMPUTE_TEST_REDUCTION_OPERATION_FIXTURE */
diff --git a/tests/validation_new/fixtures/ScaleFixture.h b/tests/validation_new/fixtures/ScaleFixture.h
deleted file mode 100644
index 74dc0d6816..0000000000
--- a/tests/validation_new/fixtures/ScaleFixture.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * 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_SCALE_FIXTURE
-#define ARM_COMPUTE_TEST_SCALE_FIXTURE
-
-#include "arm_compute/core/TensorShape.h"
-#include "arm_compute/core/Types.h"
-#include "framework/Asserts.h"
-#include "framework/Fixture.h"
-#include "tests/AssetsLibrary.h"
-#include "tests/Globals.h"
-#include "tests/IAccessor.h"
-#include "tests/validation_new/CPP/Scale.h"
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
-class ScaleValidationFixture : public framework::Fixture
-{
-public:
- template <typename...>
- void setup(TensorShape shape, DataType data_type, InterpolationPolicy policy, BorderMode border_mode)
- {
- _shape = shape;
- _policy = policy;
- _border_mode = border_mode;
- _data_type = data_type;
-
- std::mt19937 generator(library->seed());
- std::uniform_real_distribution<float> distribution_float(0.25, 4);
- const float scale_x = distribution_float(generator);
- const float scale_y = distribution_float(generator);
- std::uniform_int_distribution<uint8_t> distribution_u8(0, 255);
- uint8_t constant_border_value = distribution_u8(generator);
-
- _target = compute_target(shape, scale_x, scale_y, policy, border_mode, constant_border_value);
- _reference = compute_reference(shape, scale_x, scale_y, policy, border_mode, constant_border_value);
- }
-
-protected:
- template <typename U>
- void fill(U &&tensor)
- {
- library->fill_tensor_uniform(tensor, 0);
- }
-
- TensorType compute_target(const TensorShape &shape, const float scale_x, const float scale_y,
- InterpolationPolicy policy, BorderMode border_mode, uint8_t constant_border_value)
- {
- // Create tensors
- TensorType src = create_tensor<TensorType>(shape, _data_type);
- TensorShape shape_scaled(shape);
- shape_scaled.set(0, shape[0] * scale_x);
- shape_scaled.set(1, shape[1] * scale_y);
- TensorType dst = create_tensor<TensorType>(shape_scaled, _data_type);
-
- // Create and configure function
- FunctionType scale;
-
- scale.configure(&src, &dst, policy, border_mode, constant_border_value);
-
- ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Allocate tensors
- src.allocator()->allocate();
- dst.allocator()->allocate();
- ARM_COMPUTE_EXPECT(!src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(!dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Fill tensors
- fill(AccessorType(src));
-
- // Compute function
- scale.run();
-
- return dst;
- }
-
- SimpleTensor<T> compute_reference(const TensorShape &shape, const float scale_x, const float scale_y,
- InterpolationPolicy policy, BorderMode border_mode, uint8_t constant_border_value)
- {
- // Create reference
- SimpleTensor<T> src{ shape, _data_type };
-
- // Fill reference
- fill(src);
-
- return reference::scale<T>(src, scale_x, scale_y, policy, border_mode, constant_border_value);
- }
-
- TensorType _target{};
- SimpleTensor<T> _reference{};
- TensorShape _shape{};
- InterpolationPolicy _policy{};
- BorderMode _border_mode{};
- DataType _data_type{};
-};
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* ARM_COMPUTE_TEST_SCALE_FIXTURE */ \ No newline at end of file
diff --git a/tests/validation_new/fixtures/SoftmaxLayerFixture.h b/tests/validation_new/fixtures/SoftmaxLayerFixture.h
deleted file mode 100644
index c6f3d2216f..0000000000
--- a/tests/validation_new/fixtures/SoftmaxLayerFixture.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * 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_SOFTMAX_LAYER_FIXTURE
-#define ARM_COMPUTE_TEST_SOFTMAX_LAYER_FIXTURE
-
-#include "arm_compute/core/TensorShape.h"
-#include "arm_compute/core/Types.h"
-#include "arm_compute/runtime/Tensor.h"
-#include "framework/Asserts.h"
-#include "framework/Fixture.h"
-#include "tests/AssetsLibrary.h"
-#include "tests/Globals.h"
-#include "tests/IAccessor.h"
-#include "tests/validation_new/CPP/SoftmaxLayer.h"
-
-#include <random>
-
-namespace arm_compute
-{
-namespace test
-{
-namespace validation
-{
-template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
-class SoftmaxValidationFixedPointFixture : public framework::Fixture
-{
-public:
- template <typename...>
- void setup(TensorShape shape, DataType data_type, int fractional_bits)
- {
- _fractional_bits = fractional_bits;
-
- _target = compute_target(shape, data_type, fractional_bits);
- _reference = compute_reference(shape, data_type, fractional_bits);
- }
-
-protected:
- template <typename U>
- void fill(U &&tensor)
- {
- if(_fractional_bits == 0)
- {
- std::uniform_real_distribution<> distribution(-1000.f, 1000.f);
- library->fill(tensor, distribution, 0);
- }
- else
- {
- const int one_fixed = 1 << _fractional_bits;
- std::uniform_int_distribution<> distribution(-one_fixed, one_fixed);
- library->fill(tensor, distribution, 0);
- }
- }
-
- TensorType compute_target(const TensorShape &shape, DataType data_type, int fixed_point_position = 0)
- {
- // Create tensors
- TensorType src = create_tensor<TensorType>(shape, data_type, 1, fixed_point_position);
- TensorType dst = create_tensor<TensorType>(shape, data_type, 1, fixed_point_position);
-
- // Create and configure function
- FunctionType smx_layer;
- smx_layer.configure(&src, &dst);
-
- ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Allocate tensors
- src.allocator()->allocate();
- dst.allocator()->allocate();
-
- ARM_COMPUTE_EXPECT(!src.info()->is_resizable(), framework::LogLevel::ERRORS);
- ARM_COMPUTE_EXPECT(!dst.info()->is_resizable(), framework::LogLevel::ERRORS);
-
- // Fill tensors
- fill(AccessorType(src));
-
- // Compute function
- smx_layer.run();
-
- return dst;
- }
-
- SimpleTensor<T> compute_reference(const TensorShape &shape, DataType data_type, int fixed_point_position = 0)
- {
- // Create reference
- SimpleTensor<T> src{ shape, data_type, 1, fixed_point_position };
-
- // Fill reference
- fill(src);
-
- return reference::softmax_layer<T>(src);
- }
-
- TensorType _target{};
- SimpleTensor<T> _reference{};
- int _fractional_bits{};
-};
-
-template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
-class SoftmaxValidationFixture : public SoftmaxValidationFixedPointFixture<TensorType, AccessorType, FunctionType, T>
-{
-public:
- template <typename...>
- void setup(TensorShape shape, DataType data_type)
- {
- SoftmaxValidationFixedPointFixture<TensorType, AccessorType, FunctionType, T>::setup(shape, data_type, 0);
- }
-};
-} // namespace validation
-} // namespace test
-} // namespace arm_compute
-#endif /* ARM_COMPUTE_TEST_SOFTMAX_LAYER_FIXTURE */
diff --git a/tests/validation_new/half.h b/tests/validation_new/half.h
deleted file mode 100644
index 0ca620cf57..0000000000
--- a/tests/validation_new/half.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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_HALF_H__
-#define __ARM_COMPUTE_TEST_HALF_H__
-
-#ifdef __ANDROID__
-// Android toolchain is broken and doesn't support all CPP11 math functions.
-#define HALF_ENABLE_CPP11_CMATH 0
-#endif /* __ANDROID__ */
-
-// Set style to round to nearest
-#define HALF_ROUND_STYLE 1
-#define HALF_ROUND_TIES_TO_EVEN 1
-
-#include "half/half.hpp"
-
-#endif /* __ARM_COMPUTE_TEST_HALF_H__ */