diff options
Diffstat (limited to 'tests/validation/CL')
66 files changed, 72 insertions, 3293 deletions
diff --git a/tests/validation/CL/AbsoluteDifference.cpp b/tests/validation/CL/AbsoluteDifference.cpp index b2f0280fdc..8d7d2fd3ce 100644 --- a/tests/validation/CL/AbsoluteDifference.cpp +++ b/tests/validation/CL/AbsoluteDifference.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -57,29 +57,6 @@ template <typename T> using CLAbsoluteDifferenceFixture = AbsoluteDifferenceValidationFixture<CLTensor, CLAccessor, CLAbsoluteDifference, T>; TEST_SUITE(U8) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), AbsoluteDifferenceU8Dataset), - shape, data_type0, data_type1, output_data_type) -{ - // Create tensors - CLTensor ref_src1 = create_tensor<CLTensor>(shape, data_type0); - CLTensor ref_src2 = create_tensor<CLTensor>(shape, data_type1); - CLTensor dst = create_tensor<CLTensor>(shape, output_data_type); - - // Create and Configure function - CLAbsoluteDifference abs_diff; - abs_diff.configure(&ref_src1, &ref_src2, &dst); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), 16).required_padding(); - validate(ref_src1.info()->padding(), padding); - validate(ref_src2.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLAbsoluteDifferenceFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), AbsoluteDifferenceU8Dataset)) { // Validate output @@ -93,29 +70,6 @@ FIXTURE_DATA_TEST_CASE(RunLarge, CLAbsoluteDifferenceFixture<uint8_t>, framework TEST_SUITE_END() // U8 TEST_SUITE(S16) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), AbsoluteDifferenceS16Dataset), - shape, data_type0, data_type1, output_data_type) -{ - // Create tensors - CLTensor ref_src1 = create_tensor<CLTensor>(shape, data_type0); - CLTensor ref_src2 = create_tensor<CLTensor>(shape, data_type1); - CLTensor dst = create_tensor<CLTensor>(shape, output_data_type); - - // Create and Configure function - CLAbsoluteDifference abs_diff; - abs_diff.configure(&ref_src1, &ref_src2, &dst); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), 16).required_padding(); - validate(ref_src1.info()->padding(), padding); - validate(ref_src2.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLAbsoluteDifferenceFixture<int16_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), AbsoluteDifferenceS16Dataset)) { // Validate output diff --git a/tests/validation/CL/Accumulate.cpp b/tests/validation/CL/Accumulate.cpp index ee2d2521cb..3e0175ea78 100644 --- a/tests/validation/CL/Accumulate.cpp +++ b/tests/validation/CL/Accumulate.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -53,27 +53,6 @@ TEST_SUITE(CL) TEST_SUITE(Accumulate) TEST_SUITE(U8) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), AccumulateS16Dataset), - shape, data_type, output_data_type) -{ - // Create tensors - CLTensor ref_src = create_tensor<CLTensor>(shape, data_type); - CLTensor dst = create_tensor<CLTensor>(shape, output_data_type); - - // Create and Configure function - CLAccumulate accum; - accum.configure(&ref_src, &dst); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), 16).required_padding(); - validate(ref_src.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - template <typename T1> using CLAccumulateFixture = AccumulateValidationFixture<CLTensor, CLAccessor, CLAccumulate, T1, int16_t>; @@ -94,32 +73,6 @@ TEST_SUITE_END() TEST_SUITE(AccumulateWeighted) TEST_SUITE(U8) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), AccumulateU8Dataset), - shape, data_type, output_data_type) -{ - // Generate a random alpha value - std::mt19937 gen(library->seed()); - std::uniform_real_distribution<> float_dist(0, 1); - const float alpha = float_dist(gen); - - // Create tensors - CLTensor ref_src = create_tensor<CLTensor>(shape, data_type); - CLTensor dst = create_tensor<CLTensor>(shape, output_data_type); - - // Create and Configure function - CLAccumulateWeighted accum_weight; - accum_weight.configure(&ref_src, alpha, &dst); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), 16).required_padding(); - validate(ref_src.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - template <typename T1> using CLAccumulateWeightedFixture = AccumulateWeightedValidationFixture<CLTensor, CLAccessor, CLAccumulateWeighted, T1, uint8_t>; @@ -140,32 +93,6 @@ TEST_SUITE_END() TEST_SUITE(AccumulateSquared) TEST_SUITE(U8) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), AccumulateS16Dataset), - shape, data_type, output_data_type) -{ - // Generate a random shift value - std::mt19937 gen(library->seed()); - std::uniform_int_distribution<uint32_t> int_dist(0, 15); - const uint32_t shift = int_dist(gen); - - // Create tensors - CLTensor ref_src = create_tensor<CLTensor>(shape, data_type); - CLTensor dst = create_tensor<CLTensor>(shape, output_data_type); - - // Create and Configure function - CLAccumulateSquared accum_square; - accum_square.configure(&ref_src, shift, &dst); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), 16).required_padding(); - validate(ref_src.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - template <typename T1> using CLAccumulateSquaredFixture = AccumulateSquaredValidationFixture<CLTensor, CLAccessor, CLAccumulateSquared, T1, int16_t>; diff --git a/tests/validation/CL/ActivationLayer.cpp b/tests/validation/CL/ActivationLayer.cpp index 1fef384a8e..c1844674ac 100644 --- a/tests/validation/CL/ActivationLayer.cpp +++ b/tests/validation/CL/ActivationLayer.cpp @@ -93,52 +93,6 @@ const auto ActivationDataset = combine(combine(framework::dataset::make("InPlace TEST_SUITE(CL) TEST_SUITE(ActivationLayer) - -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(datasets::SmallShapes(), CNNDataTypes), framework::dataset::make("InPlace", { false, true })), - shape, data_type, in_place) -{ - // Create context - auto ctx = parameters->get_ctx<CLTensor>(); - - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, data_type, 1, QuantizationInfo(), DataLayout::NCHW, ctx); - CLTensor dst = create_tensor<CLTensor>(shape, data_type, 1, QuantizationInfo(), DataLayout::NCHW, ctx); - - 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(ctx); - - 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); - } -} - // *INDENT-OFF* // clang-format off DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip( diff --git a/tests/validation/CL/ArithmeticDivision.cpp b/tests/validation/CL/ArithmeticDivision.cpp index 82a0ec5b6a..0676964348 100644 --- a/tests/validation/CL/ArithmeticDivision.cpp +++ b/tests/validation/CL/ArithmeticDivision.cpp @@ -113,29 +113,6 @@ FIXTURE_DATA_TEST_CASE(RunWithActivation, CLArithmeticDivisionFloatFixture<half> TEST_SUITE_END() TEST_SUITE(FP32) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, datasets::SmallShapes(), - shape) -{ - // Create tensors - CLTensor ref_src1 = create_tensor<CLTensor>(shape, DataType::F32); - CLTensor ref_src2 = create_tensor<CLTensor>(shape, DataType::F32); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::F32); - - // Create and Configure function - CLArithmeticDivision add; - add.configure(&ref_src1, &ref_src2, &dst); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), num_elems_processed_per_iteration).required_padding(); - validate(ref_src1.info()->padding(), padding); - validate(ref_src2.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLArithmeticDivisionFloatFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallShapes(), ArithmeticDivisionFP32Dataset), EmptyActivationFunctionsDataset)) { diff --git a/tests/validation/CL/ArithmeticSubtraction.cpp b/tests/validation/CL/ArithmeticSubtraction.cpp index 52d787febb..6be5962d52 100644 --- a/tests/validation/CL/ArithmeticSubtraction.cpp +++ b/tests/validation/CL/ArithmeticSubtraction.cpp @@ -163,32 +163,9 @@ using CLArithmeticSubtractionFixture = ArithmeticSubtractionValidationFixture<CL TEST_SUITE(Integer) TEST_SUITE(U8) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), - shape, policy) -{ - // Create tensors - CLTensor ref_src1 = create_tensor<CLTensor>(shape, DataType::U8); - CLTensor ref_src2 = create_tensor<CLTensor>(shape, DataType::U8); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::U8); - - // Create and Configure function - CLArithmeticSubtraction add; - add.configure(&ref_src1, &ref_src2, &dst, policy); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), num_elems_processed_per_iteration).required_padding(); - validate(ref_src1.info()->padding(), padding); - validate(ref_src2.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - -FIXTURE_DATA_TEST_CASE(RunSmall, CLArithmeticSubtractionFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallShapes(), ArithmeticSubtractionU8Dataset), - framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), - OutOfPlaceDataSet)) +FIXTURE_DATA_TEST_CASE(RunSmall, CLArithmeticSubtractionFixture<uint8_t>, framework::DatasetMode::ALL, combine(combine(combine(datasets::SmallShapes(), ArithmeticSubtractionU8Dataset), + framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), + OutOfPlaceDataSet)) { // Validate output validate(CLAccessor(_target), _reference); @@ -196,30 +173,6 @@ FIXTURE_DATA_TEST_CASE(RunSmall, CLArithmeticSubtractionFixture<uint8_t>, framew TEST_SUITE_END() // U8 TEST_SUITE(S16) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType", { DataType::U8, DataType::S16 })), - framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), - shape, data_type, policy) -{ - // Create tensors - CLTensor ref_src1 = create_tensor<CLTensor>(shape, data_type); - CLTensor ref_src2 = create_tensor<CLTensor>(shape, DataType::S16); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::S16); - - // Create and Configure function - CLArithmeticSubtraction add; - add.configure(&ref_src1, &ref_src2, &dst, policy); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), num_elems_processed_per_iteration).required_padding(); - validate(ref_src1.info()->padding(), padding); - validate(ref_src2.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLArithmeticSubtractionFixture<int16_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallShapes(), ArithmeticSubtractionS16Dataset), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), OutOfPlaceDataSet)) @@ -243,29 +196,6 @@ using CLArithmeticSubtractionQuantizedFixture = ArithmeticSubtractionValidationQ TEST_SUITE(Quantized) TEST_SUITE(QASYMM8) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE })), - shape, policy) -{ - // Create tensors - CLTensor ref_src1 = create_tensor<CLTensor>(shape, DataType::QASYMM8); - CLTensor ref_src2 = create_tensor<CLTensor>(shape, DataType::QASYMM8); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::QASYMM8); - - // Create and Configure function - CLArithmeticSubtraction add; - add.configure(&ref_src1, &ref_src2, &dst, policy); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), num_elems_processed_per_iteration).required_padding(); - validate(ref_src1.info()->padding(), padding); - validate(ref_src2.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLArithmeticSubtractionQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(combine(datasets::SmallShapes(), ArithmeticSubtractionQASYMM8Dataset), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE })), @@ -279,29 +209,6 @@ FIXTURE_DATA_TEST_CASE(RunSmall, CLArithmeticSubtractionQuantizedFixture<uint8_t } TEST_SUITE_END() // QASYMM8 TEST_SUITE(QASYMM8_SIGNED) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE })), - shape, policy) -{ - // Create tensors - CLTensor ref_src1 = create_tensor<CLTensor>(shape, DataType::QASYMM8_SIGNED); - CLTensor ref_src2 = create_tensor<CLTensor>(shape, DataType::QASYMM8_SIGNED); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::QASYMM8_SIGNED); - - // Create and Configure function - CLArithmeticSubtraction sub; - sub.configure(&ref_src1, &ref_src2, &dst, policy); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), num_elems_processed_per_iteration).required_padding(); - validate(ref_src1.info()->padding(), padding); - validate(ref_src2.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLArithmeticSubtractionQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(combine(datasets::SmallShapes(), ArithmeticSubtractionQASYMM8SignedDataset), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE })), @@ -315,29 +222,6 @@ FIXTURE_DATA_TEST_CASE(RunSmall, CLArithmeticSubtractionQuantizedFixture<int8_t> } TEST_SUITE_END() // QASYMM8_SIGNED TEST_SUITE(QSYMM16) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE })), - shape, policy) -{ - // Create tensors - CLTensor ref_src1 = create_tensor<CLTensor>(shape, DataType::QSYMM16); - CLTensor ref_src2 = create_tensor<CLTensor>(shape, DataType::QSYMM16); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::QSYMM16); - - // Create and Configure function - CLArithmeticSubtraction sub; - sub.configure(&ref_src1, &ref_src2, &dst, policy); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), num_elems_processed_per_iteration).required_padding(); - validate(ref_src1.info()->padding(), padding); - validate(ref_src2.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLArithmeticSubtractionQuantizedFixture<int16_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(combine(datasets::SmallShapes(), ArithmeticSubtractionQSYMM16Dataset), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE })), @@ -377,29 +261,6 @@ FIXTURE_DATA_TEST_CASE(RunWithActivation, CLArithmeticSubtractionFloatFixture<ha TEST_SUITE_END() // FP16 TEST_SUITE(FP32) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), - shape, policy) -{ - // Create tensors - CLTensor ref_src1 = create_tensor<CLTensor>(shape, DataType::F32); - CLTensor ref_src2 = create_tensor<CLTensor>(shape, DataType::F32); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::F32); - - // Create and Configure function - CLArithmeticSubtraction add; - add.configure(&ref_src1, &ref_src2, &dst, policy); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), num_elems_processed_per_iteration).required_padding(); - validate(ref_src1.info()->padding(), padding); - validate(ref_src2.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLArithmeticSubtractionFloatFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallShapes(), ArithmeticSubtractionFP32Dataset), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), diff --git a/tests/validation/CL/BatchConcatenateLayer.cpp b/tests/validation/CL/BatchConcatenateLayer.cpp index 6fd189b716..81b6ca109a 100644 --- a/tests/validation/CL/BatchConcatenateLayer.cpp +++ b/tests/validation/CL/BatchConcatenateLayer.cpp @@ -83,27 +83,6 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip( // clang-format on // *INDENT-ON* -TEST_CASE(Configuration, framework::DatasetMode::ALL) -{ - // Create tensors - CLTensor src1 = create_tensor<CLTensor>(TensorShape(128U, 32U, 32U), DataType::F32, 1); - CLTensor src2 = create_tensor<CLTensor>(TensorShape(128U, 32U, 32U), DataType::F32, 1); - CLTensor src3 = create_tensor<CLTensor>(TensorShape(128U, 32U, 32U), DataType::F32, 1); - CLTensor dst; - - ARM_COMPUTE_EXPECT(src1.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(src2.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(src3.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS); - - // Create and configure function - CLConcatenateLayer concat_layer; - std::vector<const ICLTensor *> inputs; - inputs.emplace_back(&src1); - inputs.emplace_back(&src2); - inputs.emplace_back(&src3); - concat_layer.configure(inputs, &dst, 3); -} template <typename T> using CLBatchConcatenateLayerFixture = ConcatenateLayerValidationFixture<CLTensor, ICLTensor, CLAccessor, CLConcatenateLayer, T>; diff --git a/tests/validation/CL/BatchNormalizationLayer.cpp b/tests/validation/CL/BatchNormalizationLayer.cpp index cb17204279..3d1848bd11 100644 --- a/tests/validation/CL/BatchNormalizationLayer.cpp +++ b/tests/validation/CL/BatchNormalizationLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -70,38 +70,6 @@ TEST_SUITE(BatchNormalizationLayer) template <typename T> using CLBatchNormalizationLayerFixture = BatchNormalizationLayerValidationFixture<CLTensor, CLAccessor, CLBatchNormalizationLayer, T>; -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(combine(datasets::SmallRandomBatchNormalizationLayerDataset(), - combine(framework::dataset::make("UseBeta", { false, true }), - framework::dataset::make("UseGamma", { false, true }))), - framework::dataset::make("DataType", { DataType::F16, DataType::F32 })), - framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), - shape0, shape1, epsilon, use_gamma, use_beta, dt, data_layout) -{ - TensorShape src_dst_shapes = shape0; - if(data_layout == DataLayout::NHWC) - { - permute(src_dst_shapes, PermutationVector(2U, 0U, 1U)); - } - - // Create tensors - CLTensor src = create_tensor<CLTensor>(src_dst_shapes, dt, 1, QuantizationInfo(), data_layout); - CLTensor dst = create_tensor<CLTensor>(src_dst_shapes, dt, 1, QuantizationInfo(), data_layout); - CLTensor mean = create_tensor<CLTensor>(shape1, dt, 1); - CLTensor var = create_tensor<CLTensor>(shape1, dt, 1); - CLTensor beta = create_tensor<CLTensor>(shape1, dt, 1); - CLTensor gamma = create_tensor<CLTensor>(shape1, dt, 1); - - // Create and Configure function - CLBatchNormalizationLayer norm; - CLTensor *beta_ptr = use_beta ? &beta : nullptr; - CLTensor *gamma_ptr = use_gamma ? &gamma : nullptr; - norm.configure(&src, &dst, &mean, &var, beta_ptr, gamma_ptr, epsilon); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(src_dst_shapes); - validate(dst.info()->valid_region(), valid_region); -} - // *INDENT-OFF* // clang-format off DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip( diff --git a/tests/validation/CL/BitwiseAnd.cpp b/tests/validation/CL/BitwiseAnd.cpp index 76db5bb627..4fc3d9ca87 100644 --- a/tests/validation/CL/BitwiseAnd.cpp +++ b/tests/validation/CL/BitwiseAnd.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -43,34 +43,6 @@ namespace validation TEST_SUITE(CL) TEST_SUITE(BitwiseAnd) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), 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>; diff --git a/tests/validation/CL/BitwiseNot.cpp b/tests/validation/CL/BitwiseNot.cpp index d3b1c5ddfd..dc884873cc 100644 --- a/tests/validation/CL/BitwiseNot.cpp +++ b/tests/validation/CL/BitwiseNot.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -43,30 +43,6 @@ namespace validation TEST_SUITE(CL) TEST_SUITE(BitwiseNot) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), 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>; diff --git a/tests/validation/CL/BitwiseOr.cpp b/tests/validation/CL/BitwiseOr.cpp index 585170fc31..5a483ad7bf 100644 --- a/tests/validation/CL/BitwiseOr.cpp +++ b/tests/validation/CL/BitwiseOr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -43,34 +43,6 @@ namespace validation TEST_SUITE(CL) TEST_SUITE(BitwiseOr) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), 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>; diff --git a/tests/validation/CL/BitwiseXor.cpp b/tests/validation/CL/BitwiseXor.cpp index bd7ff5ba43..607cdbe574 100644 --- a/tests/validation/CL/BitwiseXor.cpp +++ b/tests/validation/CL/BitwiseXor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -43,34 +43,6 @@ namespace validation TEST_SUITE(CL) TEST_SUITE(BitwiseXor) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), 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>; diff --git a/tests/validation/CL/Box3x3.cpp b/tests/validation/CL/Box3x3.cpp index 8d79189f4c..f4eff823cf 100644 --- a/tests/validation/CL/Box3x3.cpp +++ b/tests/validation/CL/Box3x3.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -50,41 +50,6 @@ constexpr BorderSize border_size(filter_size / 2); /* Border size of the kerne TEST_SUITE(CL) TEST_SUITE(Box3x3) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::U8)), - datasets::BorderModes()), - shape, data_type, border_mode) -{ - // 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 - CLBox3x3 box3x3; - box3x3.configure(&src, &dst, border_mode); - - // Validate valid region - const ValidRegion dst_valid_region = shape_to_valid_region(shape, (border_mode == BorderMode::UNDEFINED), border_size); - validate(dst.info()->valid_region(), dst_valid_region); - - // Validate padding - PaddingCalculator calculator(shape.x(), 8); - calculator.set_border_size(1); - calculator.set_border_mode(border_mode); - - const PaddingSize dst_padding = calculator.required_padding(); - - calculator.set_accessed_elements(16); - calculator.set_access_offset(-1); - - const PaddingSize src_padding = calculator.required_padding(); - - validate(src.info()->padding(), src_padding); - validate(dst.info()->padding(), dst_padding); -} - template <typename T> using CLBox3x3Fixture = Box3x3ValidationFixture<CLTensor, CLAccessor, CLBox3x3, T>; diff --git a/tests/validation/CL/CannyEdge.cpp b/tests/validation/CL/CannyEdge.cpp index f8cf9f0654..84c73c1a8c 100644 --- a/tests/validation/CL/CannyEdge.cpp +++ b/tests/validation/CL/CannyEdge.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -55,51 +55,6 @@ const auto data = combine(framework::dataset::make("GradientSize", { 3, 5, 7 }), TEST_SUITE(CL) TEST_SUITE(CannyEdge) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(datasets::Small2DShapes(), data), framework::dataset::make("Format", Format::U8)), - shape, gradient_size, normalization, border_mode, format) -{ - CannyEdgeParameters params = canny_edge_parameters(); - // Convert normalisation type to integer - const auto norm_type = static_cast<int>(normalization) + 1; - - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, data_type_from_format(format)); - CLTensor dst = create_tensor<CLTensor>(shape, data_type_from_format(format)); - src.info()->set_format(format); - dst.info()->set_format(format); - - ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS); - - // Create Canny edge configure function - CLCannyEdge canny_edge; - canny_edge.configure(&src, &dst, params.upper_thresh, params.lower_thresh, gradient_size, norm_type, border_mode, params.constant_border_value); - - // Validate valid region - validate(src.info()->valid_region(), shape_to_valid_region(shape, (BorderMode::UNDEFINED == border_mode))); - - //TODO(COMPMID-568): dst region validation fails when Shape=7x7 and GradientSize=7 and BorderMode=UNDEFINED (integer underflow) - if(!(shape == TensorShape{ 7u, 7u } && gradient_size == 7 && border_mode == BorderMode::UNDEFINED)) - { - validate(dst.info()->valid_region(), shape_to_valid_region(shape, (BorderMode::UNDEFINED == border_mode), BorderSize(gradient_size / 2 + 1))); - } - - // Validate padding - PaddingCalculator calculator(shape.x(), 1); - calculator.set_border_mode(border_mode); - calculator.set_border_size(1); - const PaddingSize dst_padding = calculator.required_padding(); - - calculator.set_border_size(gradient_size / 2); - calculator.set_access_offset(-gradient_size / 2); - calculator.set_accessed_elements(16); - calculator.set_processed_elements(8); - const PaddingSize src_padding = calculator.required_padding(); - - validate(src.info()->padding(), src_padding); - validate(dst.info()->padding(), dst_padding); -} - template <typename T> using CLCannyEdgeFixture = CannyEdgeValidationFixture<CLTensor, CLAccessor, CLKeyPointArray, CLCannyEdge, T>; diff --git a/tests/validation/CL/Cast.cpp b/tests/validation/CL/Cast.cpp index a283aec226..2ca8b58040 100644 --- a/tests/validation/CL/Cast.cpp +++ b/tests/validation/CL/Cast.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Arm Limited. + * Copyright (c) 2018-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -18,7 +18,7 @@ * 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 + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "arm_compute/core/Types.h" @@ -142,22 +142,6 @@ using CLCastToF32Fixture = CastValidationFixture<CLTensor, CLAccessor, CLCast, T #define CAST_SUITE(NAME, idt, odt, type, dataset, tolerance) \ TEST_SUITE(NAME) \ - DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), datasets::ConvertPolicies()), \ - shape, policy) \ - { \ - CLTensor src = create_tensor<CLTensor>(shape, idt, 1); \ - CLTensor dst = create_tensor<CLTensor>(shape, odt, 1); \ - \ - CLCast cast; \ - cast.configure(&src, &dst, policy); \ - \ - const ValidRegion valid_region = shape_to_valid_region(shape); \ - validate(dst.info()->valid_region(), valid_region); \ - \ - const PaddingSize padding = PaddingCalculator(shape.x(), 16).required_padding(); \ - validate(src.info()->padding(), padding); \ - validate(dst.info()->padding(), padding); \ - } \ FIXTURE_DATA_TEST_CASE(RunSmall, type, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallShapes(), dataset), \ datasets::ConvertPolicies())) \ { \ diff --git a/tests/validation/CL/ChannelShuffle.cpp b/tests/validation/CL/ChannelShuffle.cpp index 8c06e6b6d4..2061570a11 100644 --- a/tests/validation/CL/ChannelShuffle.cpp +++ b/tests/validation/CL/ChannelShuffle.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 Arm Limited. + * Copyright (c) 2018-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -70,22 +70,6 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip( // clang-format on // *INDENT-ON* -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::SmallRandomChannelShuffleLayerDataset(), framework::dataset::make("DataType", { DataType::S8, DataType::U8, DataType::S16, DataType::U16, DataType::U32, DataType::S32, DataType::F16, DataType::F32 })), - shape, num_groups, data_type) -{ - // Create tensors - CLTensor ref_src = create_tensor<CLTensor>(shape, data_type); - CLTensor dst = create_tensor<CLTensor>(shape, data_type); - - // Create and Configure function - CLChannelShuffleLayer channel_shuffle_func; - channel_shuffle_func.configure(&ref_src, &dst, num_groups); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); -} - template <typename T> using CLChannelShuffleLayerFixture = ChannelShuffleLayerValidationFixture<CLTensor, CLAccessor, CLChannelShuffleLayer, T>; diff --git a/tests/validation/CL/ColorConvert.cpp b/tests/validation/CL/ColorConvert.cpp index 37957cd95e..e81875a694 100644 --- a/tests/validation/CL/ColorConvert.cpp +++ b/tests/validation/CL/ColorConvert.cpp @@ -71,61 +71,6 @@ const auto ColorConvert_YUYVDataset_to_NVDataset = combine(YUYVDataset, const auto ColorConvert_NVDataset_to_YUVDataset = combine(framework::dataset::make("FormatType", { Format::NV12, Format::NV21 }), framework::dataset::make("FormatType", { Format::IYUV, Format::YUV444 })); -inline void validate_configuration(const TensorShape &shape, Format src_format, Format dst_format) -{ - const unsigned int src_num_planes = num_planes_from_format(src_format); - const unsigned int dst_num_planes = num_planes_from_format(dst_format); - - TensorShape input = adjust_odd_shape(shape, src_format); - input = adjust_odd_shape(input, src_format); - - // Create tensors - CLMultiImage ref_src = create_multi_image<CLMultiImage>(input, src_format); - CLMultiImage ref_dst = create_multi_image<CLMultiImage>(input, dst_format); - - // Create and Configure function - CLColorConvert color_convert; - - if(1U == src_num_planes) - { - const CLTensor *src_plane = ref_src.cl_plane(0); - - if(1U == dst_num_planes) - { - CLTensor *dst_plane = ref_dst.cl_plane(0); - color_convert.configure(src_plane, dst_plane); - } - else - { - color_convert.configure(src_plane, &ref_dst); - } - } - else - { - if(1U == dst_num_planes) - { - CLTensor *dst_plane = ref_dst.cl_plane(0); - color_convert.configure(&ref_src, dst_plane); - } - else - { - color_convert.configure(&ref_src, &ref_dst); - } - } - - for(unsigned int plane_idx = 0; plane_idx < src_num_planes; ++plane_idx) - { - const CLTensor *src_plane = ref_src.cl_plane(plane_idx); - - ARM_COMPUTE_EXPECT(src_plane->info()->is_resizable(), framework::LogLevel::ERRORS); - } - for(unsigned int plane_idx = 0; plane_idx < dst_num_planes; ++plane_idx) - { - const CLTensor *dst_plane = ref_dst.cl_plane(plane_idx); - - ARM_COMPUTE_EXPECT(dst_plane->info()->is_resizable(), framework::LogLevel::ERRORS); - } -} } // namespace TEST_SUITE(CL) @@ -134,56 +79,6 @@ TEST_SUITE(ColorConvert) template <typename T> using CLColorConvertFixture = ColorConvertValidationFixture<CLMultiImage, CLTensor, CLAccessor, CLColorConvert, T>; -TEST_SUITE(Configuration) -DATA_TEST_CASE(RGBA, framework::DatasetMode::ALL, combine(datasets::Small2DShapes(), ColorConvert_RGBA_to_RGB), - shape, src_format, dst_format) -{ - validate_configuration(shape, src_format, dst_format); -} - -DATA_TEST_CASE(RGB, framework::DatasetMode::ALL, combine(datasets::Small2DShapes(), ColorConvert_RGB_to_RGBA), - shape, src_format, dst_format) -{ - validate_configuration(shape, src_format, dst_format); -} - -DATA_TEST_CASE(RGBtoU8, framework::DatasetMode::ALL, combine(datasets::Small2DShapes(), ColorConvert_RGB_to_U8), - shape, src_format, dst_format) -{ - validate_configuration(shape, src_format, dst_format); -} - -DATA_TEST_CASE(YUV, framework::DatasetMode::ALL, combine(datasets::Small2DShapes(), ColorConvert_YUYV_to_RGBDataset), - shape, src_format, dst_format) -{ - validate_configuration(shape, src_format, dst_format); -} - -DATA_TEST_CASE(YUVPlanar, framework::DatasetMode::ALL, combine(datasets::Small2DShapes(), ColorConvert_YUVPlanar_to_RGBDataset), - shape, src_format, dst_format) -{ - validate_configuration(shape, src_format, dst_format); -} - -DATA_TEST_CASE(NV, framework::DatasetMode::ALL, combine(datasets::Small2DShapes(), ColorConvert_RGBDataset_to_NVDataset), - shape, src_format, dst_format) -{ - validate_configuration(shape, src_format, dst_format); -} - -DATA_TEST_CASE(YUYVtoNV, framework::DatasetMode::ALL, combine(datasets::Small2DShapes(), ColorConvert_YUYVDataset_to_NVDataset), - shape, src_format, dst_format) -{ - validate_configuration(shape, src_format, dst_format); -} - -DATA_TEST_CASE(NVtoYUV, framework::DatasetMode::ALL, combine(datasets::Small2DShapes(), ColorConvert_NVDataset_to_YUVDataset), - shape, src_format, dst_format) -{ - validate_configuration(shape, src_format, dst_format); -} -TEST_SUITE_END() - TEST_SUITE(RGBA) FIXTURE_DATA_TEST_CASE(RunSmall, CLColorConvertFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), ColorConvert_RGBA_to_RGB)) { diff --git a/tests/validation/CL/Comparisons.cpp b/tests/validation/CL/Comparisons.cpp index fb8935ba80..d015528b0e 100644 --- a/tests/validation/CL/Comparisons.cpp +++ b/tests/validation/CL/Comparisons.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 Arm Limited. + * Copyright (c) 2018-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -87,31 +87,6 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip( // clang-format on // *INDENT-ON* -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, configure_dataset, - shape, data_type) -{ - // Create tensors - CLTensor ref_src1 = create_tensor<CLTensor>(shape, data_type); - CLTensor ref_src2 = create_tensor<CLTensor>(shape, data_type); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::U8); - - // Create and Configure function - CLComparison compare; - compare.configure(&ref_src1, &ref_src2, &dst, ComparisonOperation::Equal); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - const int num_elems_processed_per_iteration = 16 / ref_src1.info()->element_size(); - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), num_elems_processed_per_iteration).required_padding(); - validate(ref_src1.info()->padding(), padding); - validate(ref_src2.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - template <typename T> using CLComparisonFixture = ComparisonValidationFixture<CLTensor, CLAccessor, CLComparison, T>; diff --git a/tests/validation/CL/Convolution.cpp b/tests/validation/CL/Convolution.cpp index 8804d34123..1608e7c66d 100644 --- a/tests/validation/CL/Convolution.cpp +++ b/tests/validation/CL/Convolution.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -44,45 +44,6 @@ namespace validation TEST_SUITE(CL) TEST_SUITE(CustomConvolution) TEST_SUITE(Square3x3) -DATA_TEST_CASE(Configuration, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType", { DataType::U8, DataType::S16 })), - datasets::BorderModes()), - framework::dataset::make("filter_size", { 3 })), - shape, output_data_type, border_mode, filter_size) -{ - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, DataType::U8); - CLTensor dst = create_tensor<CLTensor>(shape, output_data_type); - - // Create conv matrix - std::array<int16_t, 9> conv = { 0 }; - - ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS); - - // Create and configure function - CLConvolution3x3 convolution; - convolution.configure(&src, &dst, conv.data(), 0, border_mode); - - // Validate valid region - const ValidRegion dst_valid_region = shape_to_valid_region(shape, (border_mode == BorderMode::UNDEFINED), BorderSize(filter_size / 2)); - validate(dst.info()->valid_region(), dst_valid_region); - - // Validate padding - PaddingCalculator calculator(shape.x(), 8); - calculator.set_border_size(1); - calculator.set_border_mode(border_mode); - - const PaddingSize dst_padding = calculator.required_padding(); - - calculator.set_accessed_elements(16); - calculator.set_access_offset(-1); - - const PaddingSize src_padding = calculator.required_padding(); - - validate(src.info()->padding(), src_padding); - validate(dst.info()->padding(), dst_padding); -} - template <typename T> using CLConvolutionFixture = ConvolutionSquareValidationFixture<CLTensor, CLAccessor, CLConvolution3x3, T>; @@ -112,45 +73,6 @@ TEST_SUITE_END() // S16 TEST_SUITE_END() // Square 3x3 TEST_SUITE(Square5x5) -DATA_TEST_CASE(Configuration, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType", { DataType::U8, DataType::S16 })), - datasets::BorderModes()), - framework::dataset::make("filter_size", { 5 })), - shape, output_data_type, border_mode, filter_size) -{ - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, DataType::U8); - CLTensor dst = create_tensor<CLTensor>(shape, output_data_type); - - // Create conv matrix - std::array<int16_t, 25> conv = { 0 }; - - ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS); - - // Create and configure function - CLConvolution5x5 convolution; - convolution.configure(&src, &dst, conv.data(), 0, border_mode); - - // Validate valid region - const ValidRegion dst_valid_region = shape_to_valid_region(shape, (border_mode == BorderMode::UNDEFINED), BorderSize(filter_size / 2)); - validate(dst.info()->valid_region(), dst_valid_region); - - // Validate padding - PaddingCalculator calculator(shape.x(), 8); - calculator.set_border_size(2); - calculator.set_border_mode(border_mode); - - const PaddingSize dst_padding = calculator.required_padding(); - - calculator.set_accessed_elements(16); - calculator.set_access_offset(-2); - - const PaddingSize src_padding = calculator.required_padding(); - - validate(src.info()->padding(), src_padding); - validate(dst.info()->padding(), dst_padding); -} - template <typename T> using CLConvolutionFixture = ConvolutionSquareValidationFixture<CLTensor, CLAccessor, CLConvolution5x5, T>; @@ -180,45 +102,6 @@ TEST_SUITE_END() // S16 TEST_SUITE_END() // Square5x5 TEST_SUITE(Square7x7) -DATA_TEST_CASE(Configuration, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType", { DataType::U8, DataType::S16 })), - datasets::BorderModes()), - framework::dataset::make("filter_size", { 7 })), - shape, output_data_type, border_mode, filter_size) -{ - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, DataType::U8); - CLTensor dst = create_tensor<CLTensor>(shape, output_data_type); - - // Create conv matrix - std::array<int16_t, 49> conv = { 0 }; - - ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS); - - // Create and configure function - CLConvolution7x7 convolution; - convolution.configure(&src, &dst, conv.data(), 0, border_mode); - - // Validate valid region - const ValidRegion dst_valid_region = shape_to_valid_region(shape, (border_mode == BorderMode::UNDEFINED), BorderSize(filter_size / 2)); - validate(dst.info()->valid_region(), dst_valid_region); - - // Validate padding - PaddingCalculator calculator(shape.x(), 8); - calculator.set_border_size(3); - calculator.set_border_mode(border_mode); - - const PaddingSize dst_padding = calculator.required_padding(); - - calculator.set_accessed_elements(16); - calculator.set_access_offset(-3); - - const PaddingSize src_padding = calculator.required_padding(); - - validate(src.info()->padding(), src_padding); - validate(dst.info()->padding(), dst_padding); -} - template <typename T> using CLConvolutionFixture = ConvolutionSquareValidationFixture<CLTensor, CLAccessor, CLConvolution7x7, T>; @@ -248,44 +131,6 @@ TEST_SUITE_END() // S16 TEST_SUITE_END() // Square7x7 TEST_SUITE(Square9x9) -DATA_TEST_CASE(Configuration, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType", { DataType::U8, DataType::S16 })), - datasets::BorderModes()), - framework::dataset::make("filter_size", { 9 })), - shape, output_data_type, border_mode, filter_size) -{ - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, DataType::U8); - CLTensor dst = create_tensor<CLTensor>(shape, output_data_type); - - // Create conv matrix - std::array<int16_t, 81> conv = { 0 }; - - ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS); - - // Create and configure function - CLConvolution9x9 convolution; - convolution.configure(&src, &dst, conv.data(), 0, border_mode); - - // Validate valid region - const ValidRegion dst_valid_region = shape_to_valid_region(shape, (border_mode == BorderMode::UNDEFINED), BorderSize(filter_size / 2)); - validate(dst.info()->valid_region(), dst_valid_region); - - // Validate padding - PaddingCalculator calculator(shape.x(), 8); - calculator.set_border_size(4); - calculator.set_border_mode(border_mode); - - const PaddingSize dst_padding = calculator.required_padding(); - - calculator.set_accessed_elements(16); - calculator.set_access_offset(-4); - - const PaddingSize src_padding = calculator.required_padding(); - - validate(src.info()->padding(), src_padding); - validate(dst.info()->padding(), dst_padding); -} template <typename T> using CLConvolutionFixture = ConvolutionSquareValidationFixture<CLTensor, CLAccessor, CLConvolution9x9, T>; @@ -316,51 +161,6 @@ TEST_SUITE_END() // S16 TEST_SUITE_END() // Square9x9 TEST_SUITE(Rectangle) -DATA_TEST_CASE(Configuration, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType", -{ DataType::U8, DataType::S16 })), -datasets::BorderModes()), -framework::dataset::make("filter_width", { 3, 5, 7, 9 })), -framework::dataset::make("filter_height", { 3, 5, 7, 9 })), -shape, output_data_type, border_mode, filter_width, filter_height) -{ - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, DataType::U8); - CLTensor dst = create_tensor<CLTensor>(shape, output_data_type); - - // Create conv matrix - std::vector<int16_t> conv(filter_width * filter_height); - - ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS); - - // Create and configure function - CLConvolutionRectangle convolution; - convolution.configure(&src, &dst, conv.data(), filter_width, filter_height, 1, border_mode); - - // Validate valid region - const ValidRegion dst_valid_region = shape_to_valid_region(shape, (border_mode == BorderMode::UNDEFINED), BorderSize(filter_height / 2, filter_width / 2)); - validate(dst.info()->valid_region(), dst_valid_region); - - // Validate padding - PaddingCalculator calculator(shape.x(), 8); - calculator.set_border_size(filter_width / 2); - calculator.set_border_mode(border_mode); - - const PaddingSize dst_padding = calculator.required_padding(); - - calculator.set_accessed_elements(16); - calculator.set_access_offset(-(filter_width / 2)); - - const PaddingSize width_padding = calculator.required_padding(); - - calculator.set_border_size(filter_height / 2); - calculator.set_access_offset(-(filter_height / 2)); - const PaddingSize height_padding = calculator.required_padding(); - - validate(src.info()->padding(), width_padding, height_padding); - validate(dst.info()->padding(), dst_padding); -} - template <typename T> using CLConvolutionFixture = ConvolutionRectangleValidationFixture<CLTensor, CLAccessor, CLConvolutionRectangle, T>; diff --git a/tests/validation/CL/DepthConcatenateLayer.cpp b/tests/validation/CL/DepthConcatenateLayer.cpp index 4f5bd118bf..621de279d3 100644 --- a/tests/validation/CL/DepthConcatenateLayer.cpp +++ b/tests/validation/CL/DepthConcatenateLayer.cpp @@ -80,27 +80,6 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip( // clang-format on // *INDENT-ON* -TEST_CASE(Configuration, framework::DatasetMode::ALL) -{ - // Create tensors - CLTensor src1 = create_tensor<CLTensor>(TensorShape(128U, 32U, 32U), DataType::F32, 1); - CLTensor src2 = create_tensor<CLTensor>(TensorShape(128U, 32U, 32U), DataType::F32, 1); - CLTensor src3 = create_tensor<CLTensor>(TensorShape(128U, 32U, 32U), DataType::F32, 1); - CLTensor dst; - - ARM_COMPUTE_EXPECT(src1.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(src2.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(src3.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS); - - // Create and configure function - CLConcatenateLayer concat_layer; - std::vector<const ICLTensor *> inputs; - inputs.emplace_back(&src1); - inputs.emplace_back(&src2); - inputs.emplace_back(&src3); - concat_layer.configure(inputs, &dst, 2); -} template <typename T> using CLDepthConcatenateLayerFixture = ConcatenateLayerValidationFixture<CLTensor, ICLTensor, CLAccessor, CLConcatenateLayer, T>; diff --git a/tests/validation/CL/DepthConvertLayer.cpp b/tests/validation/CL/DepthConvertLayer.cpp index c6595e4a61..a823b278fc 100644 --- a/tests/validation/CL/DepthConvertLayer.cpp +++ b/tests/validation/CL/DepthConvertLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -109,28 +109,6 @@ template <typename T> using CLDepthConvertLayerToF32Fixture = DepthConvertLayerValidationFixture<CLTensor, CLAccessor, CLDepthConvertLayer, T, float>; TEST_SUITE(U8_to_U16) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(datasets::SmallShapes(), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), - DepthConvertLayerShiftDatasetNightly), - shape, policy, shift) -{ - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, DataType::U8, 1); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::U16, 1); - - // Create and Configure function - CLDepthConvertLayer depth_convert; - depth_convert.configure(&src, &dst, policy, shift); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - 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); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthConvertLayerToU16Fixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallShapes(), DepthConvertLayerU8toU16Dataset), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), DepthConvertLayerShiftDatasetPrecommit)) @@ -149,28 +127,6 @@ FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthConvertLayerToU16Fixture<uint8_t>, frame TEST_SUITE_END() // U8_to_U16 TEST_SUITE(U8_to_S16) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(datasets::SmallShapes(), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), - DepthConvertLayerShiftDatasetNightly), - shape, policy, shift) -{ - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, DataType::U8, 1); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::S16, 1); - - // Create and Configure function - CLDepthConvertLayer depth_convert; - depth_convert.configure(&src, &dst, policy, shift); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - 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); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthConvertLayerToS16Fixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallShapes(), DepthConvertLayerU8toS16Dataset), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), DepthConvertLayerShiftDatasetPrecommit)) @@ -188,28 +144,6 @@ FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthConvertLayerToS16Fixture<uint8_t>, frame } TEST_SUITE_END() // U8_to_S16 TEST_SUITE(U8_to_S32) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(datasets::SmallShapes(), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), - DepthConvertLayerShiftDatasetNightly), - shape, policy, shift) -{ - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, DataType::U8, 1); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::S32, 1); - - // Create and Configure function - CLDepthConvertLayer depth_convert; - depth_convert.configure(&src, &dst, policy, shift); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - 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); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthConvertLayerToS32Fixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallShapes(), DepthConvertLayerU8toS32Dataset), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), DepthConvertLayerShiftDatasetPrecommit)) @@ -228,28 +162,6 @@ FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthConvertLayerToS32Fixture<uint8_t>, frame TEST_SUITE_END() // U8_to_S32 TEST_SUITE(U16_to_U8) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(datasets::SmallShapes(), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), - DepthConvertLayerShiftDatasetNightly), - shape, policy, shift) -{ - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, DataType::U16, 1); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::U8, 1); - - // Create and Configure function - CLDepthConvertLayer depth_convert; - depth_convert.configure(&src, &dst, policy, shift); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - 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); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthConvertLayerToU8Fixture<uint16_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallShapes(), DepthConvertLayerU16toU8Dataset), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), DepthConvertLayerShiftDatasetPrecommit)) @@ -267,28 +179,6 @@ FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthConvertLayerToU8Fixture<uint16_t>, frame TEST_SUITE_END() // U16_to_U8 TEST_SUITE(U16_to_U32) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(datasets::SmallShapes(), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), - DepthConvertLayerShiftDatasetNightly), - shape, policy, shift) -{ - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, DataType::U16, 1); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::U32, 1); - - // Create and Configure function - CLDepthConvertLayer depth_convert; - depth_convert.configure(&src, &dst, policy, shift); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - 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); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthConvertLayerToU32Fixture<uint16_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallShapes(), DepthConvertLayerU16toU32Dataset), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), DepthConvertLayerShiftDatasetPrecommit)) @@ -306,28 +196,6 @@ FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthConvertLayerToU32Fixture<uint16_t>, fram TEST_SUITE_END() // U16_to_U32 TEST_SUITE(S16_to_U8) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(datasets::SmallShapes(), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), - DepthConvertLayerShiftDatasetNightly), - shape, policy, shift) -{ - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, DataType::S16, 1); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::U8, 1); - - // Create and Configure function - CLDepthConvertLayer depth_convert; - depth_convert.configure(&src, &dst, policy, shift); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - 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); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthConvertLayerToU8Fixture<int16_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallShapes(), DepthConvertLayerS16toU8Dataset), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), DepthConvertLayerShiftDatasetPrecommit)) @@ -345,28 +213,6 @@ FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthConvertLayerToU8Fixture<int16_t>, framew TEST_SUITE_END() // S16_to_U8 TEST_SUITE(S16_to_S32) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(datasets::SmallShapes(), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), - DepthConvertLayerShiftDatasetNightly), - shape, policy, shift) -{ - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, DataType::S16, 1); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::S32, 1); - - // Create and Configure function - CLDepthConvertLayer depth_convert; - depth_convert.configure(&src, &dst, policy, shift); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - 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); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthConvertLayerToS32Fixture<int16_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallShapes(), DepthConvertLayerS16toS32Dataset), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), DepthConvertLayerShiftDatasetPrecommit)) diff --git a/tests/validation/CL/DequantizationLayer.cpp b/tests/validation/CL/DequantizationLayer.cpp index fa283c9b5b..cff9659ce4 100644 --- a/tests/validation/CL/DequantizationLayer.cpp +++ b/tests/validation/CL/DequantizationLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -94,32 +94,6 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip( // clang-format on // *INDENT-ON* -DATA_TEST_CASE(Configuration, - framework::DatasetMode::ALL, - combine(datasets::SmallShapes(), framework::dataset::make("DataType", { DataType::F16, DataType::F32 })), - shape, data_type) -{ - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, DataType::QASYMM8, 1, QuantizationInfo(0.5f, -10)); - 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 - CLDequantizationLayer dequant_layer; - dequant_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 - validate(src.info()->padding(), PaddingSize()); - validate(dst.info()->padding(), PaddingSize()); -} - template <typename T> using CLDequantizationLayerFixture = DequantizationValidationFixture<CLTensor, CLAccessor, CLDequantizationLayer, T>; diff --git a/tests/validation/CL/Derivative.cpp b/tests/validation/CL/Derivative.cpp index 284da206c7..8f351e14e3 100644 --- a/tests/validation/CL/Derivative.cpp +++ b/tests/validation/CL/Derivative.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -44,42 +44,6 @@ TEST_SUITE(Derivative) using CLDerivativeFixture = DerivativeValidationFixture<CLTensor, CLAccessor, CLDerivative, uint8_t, int16_t>; -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format", - Format::U8)), - shape, border_mode, format) -{ - // Generate a random constant value - std::mt19937 gen(library->seed()); - std::uniform_int_distribution<uint8_t> int_dist(0, 255); - const uint8_t constant_border_value = int_dist(gen); - - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, data_type_from_format(format)); - CLTensor dst_x = create_tensor<CLTensor>(shape, DataType::S16); - CLTensor dst_y = create_tensor<CLTensor>(shape, DataType::S16); - - src.info()->set_format(format); - dst_x.info()->set_format(Format::S16); - dst_y.info()->set_format(Format::S16); - - ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(dst_x.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(dst_y.info()->is_resizable(), framework::LogLevel::ERRORS); - - // Create Derivative configure function - CLDerivative derivative; - derivative.configure(&src, &dst_x, &dst_y, border_mode, constant_border_value); - - // Validate valid region - constexpr BorderSize border_size{ 1 }; - const ValidRegion dst_valid_region = shape_to_valid_region(shape, border_mode == BorderMode::UNDEFINED, border_size); - - validate(dst_x.info()->valid_region(), dst_valid_region); - validate(dst_y.info()->valid_region(), dst_valid_region); - - // TODO(COMPMID-415) Validate padding after fixing x-access input bug in CL kernel -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLDerivativeFixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format", Format::U8)), datasets::GradientDimensions())) diff --git a/tests/validation/CL/Dilate.cpp b/tests/validation/CL/Dilate.cpp index e6605bbd5a..8bd4bba297 100644 --- a/tests/validation/CL/Dilate.cpp +++ b/tests/validation/CL/Dilate.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -50,41 +50,6 @@ constexpr BorderSize border_size(filter_size / 2); /* Border size of the kerne TEST_SUITE(CL) TEST_SUITE(Dilate) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::U8)), - datasets::BorderModes()), - shape, data_type, border_mode) -{ - // 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 - CLDilate dilate; - dilate.configure(&src, &dst, border_mode); - - // Validate valid region - const ValidRegion dst_valid_region = shape_to_valid_region(shape, (border_mode == BorderMode::UNDEFINED), border_size); - validate(dst.info()->valid_region(), dst_valid_region); - - // Validate padding - PaddingCalculator calculator(shape.x(), 8); - calculator.set_border_size(1); - calculator.set_border_mode(border_mode); - - const PaddingSize dst_padding = calculator.required_padding(); - - calculator.set_accessed_elements(16); - calculator.set_access_offset(-1); - - const PaddingSize src_padding = calculator.required_padding(); - - validate(src.info()->padding(), src_padding); - validate(dst.info()->padding(), dst_padding); -} - template <typename T> using CLDilateFixture = DilateValidationFixture<CLTensor, CLAccessor, CLDilate, T>; diff --git a/tests/validation/CL/DilatedConvolutionLayer.cpp b/tests/validation/CL/DilatedConvolutionLayer.cpp index 20ba113cd8..9a9df2c7e4 100644 --- a/tests/validation/CL/DilatedConvolutionLayer.cpp +++ b/tests/validation/CL/DilatedConvolutionLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 Arm Limited. + * Copyright (c) 2018-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -113,49 +113,6 @@ TEST_SUITE_END() TEST_SUITE(GEMMDilatedConvolutionLayer) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::SmallDilatedConvolutionLayerDataset(), - CNNDataTypes), - input_shape, weights_shape, bias_shape, output_shape, info, dilation, data_type) -{ - auto bias_data_type = is_data_type_quantized_asymmetric(data_type) ? DataType::S32 : data_type; - - // Create tensors - CLTensor src = create_tensor<CLTensor>(input_shape, data_type, 1, QuantizationInfo(2.f / 255.f, 127)); - CLTensor weights = create_tensor<CLTensor>(weights_shape, data_type, 1, QuantizationInfo(2.f / 255.f, 127)); - CLTensor bias = create_tensor<CLTensor>(bias_shape, bias_data_type, 1, QuantizationInfo(2.f / 255.f, 127)); - CLTensor dst = create_tensor<CLTensor>(output_shape, data_type, 1, QuantizationInfo(2.f / 255.f, 127)); - - 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); - - const QuantizationInfo src_quantization_info = src.info()->quantization_info(); - const QuantizationInfo weights_quantization_info = weights.info()->quantization_info(); - - // Create and configure function - CLGEMMConvolutionLayer conv; - conv.configure(&src, &weights, &bias, &dst, info, WeightsInfo(), dilation); - - // 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 QuantizationInfo - ARM_COMPUTE_EXPECT(src.info()->quantization_info() == src_quantization_info, framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(weights.info()->quantization_info() == weights_quantization_info, framework::LogLevel::ERRORS); - - // Validate padding - //TODO(COMPMID-415) Need to validate padding? -} - template <typename T> using CLGEMMDilatedConvolutionLayerFixture = ConvolutionValidationFixture<CLTensor, CLAccessor, CLGEMMConvolutionLayer, T>; diff --git a/tests/validation/CL/ElementwiseMax.cpp b/tests/validation/CL/ElementwiseMax.cpp index bdc47ee10b..3aa84de0d8 100644 --- a/tests/validation/CL/ElementwiseMax.cpp +++ b/tests/validation/CL/ElementwiseMax.cpp @@ -111,29 +111,6 @@ using CLElementwiseMaxFixture = ElementwiseMaxValidationFixture<CLTensor, CLAcce TEST_SUITE(Integer) TEST_SUITE(U8) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, datasets::SmallShapes(), - shape) -{ - // Create tensors - CLTensor ref_src1 = create_tensor<CLTensor>(shape, DataType::U8); - CLTensor ref_src2 = create_tensor<CLTensor>(shape, DataType::U8); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::U8); - - // Create and Configure function - CLElementwiseMax max; - max.configure(&ref_src1, &ref_src2, &dst); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), num_elems_processed_per_iteration).required_padding(); - validate(ref_src1.info()->padding(), padding); - validate(ref_src2.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLElementwiseMaxFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), ElementwiseMaxU8Dataset)) { // Validate output @@ -142,29 +119,6 @@ FIXTURE_DATA_TEST_CASE(RunSmall, CLElementwiseMaxFixture<uint8_t>, framework::Da TEST_SUITE_END() TEST_SUITE(S16) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), framework::dataset::make("DataType", { DataType::U8, DataType::S16 })), - shape, data_type) -{ - // Create tensors - CLTensor ref_src1 = create_tensor<CLTensor>(shape, data_type); - CLTensor ref_src2 = create_tensor<CLTensor>(shape, DataType::S16); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::S16); - - // Create and Configure function - CLElementwiseMax max; - max.configure(&ref_src1, &ref_src2, &dst); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), num_elems_processed_per_iteration).required_padding(); - validate(ref_src1.info()->padding(), padding); - validate(ref_src2.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLElementwiseMaxFixture<int16_t>, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), ElementwiseMaxS16Dataset)) { // Validate output @@ -178,29 +132,6 @@ using CLElementwiseMaxQuantizedFixture = ElementwiseMaxValidationQuantizedFixtur TEST_SUITE(Quantized) TEST_SUITE(QASYMM8) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, datasets::SmallShapes(), - shape) -{ - // Create tensors - CLTensor ref_src1 = create_tensor<CLTensor>(shape, DataType::QASYMM8); - CLTensor ref_src2 = create_tensor<CLTensor>(shape, DataType::QASYMM8); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::QASYMM8); - - // Create and Configure function - CLElementwiseMax max; - max.configure(&ref_src1, &ref_src2, &dst); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), num_elems_processed_per_iteration).required_padding(); - validate(ref_src1.info()->padding(), padding); - validate(ref_src2.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLElementwiseMaxQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallShapes(), ElementwiseMaxQASYMM8Dataset), framework::dataset::make("Src0QInfo", { QuantizationInfo(5.f / 255.f, 20) })), @@ -212,29 +143,6 @@ FIXTURE_DATA_TEST_CASE(RunSmall, CLElementwiseMaxQuantizedFixture<uint8_t>, fram } TEST_SUITE_END() TEST_SUITE(QASYMM8_SIGNED) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, datasets::SmallShapes(), - shape) -{ - // Create tensors - CLTensor ref_src1 = create_tensor<CLTensor>(shape, DataType::QASYMM8_SIGNED); - CLTensor ref_src2 = create_tensor<CLTensor>(shape, DataType::QASYMM8_SIGNED); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::QASYMM8_SIGNED); - - // Create and Configure function - CLElementwiseMax max; - max.configure(&ref_src1, &ref_src2, &dst); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), num_elems_processed_per_iteration).required_padding(); - validate(ref_src1.info()->padding(), padding); - validate(ref_src2.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLElementwiseMaxQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallShapes(), ElementwiseMaxQASYMM8SignedDataset), framework::dataset::make("Src0QInfo", { QuantizationInfo(5.f / 255.f, 20) })), @@ -246,29 +154,6 @@ FIXTURE_DATA_TEST_CASE(RunSmall, CLElementwiseMaxQuantizedFixture<int8_t>, frame } TEST_SUITE_END() TEST_SUITE(QSYMM16) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, datasets::SmallShapes(), - shape) -{ - // Create tensors - CLTensor ref_src1 = create_tensor<CLTensor>(shape, DataType::QSYMM16); - CLTensor ref_src2 = create_tensor<CLTensor>(shape, DataType::QSYMM16); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::QSYMM16); - - // Create and Configure function - CLElementwiseMax max; - max.configure(&ref_src1, &ref_src2, &dst); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), num_elems_processed_per_iteration).required_padding(); - validate(ref_src1.info()->padding(), padding); - validate(ref_src2.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLElementwiseMaxQuantizedFixture<int16_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallShapes(), ElementwiseMaxQSYMM16Dataset), framework::dataset::make("Src0QInfo", { QuantizationInfo(1.f / 32768.f, 0), QuantizationInfo(5.f / 32768.f, 0) })), @@ -300,29 +185,6 @@ FIXTURE_DATA_TEST_CASE(RunWithActivation, CLElementwiseMaxFloatFixture<half>, fr TEST_SUITE_END() TEST_SUITE(FP32) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, datasets::SmallShapes(), - shape) -{ - // Create tensors - CLTensor ref_src1 = create_tensor<CLTensor>(shape, DataType::F32); - CLTensor ref_src2 = create_tensor<CLTensor>(shape, DataType::F32); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::F32); - - // Create and Configure function - CLElementwiseMax max; - max.configure(&ref_src1, &ref_src2, &dst); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), num_elems_processed_per_iteration).required_padding(); - validate(ref_src1.info()->padding(), padding); - validate(ref_src2.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLElementwiseMaxFloatFixture<float>, framework::DatasetMode::ALL, combine(combine(datasets::SmallShapes(), ElementwiseMaxFP32Dataset), EmptyActivationFunctionsDataset)) { diff --git a/tests/validation/CL/ElementwiseMin.cpp b/tests/validation/CL/ElementwiseMin.cpp index a7caac3841..5f9d572a13 100644 --- a/tests/validation/CL/ElementwiseMin.cpp +++ b/tests/validation/CL/ElementwiseMin.cpp @@ -111,29 +111,6 @@ using CLElementwiseMinFixture = ElementwiseMinValidationFixture<CLTensor, CLAcce TEST_SUITE(Integer) TEST_SUITE(U8) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, datasets::SmallShapes(), - shape) -{ - // Create tensors - CLTensor ref_src1 = create_tensor<CLTensor>(shape, DataType::U8); - CLTensor ref_src2 = create_tensor<CLTensor>(shape, DataType::U8); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::U8); - - // Create and Configure function - CLElementwiseMin min; - min.configure(&ref_src1, &ref_src2, &dst); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), num_elems_processed_per_iteration).required_padding(); - validate(ref_src1.info()->padding(), padding); - validate(ref_src2.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLElementwiseMinFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), ElementwiseMinU8Dataset)) { // Validate output @@ -142,29 +119,6 @@ FIXTURE_DATA_TEST_CASE(RunSmall, CLElementwiseMinFixture<uint8_t>, framework::Da TEST_SUITE_END() TEST_SUITE(S16) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), framework::dataset::make("DataType", { DataType::U8, DataType::S16 })), - shape, data_type) -{ - // Create tensors - CLTensor ref_src1 = create_tensor<CLTensor>(shape, data_type); - CLTensor ref_src2 = create_tensor<CLTensor>(shape, DataType::S16); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::S16); - - // Create and Configure function - CLElementwiseMin min; - min.configure(&ref_src1, &ref_src2, &dst); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), num_elems_processed_per_iteration).required_padding(); - validate(ref_src1.info()->padding(), padding); - validate(ref_src2.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLElementwiseMinFixture<int16_t>, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), ElementwiseMinS16Dataset)) { // Validate output @@ -178,29 +132,6 @@ using CLElementwiseMinQuantizedFixture = ElementwiseMinValidationQuantizedFixtur TEST_SUITE(Quantized) TEST_SUITE(QASYMM8) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, datasets::SmallShapes(), - shape) -{ - // Create tensors - CLTensor ref_src1 = create_tensor<CLTensor>(shape, DataType::QASYMM8); - CLTensor ref_src2 = create_tensor<CLTensor>(shape, DataType::QASYMM8); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::QASYMM8); - - // Create and Configure function - CLElementwiseMin min; - min.configure(&ref_src1, &ref_src2, &dst); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), num_elems_processed_per_iteration).required_padding(); - validate(ref_src1.info()->padding(), padding); - validate(ref_src2.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLElementwiseMinQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallShapes(), ElementwiseMinQASYMM8Dataset), framework::dataset::make("Src0QInfo", { QuantizationInfo(5.f / 255.f, 20) })), @@ -212,29 +143,6 @@ FIXTURE_DATA_TEST_CASE(RunSmall, CLElementwiseMinQuantizedFixture<uint8_t>, fram } TEST_SUITE_END() TEST_SUITE(QASYMM8_SIGNED) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, datasets::SmallShapes(), - shape) -{ - // Create tensors - CLTensor ref_src1 = create_tensor<CLTensor>(shape, DataType::QASYMM8_SIGNED); - CLTensor ref_src2 = create_tensor<CLTensor>(shape, DataType::QASYMM8_SIGNED); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::QASYMM8_SIGNED); - - // Create and Configure function - CLElementwiseMin min; - min.configure(&ref_src1, &ref_src2, &dst); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), num_elems_processed_per_iteration).required_padding(); - validate(ref_src1.info()->padding(), padding); - validate(ref_src2.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLElementwiseMinQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallShapes(), ElementwiseMinQASYMM8SignedDataset), framework::dataset::make("Src0QInfo", { QuantizationInfo(5.f / 255.f, 20) })), @@ -246,29 +154,6 @@ FIXTURE_DATA_TEST_CASE(RunSmall, CLElementwiseMinQuantizedFixture<int8_t>, frame } TEST_SUITE_END() TEST_SUITE(QSYMM16) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, datasets::SmallShapes(), - shape) -{ - // Create tensors - CLTensor ref_src1 = create_tensor<CLTensor>(shape, DataType::QSYMM16); - CLTensor ref_src2 = create_tensor<CLTensor>(shape, DataType::QSYMM16); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::QSYMM16); - - // Create and Configure function - CLElementwiseMin min; - min.configure(&ref_src1, &ref_src2, &dst); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), num_elems_processed_per_iteration).required_padding(); - validate(ref_src1.info()->padding(), padding); - validate(ref_src2.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLElementwiseMinQuantizedFixture<int16_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallShapes(), ElementwiseMinQSYMM16Dataset), framework::dataset::make("SrcQInfo0", { QuantizationInfo(1.f / 32768.f, 0), QuantizationInfo(5.f / 32768.f, 0) })), @@ -300,29 +185,6 @@ FIXTURE_DATA_TEST_CASE(RunWithActivation, CLElementwiseMinFloatFixture<half>, fr TEST_SUITE_END() TEST_SUITE(FP32) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, datasets::SmallShapes(), - shape) -{ - // Create tensors - CLTensor ref_src1 = create_tensor<CLTensor>(shape, DataType::F32); - CLTensor ref_src2 = create_tensor<CLTensor>(shape, DataType::F32); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::F32); - - // Create and Configure function - CLElementwiseMin min; - min.configure(&ref_src1, &ref_src2, &dst); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), num_elems_processed_per_iteration).required_padding(); - validate(ref_src1.info()->padding(), padding); - validate(ref_src2.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLElementwiseMinFloatFixture<float>, framework::DatasetMode::ALL, combine(combine(datasets::SmallShapes(), ElementwiseMinFP32Dataset), EmptyActivationFunctionsDataset)) { diff --git a/tests/validation/CL/ElementwiseSquaredDiff.cpp b/tests/validation/CL/ElementwiseSquaredDiff.cpp index 58eca3fe0b..1a6513e446 100644 --- a/tests/validation/CL/ElementwiseSquaredDiff.cpp +++ b/tests/validation/CL/ElementwiseSquaredDiff.cpp @@ -110,29 +110,6 @@ using CLElementwiseSquaredDiffFixture = ElementwiseSquaredDiffValidationFixture< TEST_SUITE(Integer) TEST_SUITE(U8) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, datasets::SmallShapes(), - shape) -{ - // Create tensors - CLTensor ref_src1 = create_tensor<CLTensor>(shape, DataType::U8); - CLTensor ref_src2 = create_tensor<CLTensor>(shape, DataType::U8); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::U8); - - // Create and Configure function - CLElementwiseSquaredDiff sqdiff; - sqdiff.configure(&ref_src1, &ref_src2, &dst); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), num_elems_processed_per_iteration).required_padding(); - validate(ref_src1.info()->padding(), padding); - validate(ref_src2.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLElementwiseSquaredDiffFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), ElementwiseSquaredDiffU8Dataset)) { // Validate output @@ -141,29 +118,6 @@ FIXTURE_DATA_TEST_CASE(RunSmall, CLElementwiseSquaredDiffFixture<uint8_t>, frame TEST_SUITE_END() TEST_SUITE(S16) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), framework::dataset::make("DataType", { DataType::U8, DataType::S16 })), - shape, data_type) -{ - // Create tensors - CLTensor ref_src1 = create_tensor<CLTensor>(shape, data_type); - CLTensor ref_src2 = create_tensor<CLTensor>(shape, DataType::S16); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::S16); - - // Create and Configure function - CLElementwiseSquaredDiff sqdiff; - sqdiff.configure(&ref_src1, &ref_src2, &dst); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), num_elems_processed_per_iteration).required_padding(); - validate(ref_src1.info()->padding(), padding); - validate(ref_src2.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLElementwiseSquaredDiffFixture<int16_t>, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), ElementwiseSquaredDiffS16Dataset)) { // Validate output @@ -177,29 +131,6 @@ using CLElementwiseSquaredDiffQuantizedFixture = ElementwiseSquaredDiffValidatio TEST_SUITE(Quantized) TEST_SUITE(QASYMM8) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, datasets::SmallShapes(), - shape) -{ - // Create tensors - CLTensor ref_src1 = create_tensor<CLTensor>(shape, DataType::QASYMM8); - CLTensor ref_src2 = create_tensor<CLTensor>(shape, DataType::QASYMM8); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::QASYMM8); - - // Create and Configure function - CLElementwiseSquaredDiff sqdiff; - sqdiff.configure(&ref_src1, &ref_src2, &dst); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), num_elems_processed_per_iteration).required_padding(); - validate(ref_src1.info()->padding(), padding); - validate(ref_src2.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLElementwiseSquaredDiffQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallShapes(), ElementwiseSquaredDiffQASYMM8Dataset), framework::dataset::make("Src0QInfo", { QuantizationInfo(5.f / 255.f, 20) })), @@ -211,29 +142,6 @@ FIXTURE_DATA_TEST_CASE(RunSmall, CLElementwiseSquaredDiffQuantizedFixture<uint8_ } TEST_SUITE_END() TEST_SUITE(QSYMM16) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, datasets::SmallShapes(), - shape) -{ - // Create tensors - CLTensor ref_src1 = create_tensor<CLTensor>(shape, DataType::QSYMM16); - CLTensor ref_src2 = create_tensor<CLTensor>(shape, DataType::QSYMM16); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::QSYMM16); - - // Create and Configure function - CLElementwiseSquaredDiff sqdiff; - sqdiff.configure(&ref_src1, &ref_src2, &dst); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), num_elems_processed_per_iteration).required_padding(); - validate(ref_src1.info()->padding(), padding); - validate(ref_src2.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLElementwiseSquaredDiffQuantizedFixture<int16_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallShapes(), ElementwiseSquaredDiffQSYMM16Dataset), framework::dataset::make("Src0QInfo", { QuantizationInfo(1.f / 32768.f, 0), QuantizationInfo(5.f / 32768.f, 0) })), @@ -266,29 +174,6 @@ FIXTURE_DATA_TEST_CASE(RunWithActivation, CLElementwiseSquaredDiffFloatFixture<h TEST_SUITE_END() TEST_SUITE(FP32) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, datasets::SmallShapes(), - shape) -{ - // Create tensors - CLTensor ref_src1 = create_tensor<CLTensor>(shape, DataType::F32); - CLTensor ref_src2 = create_tensor<CLTensor>(shape, DataType::F32); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::F32); - - // Create and Configure function - CLElementwiseSquaredDiff sqdiff; - sqdiff.configure(&ref_src1, &ref_src2, &dst); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), num_elems_processed_per_iteration).required_padding(); - validate(ref_src1.info()->padding(), padding); - validate(ref_src2.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLElementwiseSquaredDiffFloatFixture<float>, framework::DatasetMode::ALL, combine(combine(datasets::SmallShapes(), ElementwiseSquaredDiffFP32Dataset), EmptyActivationFunctionsDataset)) { diff --git a/tests/validation/CL/EqualizeHistogram.cpp b/tests/validation/CL/EqualizeHistogram.cpp index 6dbe01a509..18047e6ffa 100644 --- a/tests/validation/CL/EqualizeHistogram.cpp +++ b/tests/validation/CL/EqualizeHistogram.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -39,30 +39,6 @@ namespace validation TEST_SUITE(CL) TEST_SUITE(EqualizeHistogram) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::Small2DShapes(), 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 - CLEqualizeHistogram equalize_histogram; - equalize_histogram.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 CLEqualizeHistogramFixture = EqualizeHistogramValidationFixture<CLTensor, CLAccessor, CLEqualizeHistogram, T>; diff --git a/tests/validation/CL/Erode.cpp b/tests/validation/CL/Erode.cpp index 76d30afb50..303e65f727 100644 --- a/tests/validation/CL/Erode.cpp +++ b/tests/validation/CL/Erode.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -50,41 +50,6 @@ constexpr BorderSize border_size(filter_size / 2); /* Border size of the kerne TEST_SUITE(CL) TEST_SUITE(Erode) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::U8)), - datasets::BorderModes()), - shape, data_type, border_mode) -{ - // 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 - CLErode erode; - erode.configure(&src, &dst, border_mode); - - // Validate valid region - const ValidRegion dst_valid_region = shape_to_valid_region(shape, (border_mode == BorderMode::UNDEFINED), border_size); - validate(dst.info()->valid_region(), dst_valid_region); - - // Validate padding - PaddingCalculator calculator(shape.x(), 8); - calculator.set_border_size(1); - calculator.set_border_mode(border_mode); - - const PaddingSize dst_padding = calculator.required_padding(); - - calculator.set_accessed_elements(16); - calculator.set_access_offset(-1); - - const PaddingSize src_padding = calculator.required_padding(); - - validate(src.info()->padding(), src_padding); - validate(dst.info()->padding(), dst_padding); -} - template <typename T> using CLErodeFixture = ErodeValidationFixture<CLTensor, CLAccessor, CLErode, T>; diff --git a/tests/validation/CL/FFT.cpp b/tests/validation/CL/FFT.cpp index 12d53b522e..1115ddcd8b 100644 --- a/tests/validation/CL/FFT.cpp +++ b/tests/validation/CL/FFT.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 Arm Limited. + * Copyright (c) 2019-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -71,30 +71,6 @@ constexpr float tolerance_num = 0.07f; /**< Tolerance number */ TEST_SUITE(CL) TEST_SUITE(FFT1D) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(shapes_1d, data_types), - shape, data_type) -{ - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, data_type, 2); - CLTensor dst = create_tensor<CLTensor>(shape, data_type, 2); - - ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS); - - // Create and configure function - CLFFT1D fft1d; - fft1d.configure(&src, &dst, FFT1DInfo()); - - // 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 - validate(src.info()->padding(), PaddingSize()); - validate(dst.info()->padding(), PaddingSize()); -} - // *INDENT-OFF* // clang-format off DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip( @@ -141,30 +117,6 @@ TEST_SUITE_END() // FFT1D TEST_SUITE(FFT2D) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(shapes_2d, data_types), - shape, data_type) -{ - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, data_type, 2); - CLTensor dst = create_tensor<CLTensor>(shape, data_type, 2); - - ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS); - - // Create and configure function - CLFFT2D fft2d; - fft2d.configure(&src, &dst, FFT2DInfo()); - - // 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 - validate(src.info()->padding(), PaddingSize()); - validate(dst.info()->padding(), PaddingSize()); -} - // *INDENT-OFF* // clang-format off DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip( diff --git a/tests/validation/CL/FastCorners.cpp b/tests/validation/CL/FastCorners.cpp index 37ffb51c77..63d32fb964 100644 --- a/tests/validation/CL/FastCorners.cpp +++ b/tests/validation/CL/FastCorners.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -53,42 +53,6 @@ const AbsoluteTolerance<float> tolerance(0.5f); TEST_SUITE(CL) TEST_SUITE(FastCorners) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(combine(concat(datasets::Small2DShapes(), datasets::Large2DShapes()), - framework::dataset::make("Format", Format::U8)), - framework::dataset::make("SuppressNonMax", { false, true })), - framework::dataset::make("BorderMode", BorderMode::UNDEFINED)), - shape, format, suppress_nonmax, border_mode) -{ - std::mt19937 gen(library->seed()); - std::uniform_int_distribution<uint8_t> int_dist(0, 255); - std::uniform_real_distribution<float> real_dist(0, 255); - - const uint8_t constant_border_value = int_dist(gen); - const float threshold = real_dist(gen); - - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, data_type_from_format(format)); - src.info()->set_format(format); - - ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS); - - CLKeyPointArray corners; - unsigned int num_corners; - - // Create and configure function - CLFastCorners fast_corners; - fast_corners.configure(&src, threshold, suppress_nonmax, &corners, &num_corners, border_mode, constant_border_value); - - // Validate padding - PaddingCalculator calculator(shape.x(), 1); // elems_processed - - calculator.set_border_size(bresenham_radius); - calculator.set_access_offset(-bresenham_radius); - calculator.set_accessed_elements(7); // elems_read - - validate(src.info()->padding(), calculator.required_padding()); -} - template <typename T> using CLFastCornersFixture = FastCornersValidationFixture<CLTensor, CLAccessor, CLKeyPointArray, CLFastCorners, T>; diff --git a/tests/validation/CL/GEMMLowp.cpp b/tests/validation/CL/GEMMLowp.cpp index 29649d8c9f..08227078bc 100644 --- a/tests/validation/CL/GEMMLowp.cpp +++ b/tests/validation/CL/GEMMLowp.cpp @@ -54,27 +54,6 @@ TEST_SUITE(GEMMLowp) TEST_SUITE(MatrixMultiplyCore) using CLGEMMLowpMatrixMultiplyCoreFixture = GEMMLowpMatrixMultiplyCoreValidationFixture<CLTensor, CLAccessor, CLGEMMLowpMatrixMultiplyCore>; -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, datasets::SmallGEMMLowpDataset(), - shape_a, shape_b, shape_c, a_offset, b_offset) -{ - // Create tensors - CLTensor a = create_tensor<CLTensor>(shape_a, DataType::QASYMM8); - CLTensor b = create_tensor<CLTensor>(shape_b, DataType::QASYMM8); - CLTensor c = create_tensor<CLTensor>(shape_c, DataType::S32); - - a.info()->set_quantization_info(QuantizationInfo(1.0f / 255, a_offset)); - b.info()->set_quantization_info(QuantizationInfo(1.0f / 255, b_offset)); - - 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); - - // Create and configure function - CLGEMMLowpMatrixMultiplyCore gemmlowp_mm; - // TODO (giaiod01) COMPMID-1672 - Extending the test to validate add bias in offset contribution - gemmlowp_mm.configure(&a, &b, nullptr, &c); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLGEMMLowpMatrixMultiplyCoreFixture, framework::DatasetMode::ALL, datasets::SmallGEMMLowpDataset()) { // Validate output @@ -217,47 +196,6 @@ const auto quantize_down_int32_to_uint8_scale_by_fixedpoint_relu_cases = framewo using CLGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPointFixture = GEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPointValidationFixture<CLTensor, CLAccessor, CLGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPoint>; -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), quantize_down_int32_to_uint8_scale_by_fixedpoint_cases), - shape, result_fixedpoint_multiplier, result_shift, result_offset_after_shift, min, max, add_bias) -{ - TensorShape shape_bias(shape[0]); - - // Create tensors - CLTensor in = create_tensor<CLTensor>(shape, DataType::S32); - CLTensor bias = create_tensor<CLTensor>(shape_bias, DataType::S32); - CLTensor out = create_tensor<CLTensor>(shape, DataType::QASYMM8); - - ARM_COMPUTE_EXPECT(in.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(bias.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(out.info()->is_resizable(), framework::LogLevel::ERRORS); - - // Create and configure function - CLGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPoint output_stage; - output_stage.configure(&in, add_bias ? &bias : nullptr, &out, result_fixedpoint_multiplier, result_shift, result_offset_after_shift, min, max); - - // Validate valid region input and output - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(in.info()->valid_region(), valid_region); - validate(out.info()->valid_region(), valid_region); - - // Validate valid region bias - if(add_bias) - { - const ValidRegion valid_region_bias = shape_to_valid_region(shape_bias); - validate(bias.info()->valid_region(), valid_region_bias); - } - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), 4).required_padding(); - validate(in.info()->padding(), padding); - validate(out.info()->padding(), padding); - - if(add_bias) - { - validate(bias.info()->padding(), padding); - } -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPointFixture, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), quantize_down_int32_to_uint8_scale_by_fixedpoint_cases)) { @@ -297,47 +235,6 @@ const auto quantize_down_int32_to_int8_scale_by_fixedpoint_relu_cases = framewor using CLGEMMLowpQuantizeDownInt32ToInt8ScaleByFixedPointFixture = GEMMLowpQuantizeDownInt32ToInt8ScaleByFixedPointValidationFixture<CLTensor, CLAccessor, CLGEMMLowpQuantizeDownInt32ToInt8ScaleByFixedPoint>; -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), quantize_down_int32_to_int8_scale_by_fixedpoint_cases), - shape, result_fixedpoint_multiplier, result_shift, result_offset_after_shift, min, max, add_bias) -{ - TensorShape shape_bias(shape[0]); - - // Create tensors - CLTensor in = create_tensor<CLTensor>(shape, DataType::S32); - CLTensor bias = create_tensor<CLTensor>(shape_bias, DataType::S32); - CLTensor out = create_tensor<CLTensor>(shape, DataType::QASYMM8_SIGNED); - - ARM_COMPUTE_EXPECT(in.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(bias.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(out.info()->is_resizable(), framework::LogLevel::ERRORS); - - // Create and configure function - CLGEMMLowpQuantizeDownInt32ToInt8ScaleByFixedPoint output_stage; - output_stage.configure(&in, add_bias ? &bias : nullptr, &out, result_fixedpoint_multiplier, result_shift, result_offset_after_shift, min, max); - - // Validate valid region input and output - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(in.info()->valid_region(), valid_region); - validate(out.info()->valid_region(), valid_region); - - // Validate valid region bias - if(add_bias) - { - const ValidRegion valid_region_bias = shape_to_valid_region(shape_bias); - validate(bias.info()->valid_region(), valid_region_bias); - } - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), 4).required_padding(); - validate(in.info()->padding(), padding); - validate(out.info()->padding(), padding); - - if(add_bias) - { - validate(bias.info()->padding(), padding); - } -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLGEMMLowpQuantizeDownInt32ToInt8ScaleByFixedPointFixture, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), quantize_down_int32_to_int8_scale_by_fixedpoint_cases)) { diff --git a/tests/validation/CL/Gather.cpp b/tests/validation/CL/Gather.cpp index e7f860e35e..6126231d0d 100644 --- a/tests/validation/CL/Gather.cpp +++ b/tests/validation/CL/Gather.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 Arm Limited. + * Copyright (c) 2018-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -98,26 +98,6 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip( // clang-format on // *INDENT-ON* -DATA_TEST_CASE(Configuration, - framework::DatasetMode::ALL, - combine(arm_compute::test::datasets::SmallGatherDataset(), framework::dataset::make("DataType", { DataType::F16, DataType::F32 })), - input_shape, indices_shape, axis, data_type) -{ - const uint32_t actual_axis = wrap_around(axis, static_cast<int>(input_shape.num_dimensions())); - CLTensor src = create_tensor<CLTensor>(input_shape, data_type); - CLTensor indices = create_tensor<CLTensor>(indices_shape, DataType::U32); - TensorShape dst_shape = arm_compute::misc::shape_calculator::compute_gather_shape(input_shape, indices_shape, actual_axis); - CLTensor dst = create_tensor<CLTensor>(dst_shape, data_type); - - // Create and Configure function - CLGather gather; - gather.configure(&src, &indices, &dst, axis); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(dst.info()->tensor_shape()); - validate(dst.info()->valid_region(), valid_region); -} - template <typename T> using CLGatherFixture = GatherFixture<CLTensor, CLAccessor, CLGather, T>; diff --git a/tests/validation/CL/Gaussian3x3.cpp b/tests/validation/CL/Gaussian3x3.cpp index 10b1a473c6..840be4b93d 100644 --- a/tests/validation/CL/Gaussian3x3.cpp +++ b/tests/validation/CL/Gaussian3x3.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -50,41 +50,6 @@ constexpr BorderSize border_size(filter_size / 2); /* Border size of the kerne TEST_SUITE(CL) TEST_SUITE(Gaussian3x3) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::U8)), - datasets::BorderModes()), - shape, data_type, border_mode) -{ - // 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 - CLGaussian3x3 gaussian3x3; - gaussian3x3.configure(&src, &dst, border_mode); - - // Validate valid region - const ValidRegion dst_valid_region = shape_to_valid_region(shape, (border_mode == BorderMode::UNDEFINED), border_size); - validate(dst.info()->valid_region(), dst_valid_region); - - // Validate padding - PaddingCalculator calculator(shape.x(), 8); - calculator.set_border_size(1); - calculator.set_border_mode(border_mode); - - const PaddingSize dst_padding = calculator.required_padding(); - - calculator.set_accessed_elements(16); - calculator.set_access_offset(-1); - - const PaddingSize src_padding = calculator.required_padding(); - - validate(src.info()->padding(), src_padding); - validate(dst.info()->padding(), dst_padding); -} - template <typename T> using CLGaussian3x3Fixture = Gaussian3x3ValidationFixture<CLTensor, CLAccessor, CLGaussian3x3, T>; diff --git a/tests/validation/CL/Gaussian5x5.cpp b/tests/validation/CL/Gaussian5x5.cpp index a33ac4d4d6..53165c7608 100644 --- a/tests/validation/CL/Gaussian5x5.cpp +++ b/tests/validation/CL/Gaussian5x5.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -50,41 +50,6 @@ constexpr BorderSize border_size(filter_size / 2); /* Border size of the kerne TEST_SUITE(CL) TEST_SUITE(Gaussian5x5) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::U8)), - datasets::BorderModes()), - shape, data_type, border_mode) -{ - // 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 - CLGaussian5x5 gaussian5x5; - gaussian5x5.configure(&src, &dst, border_mode); - - // Validate valid region - const ValidRegion dst_valid_region = shape_to_valid_region(shape, (border_mode == BorderMode::UNDEFINED), border_size); - validate(dst.info()->valid_region(), dst_valid_region); - - // Validate padding - PaddingCalculator calculator(shape.x(), 8); - calculator.set_border_size(2); - calculator.set_border_mode(border_mode); - - const PaddingSize dst_padding = calculator.required_padding(); - - calculator.set_accessed_elements(16); - calculator.set_access_offset(-2); - - const PaddingSize src_padding = calculator.required_padding(); - - validate(src.info()->padding(), src_padding); - validate(dst.info()->padding(), dst_padding); -} - template <typename T> using CLGaussian5x5Fixture = Gaussian5x5ValidationFixture<CLTensor, CLAccessor, CLGaussian5x5, T>; diff --git a/tests/validation/CL/GaussianPyramid.cpp b/tests/validation/CL/GaussianPyramid.cpp index 4c17cdc88c..4590b0defe 100644 --- a/tests/validation/CL/GaussianPyramid.cpp +++ b/tests/validation/CL/GaussianPyramid.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Arm Limited. + * Copyright (c) 2018-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -20,7 +20,7 @@ * 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" @@ -69,28 +69,6 @@ inline void validate_gaussian_pyramid(const CLPyramid &target, const std::vector TEST_SUITE(CL) TEST_SUITE(GaussianPyramid) TEST_SUITE(Half) - -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, large_gaussian_pyramid_levels, - shape, border_mode, num_levels) -{ - CLTensor src = create_tensor<CLTensor>(shape, DataType::U8); - - // Create pyramid - PyramidInfo pyramid_info(num_levels, SCALE_PYRAMID_HALF, shape, Format::U8); - CLPyramid dst; - dst.init(pyramid_info); - - CLGaussianPyramidHalf gaussian_pyramid_half; - gaussian_pyramid_half.configure(&src, &dst, border_mode, 0); - - ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS); - - for(size_t level = 0; level < pyramid_info.num_levels(); ++level) - { - ARM_COMPUTE_EXPECT(dst.get_pyramid_level(level)->info()->is_resizable(), framework::LogLevel::ERRORS); - } -} - template <typename T> using CLGaussianPyramidHalfFixture = GaussianPyramidHalfValidationFixture<CLTensor, CLAccessor, CLGaussianPyramidHalf, T, CLPyramid>; diff --git a/tests/validation/CL/HarrisCorners.cpp b/tests/validation/CL/HarrisCorners.cpp index 51591bbbde..20a13af53b 100644 --- a/tests/validation/CL/HarrisCorners.cpp +++ b/tests/validation/CL/HarrisCorners.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -53,47 +53,6 @@ const auto data_precommit = combine(framework::dataset::make("GradientSize", { 3 TEST_SUITE(CL) TEST_SUITE(HarrisCorners) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(datasets::Small2DShapes(), data_nightly), framework::dataset::make("Format", Format::U8)), shape, - gradient_size, block_size, border_mode, format) -{ - std::mt19937 gen(library->seed()); - std::uniform_real_distribution<float> real_dist(0.f, 0.01f); - - const float threshold = real_dist(gen); - const float sensitivity = real_dist(gen); - - constexpr float max_euclidean_distance = 30.f; - real_dist = std::uniform_real_distribution<float>(0.f, max_euclidean_distance); - const float min_dist = real_dist(gen); - - // Generate a random constant value - std::uniform_int_distribution<uint8_t> int_dist(0, 255); - const uint8_t constant_border_value = int_dist(gen); - - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, data_type_from_format(format)); - src.info()->set_format(format); - CLKeyPointArray corners; - - ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS); - - // Create harris corners configure function - CLHarrisCorners harris_corners; - harris_corners.configure(&src, threshold, min_dist, sensitivity, gradient_size, block_size, &corners, border_mode, constant_border_value); - - // Validate padding - PaddingCalculator calculator(shape.x(), 8); - - calculator.set_border_mode(border_mode); - calculator.set_border_size(gradient_size / 2); - calculator.set_access_offset(-gradient_size / 2); - calculator.set_accessed_elements(16); - - const PaddingSize padding = calculator.required_padding(); - - validate(src.info()->padding(), padding); -} - template <typename T> using CLHarrisCornersFixture = HarrisCornersValidationFixture<CLTensor, CLAccessor, CLKeyPointArray, CLHarrisCorners, T>; diff --git a/tests/validation/CL/Histogram.cpp b/tests/validation/CL/Histogram.cpp index 643e4f55ab..9d25154898 100644 --- a/tests/validation/CL/Histogram.cpp +++ b/tests/validation/CL/Histogram.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -45,44 +45,6 @@ namespace validation TEST_SUITE(CL) TEST_SUITE(Histogram) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(concat(datasets::Small2DShapes(), datasets::Large2DShapes()), - framework::dataset::make("DataType", DataType::U8)), - shape, data_type) -{ - // Setup Distribution - std::mt19937 gen(library->seed()); - std::uniform_int_distribution<size_t> distribution_size_t(1, 30); - const size_t num_bins = distribution_size_t(gen); - std::uniform_int_distribution<int32_t> distribution_int32_t(0, 125); - const size_t offset = distribution_int32_t(gen); - std::uniform_int_distribution<uint32_t> distribution_uint32_t(1, 255 - offset); - const size_t range = distribution_uint32_t(gen); - CLDistribution1D distribution_dst(num_bins, offset, range); - - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, data_type); - TensorShape dst_shape(num_bins); - CLTensor dst = create_tensor<CLTensor>(dst_shape, DataType::U32); - - ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS); - - // Create and configure function - CLHistogram histogram; - histogram.configure(&src, &distribution_dst); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(src.info()->valid_region(), valid_region); - const ValidRegion valid_region_dst = shape_to_valid_region(dst_shape); - validate(dst.info()->valid_region(), valid_region_dst); - - // Validate padding - const PaddingSize padding; - validate(src.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - template <typename T> using CLHistogramFixture = HistogramValidationFixture<CLTensor, CLAccessor, CLHistogram, T, CLDistribution1D>; diff --git a/tests/validation/CL/IntegralImage.cpp b/tests/validation/CL/IntegralImage.cpp index 74c5a4aa95..700628cbfc 100644 --- a/tests/validation/CL/IntegralImage.cpp +++ b/tests/validation/CL/IntegralImage.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -37,30 +37,6 @@ namespace validation { TEST_SUITE(CL) TEST_SUITE(IntegralImage) - -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), 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, DataType::U32); - - ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS); - - // Create and configure function - CLIntegralImage integral_image; - integral_image.configure(&src, &dst); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - 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 CLIntegralImageFixture = IntegralImageValidationFixture<CLTensor, CLAccessor, CLIntegralImage, T>; diff --git a/tests/validation/CL/LaplacianPyramid.cpp b/tests/validation/CL/LaplacianPyramid.cpp index 1307f78526..3096d32976 100644 --- a/tests/validation/CL/LaplacianPyramid.cpp +++ b/tests/validation/CL/LaplacianPyramid.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Arm Limited. + * Copyright (c) 2018-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -20,7 +20,7 @@ * 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/CLPyramid.h" #include "arm_compute/runtime/CL/CLTensor.h" @@ -78,39 +78,6 @@ TEST_SUITE(LaplacianPyramid) // *INDENT-OFF* // clang-format off -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine( - concat(datasets::Medium2DShapes(), datasets::Large2DShapes()), - datasets::BorderModes()), - large_laplacian_pyramid_levels), - shape, border_mode, num_levels) -{ - // Create pyramid info - PyramidInfo pyramid_info(num_levels, SCALE_PYRAMID_HALF, shape, Format::S16); - CLPyramid dst_pyramid{}; - dst_pyramid.init(pyramid_info); - - // Create Tensors - CLTensor src = create_tensor<CLTensor>(shape, Format::U8); - - // The first two dimensions of the output tensor must match the first two - // dimensions of the tensor in the last level of the pyramid - TensorShape dst_shape(shape); - dst_shape.set(0, dst_pyramid.get_pyramid_level(num_levels - 1)->info()->dimension(0)); - dst_shape.set(1, dst_pyramid.get_pyramid_level(num_levels - 1)->info()->dimension(1)); - CLTensor dst = create_tensor<CLTensor>(dst_shape, Format::S16); - - // Create and configure function - CLLaplacianPyramid laplacian_pyramid; - laplacian_pyramid.configure(&src, &dst_pyramid, &dst, border_mode, 0); - - ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS); - - for(size_t level = 0; level < pyramid_info.num_levels(); ++level) - { - ARM_COMPUTE_EXPECT(dst_pyramid.get_pyramid_level(level)->info()->is_resizable(), framework::LogLevel::ERRORS); - } -} using CLLaplacianPyramidFixture = LaplacianPyramidValidationFixture<CLTensor, CLAccessor, CLLaplacianPyramid, uint8_t, int16_t, CLPyramid>; diff --git a/tests/validation/CL/LaplacianReconstruct.cpp b/tests/validation/CL/LaplacianReconstruct.cpp index c2e1fab5b1..5aba380a5a 100644 --- a/tests/validation/CL/LaplacianReconstruct.cpp +++ b/tests/validation/CL/LaplacianReconstruct.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Arm Limited. + * Copyright (c) 2018-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -20,7 +20,7 @@ * 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/CLPyramid.h" #include "arm_compute/runtime/CL/functions/CLLaplacianPyramid.h" @@ -68,48 +68,6 @@ TEST_SUITE(LaplacianReconstruct) // *INDENT-OFF* // clang-format off -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine( - concat(datasets::Medium2DShapes(), datasets::Large2DShapes()), - datasets::BorderModes()), - large_laplacian_reconstruct_levels), - shape, border_mode, num_levels) -{ - // Create pyramid info - PyramidInfo pyramid_info(num_levels, SCALE_PYRAMID_HALF, shape, Format::S16); - CLPyramid dst_pyramid{}; - dst_pyramid.init(pyramid_info); - - // Create Tensors - CLTensor src = create_tensor<CLTensor>(shape, DataType::U8); - - // The first two dimensions of the output tensor must match the first two - // dimensions of the tensor in the last level of the pyramid - TensorShape dst_shape(shape); - dst_shape.set(0, dst_pyramid.get_pyramid_level(num_levels - 1)->info()->dimension(0)); - dst_shape.set(1, dst_pyramid.get_pyramid_level(num_levels - 1)->info()->dimension(1)); - CLTensor dst = create_tensor<CLTensor>(dst_shape, DataType::S16); - - // The dimensions of the reconstruct are the same as the src shape - CLTensor rec_dst = create_tensor<CLTensor>(shape, DataType::U8); - - // Create and configure pyramid function - CLLaplacianPyramid laplacian_pyramid; - laplacian_pyramid.configure(&src, &dst_pyramid, &dst, border_mode, 0); - - // Create and configure reconstruct function - CLLaplacianReconstruct laplacian_reconstruct; - laplacian_reconstruct.configure(&dst_pyramid, &dst, &rec_dst, border_mode, 0); - - ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS); - - for(size_t level = 0; level < pyramid_info.num_levels(); ++level) - { - ARM_COMPUTE_EXPECT(dst_pyramid.get_pyramid_level(level)->info()->is_resizable(), framework::LogLevel::ERRORS); - } - - ARM_COMPUTE_EXPECT(rec_dst.info()->is_resizable(), framework::LogLevel::ERRORS); -} using CLLaplacianReconstructFixture = LaplacianReconstructValidationFixture<CLTensor, CLAccessor, CLLaplacianReconstruct, CLLaplacianPyramid, int16_t, uint8_t, CLPyramid>; diff --git a/tests/validation/CL/Magnitude.cpp b/tests/validation/CL/Magnitude.cpp index 82bce34d84..f5133e8ce2 100644 --- a/tests/validation/CL/Magnitude.cpp +++ b/tests/validation/CL/Magnitude.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -49,39 +49,11 @@ AbsoluteTolerance<T> tolerance(MagnitudeType magnitude_type) TEST_SUITE(CL) TEST_SUITE(Magnitude) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), framework::dataset::make("DataType", { DataType::S16, DataType::S32 })), - 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 (default MagnitudeType::L2NORM) - CLMagnitude magnitude; - magnitude.configure(&src1, &src2, &dst); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - 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 CLMagnitudeFixture = MagnitudeValidationFixture<CLTensor, CLAccessor, CLMagnitude, T>; TEST_SUITE(S16) -FIXTURE_DATA_TEST_CASE(RunSmall, CLMagnitudeFixture<int16_t>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::Small2DShapes(), framework::dataset::make("Format", Format::S16)), +FIXTURE_DATA_TEST_CASE(RunSmall, CLMagnitudeFixture<int16_t>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallShapes(), framework::dataset::make("Format", Format::S16)), framework::dataset::make("MagnitudeType", { MagnitudeType::L1NORM, MagnitudeType::L2NORM }))) { // Validate output @@ -97,7 +69,7 @@ FIXTURE_DATA_TEST_CASE(RunLarge, CLMagnitudeFixture<int16_t>, framework::Dataset TEST_SUITE_END() // S16 TEST_SUITE(S32) -FIXTURE_DATA_TEST_CASE(RunSmall, CLMagnitudeFixture<int32_t>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::Small2DShapes(), framework::dataset::make("Format", Format::S32)), +FIXTURE_DATA_TEST_CASE(RunSmall, CLMagnitudeFixture<int32_t>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallShapes(), framework::dataset::make("Format", Format::S32)), framework::dataset::make("MagnitudeType", { MagnitudeType::L1NORM, MagnitudeType::L2NORM }))) { // Validate output diff --git a/tests/validation/CL/MeanStdDev.cpp b/tests/validation/CL/MeanStdDev.cpp index d69d8c2801..dd59193707 100644 --- a/tests/validation/CL/MeanStdDev.cpp +++ b/tests/validation/CL/MeanStdDev.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -63,31 +63,6 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip( // clang-format on // *INDENT-ON* -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::Small2DShapes(), 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>; diff --git a/tests/validation/CL/Median3x3.cpp b/tests/validation/CL/Median3x3.cpp index b61e7c0f3f..0a8936f3c0 100644 --- a/tests/validation/CL/Median3x3.cpp +++ b/tests/validation/CL/Median3x3.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -49,42 +49,6 @@ constexpr BorderSize border_size(filter_size / 2); /* Border size of the kerne TEST_SUITE(CL) TEST_SUITE(Median3x3) - -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::U8)), - datasets::BorderModes()), - shape, data_type, border_mode) -{ - // 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 - CLMedian3x3 median3x3; - median3x3.configure(&src, &dst, border_mode); - - // Validate valid region - const ValidRegion dst_valid_region = shape_to_valid_region(shape, (border_mode == BorderMode::UNDEFINED), border_size); - validate(dst.info()->valid_region(), dst_valid_region); - - // Validate padding - PaddingCalculator calculator(shape.x(), 8); - calculator.set_border_size(1); - calculator.set_border_mode(border_mode); - - const PaddingSize dst_padding = calculator.required_padding(); - - calculator.set_accessed_elements(16); - calculator.set_access_offset(-1); - - const PaddingSize src_padding = calculator.required_padding(); - - validate(src.info()->padding(), src_padding); - validate(dst.info()->padding(), dst_padding); -} - template <typename T> using CLMedian3x3Fixture = Median3x3ValidationFixture<CLTensor, CLAccessor, CLMedian3x3, T>; diff --git a/tests/validation/CL/MinMaxLocation.cpp b/tests/validation/CL/MinMaxLocation.cpp index e4a17187c4..0131cd8cf1 100644 --- a/tests/validation/CL/MinMaxLocation.cpp +++ b/tests/validation/CL/MinMaxLocation.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -42,35 +42,7 @@ TEST_SUITE(MinMaxLocation) template <typename T> using CLMinMaxLocationFixture = MinMaxLocationValidationFixture<CLTensor, CLAccessor, CLArray<Coordinates2D>, CLArrayAccessor<Coordinates2D>, CLMinMaxLocation, T>; -void validate_configuration(const CLTensor &src, TensorShape shape) -{ - ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS); - - // Create output storage - int32_t min = 0; - int32_t max = 0; - CLCoordinates2DArray min_loc(shape.total_size()); - CLCoordinates2DArray max_loc(shape.total_size()); - - // Create and configure function - CLMinMaxLocation min_max_loc; - min_max_loc.configure(&src, &min, &max, &min_loc, &max_loc); - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), 16).required_padding(); - validate(src.info()->padding(), padding); -} - TEST_SUITE(U8) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::Small2DShapes(), framework::dataset::make("DataType", DataType::U8)), shape, data_type) -{ - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, data_type); - src.info()->set_format(Format::U8); - - validate_configuration(src, shape); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLMinMaxLocationFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), framework::dataset::make("DataType", DataType::U8))) { @@ -86,15 +58,6 @@ FIXTURE_DATA_TEST_CASE(RunLarge, CLMinMaxLocationFixture<uint8_t>, framework::Da TEST_SUITE_END() // U8 TEST_SUITE(S16) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::Small2DShapes(), framework::dataset::make("DataType", DataType::S16)), shape, data_type) -{ - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, data_type); - src.info()->set_format(Format::S16); - - validate_configuration(src, shape); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLMinMaxLocationFixture<int16_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), framework::dataset::make("DataType", DataType::S16))) { @@ -110,15 +73,6 @@ FIXTURE_DATA_TEST_CASE(RunLarge, CLMinMaxLocationFixture<int16_t>, framework::Da TEST_SUITE_END() // S16 TEST_SUITE(Float) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::Small2DShapes(), framework::dataset::make("DataType", DataType::F32)), shape, data_type) -{ - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, data_type); - src.info()->set_format(Format::F32); - - validate_configuration(src, shape); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLMinMaxLocationFixture<float>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small2DShapes(), framework::dataset::make("DataType", DataType::F32))) { diff --git a/tests/validation/CL/NonLinearFilter.cpp b/tests/validation/CL/NonLinearFilter.cpp index 325849b45e..08b6e21497 100644 --- a/tests/validation/CL/NonLinearFilter.cpp +++ b/tests/validation/CL/NonLinearFilter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -41,52 +41,6 @@ namespace validation TEST_SUITE(CL) TEST_SUITE(NonLinearFilter) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallShapes(), datasets::NonLinearFilterFunctions()), - framework::dataset::make("MaskSize", { 3U, 5U })), - datasets::MatrixPatterns()), - datasets::BorderModes()), - shape, function, mask_size, pattern, border_mode) -{ - std::mt19937 generator(library->seed()); - std::uniform_int_distribution<uint8_t> distribution_u8(0, 255); - const uint8_t constant_border_value = distribution_u8(generator); - - // Create the mask - std::vector<uint8_t> mask(mask_size * mask_size); - fill_mask_from_pattern(mask.data(), mask_size, mask_size, pattern); - const auto half_mask_size = static_cast<int>(mask_size / 2); - - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, DataType::U8); - CLTensor dst = create_tensor<CLTensor>(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 - CLNonLinearFilter filter; - filter.configure(&src, &dst, function, mask_size, pattern, mask.data(), border_mode, constant_border_value); - - // Validate valid region - const ValidRegion dst_valid_region = shape_to_valid_region(shape, border_mode == BorderMode::UNDEFINED, BorderSize(half_mask_size)); - validate(dst.info()->valid_region(), dst_valid_region); - - // Validate padding - PaddingCalculator calculator(shape.x(), ((MatrixPattern::OTHER == pattern) ? 1 : 8)); - calculator.set_border_mode(border_mode); - calculator.set_border_size(half_mask_size); - - const PaddingSize write_padding = calculator.required_padding(PaddingCalculator::Option::EXCLUDE_BORDER); - - calculator.set_accessed_elements(16); - calculator.set_access_offset(-half_mask_size); - - const PaddingSize read_padding = calculator.required_padding(PaddingCalculator::Option::INCLUDE_BORDER); - - validate(src.info()->padding(), read_padding); - validate(dst.info()->padding(), write_padding); -} - template <typename T> using CLNonLinearFilterFixture = NonLinearFilterValidationFixture<CLTensor, CLAccessor, CLNonLinearFilter, T>; diff --git a/tests/validation/CL/NormalizePlanarYUVLayer.cpp b/tests/validation/CL/NormalizePlanarYUVLayer.cpp index 58c3b82cd0..1e410a9c6f 100644 --- a/tests/validation/CL/NormalizePlanarYUVLayer.cpp +++ b/tests/validation/CL/NormalizePlanarYUVLayer.cpp @@ -54,31 +54,6 @@ TEST_SUITE(NormalizePlanarYUVLayer) template <typename T> using CLNormalizePlanarYUVLayerFixture = NormalizePlanarYUVLayerValidationFixture<CLTensor, CLAccessor, CLNormalizePlanarYUVLayer, T>; -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(datasets::RandomNormalizePlanarYUVLayerDataset(), framework::dataset::make("DataType", { DataType::F16 })), - framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), - shape0, shape1, dt, data_layout) -{ - TensorShape src_dst_shapes = shape0; - if(data_layout == DataLayout::NHWC) - { - permute(src_dst_shapes, PermutationVector(2U, 0U, 1U)); - } - - // Create tensors - CLTensor src = create_tensor<CLTensor>(src_dst_shapes, dt, 1, QuantizationInfo(), data_layout); - CLTensor dst = create_tensor<CLTensor>(src_dst_shapes, dt, 1, QuantizationInfo(), data_layout); - CLTensor mean = create_tensor<CLTensor>(shape1, dt, 1); - CLTensor sd = create_tensor<CLTensor>(shape1, dt, 1); - - // Create and Configure function - CLNormalizePlanarYUVLayer norm; - norm.configure(&src, &dst, &mean, &sd); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(src_dst_shapes); - validate(dst.info()->valid_region(), valid_region); -} - // *INDENT-OFF* // clang-format off DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip( diff --git a/tests/validation/CL/PReluLayer.cpp b/tests/validation/CL/PReluLayer.cpp index 832bac21e2..f06409d2fe 100644 --- a/tests/validation/CL/PReluLayer.cpp +++ b/tests/validation/CL/PReluLayer.cpp @@ -101,29 +101,6 @@ template <typename T> using CLPReluLayerFixture = PReluLayerValidationFixture<CLTensor, CLAccessor, CLPReluLayer, T>; TEST_SUITE(U8) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, datasets::SmallShapes(), - shape) -{ - // Create tensors - CLTensor ref_src1 = create_tensor<CLTensor>(shape, DataType::U8); - CLTensor ref_src2 = create_tensor<CLTensor>(shape, DataType::U8); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::U8); - - // Create and Configure function - CLPReluLayer prelu; - prelu.configure(&ref_src1, &ref_src2, &dst); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), num_elems_processed_per_iteration).required_padding(); - validate(ref_src1.info()->padding(), padding); - validate(ref_src2.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLPReluLayerFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), PReluLayerU8Dataset)) { // Validate output @@ -136,29 +113,6 @@ using CLPReluLayerQuantizedFixture = PReluLayerValidationQuantizedFixture<CLTens TEST_SUITE(Quantized) TEST_SUITE(QASYMM8) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, datasets::SmallShapes(), - shape) -{ - // Create tensors - CLTensor ref_src1 = create_tensor<CLTensor>(shape, DataType::QASYMM8); - CLTensor ref_src2 = create_tensor<CLTensor>(shape, DataType::QASYMM8); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::QASYMM8); - - // Create and Configure function - CLPReluLayer prelu; - prelu.configure(&ref_src1, &ref_src2, &dst); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), num_elems_processed_per_iteration).required_padding(); - validate(ref_src1.info()->padding(), padding); - validate(ref_src2.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLPReluLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallShapes(), PReluLayerQASYMM8Dataset), framework::dataset::make("QuantizationInfo", { QuantizationInfo(5.f / 255.f, 20) })), @@ -188,29 +142,6 @@ TEST_SUITE_END() TEST_SUITE_END() TEST_SUITE(S16) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), framework::dataset::make("DataType", { DataType::U8, DataType::S16 })), - shape, data_type) -{ - // Create tensors - CLTensor ref_src1 = create_tensor<CLTensor>(shape, data_type); - CLTensor ref_src2 = create_tensor<CLTensor>(shape, DataType::S16); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::S16); - - // Create and Configure function - CLPReluLayer prelu; - prelu.configure(&ref_src1, &ref_src2, &dst); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), num_elems_processed_per_iteration).required_padding(); - validate(ref_src1.info()->padding(), padding); - validate(ref_src2.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLPReluLayerFixture<int16_t>, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), PReluLayerS16Dataset)) { // Validate output @@ -228,28 +159,6 @@ FIXTURE_DATA_TEST_CASE(RunSmall, CLPReluLayerFixture<half>, framework::DatasetMo TEST_SUITE_END() TEST_SUITE(FP32) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, datasets::SmallShapes(), shape) -{ - // Create tensors - CLTensor ref_src1 = create_tensor<CLTensor>(shape, DataType::F32); - CLTensor ref_src2 = create_tensor<CLTensor>(shape, DataType::F32); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::F32); - - // Create and Configure function - CLPReluLayer prelu; - prelu.configure(&ref_src1, &ref_src2, &dst); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const PaddingSize padding = PaddingCalculator(shape.x(), num_elems_processed_per_iteration).required_padding(); - validate(ref_src1.info()->padding(), padding); - validate(ref_src2.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLPReluLayerFixture<float>, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), PReluLayerFP32Dataset)) { // Validate output diff --git a/tests/validation/CL/Permute.cpp b/tests/validation/CL/Permute.cpp index ed5d18b8de..9caae81089 100644 --- a/tests/validation/CL/Permute.cpp +++ b/tests/validation/CL/Permute.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 Arm Limited. + * Copyright (c) 2018-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -120,29 +120,6 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip( // clang-format on // *INDENT-ON* -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::Small4DShapes(), framework::dataset::make("DataType", { DataType::S8, DataType::U8, DataType::S16, DataType::U16, DataType::U32, DataType::S32, DataType::F16, DataType::F32 })), - shape, data_type) -{ - // Define permutation vector - const PermutationVector perm(2U, 0U, 1U); - - // Permute shapes - TensorShape output_shape = shape; - permute(output_shape, perm); - - // Create tensors - CLTensor ref_src = create_tensor<CLTensor>(shape, data_type); - CLTensor dst = create_tensor<CLTensor>(output_shape, data_type); - - // Create and Configure function - CLPermute perm_func; - perm_func.configure(&ref_src, &dst, perm); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(output_shape); - validate(dst.info()->valid_region(), valid_region); -} - #ifndef DOXYGEN_SKIP_THIS template <typename T> diff --git a/tests/validation/CL/Phase.cpp b/tests/validation/CL/Phase.cpp index 71ac66951d..137815040a 100644 --- a/tests/validation/CL/Phase.cpp +++ b/tests/validation/CL/Phase.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -45,38 +45,11 @@ constexpr AbsoluteTolerance<uint8_t> tolerance_value(1); TEST_SUITE(CL) TEST_SUITE(Phase) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), framework::dataset::make("DataType", { DataType::S16, DataType::S32 })), - 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, DataType::U8); - - 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 - CLPhase phase; - phase.configure(&src1, &src2, &dst); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - 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 CLPhaseFixture = PhaseValidationFixture<CLTensor, CLAccessor, CLPhase, T>; TEST_SUITE(S16) -FIXTURE_DATA_TEST_CASE(RunSmall, CLPhaseFixture<int16_t>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::Small2DShapes(), framework::dataset::make("Format", Format::S16)), +FIXTURE_DATA_TEST_CASE(RunSmall, CLPhaseFixture<int16_t>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallShapes(), framework::dataset::make("Format", Format::S16)), framework::dataset::make("PhaseType", { PhaseType::SIGNED, PhaseType::UNSIGNED }))) { // Validate output @@ -92,7 +65,7 @@ FIXTURE_DATA_TEST_CASE(RunLarge, CLPhaseFixture<int16_t>, framework::DatasetMode TEST_SUITE_END() // S16 TEST_SUITE(S32) -FIXTURE_DATA_TEST_CASE(RunSmall, CLPhaseFixture<int32_t>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::Small2DShapes(), framework::dataset::make("Format", Format::S32)), +FIXTURE_DATA_TEST_CASE(RunSmall, CLPhaseFixture<int32_t>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallShapes(), framework::dataset::make("Format", Format::S32)), framework::dataset::make("PhaseType", { PhaseType::SIGNED, PhaseType::UNSIGNED }))) { // Validate output diff --git a/tests/validation/CL/QuantizationLayer.cpp b/tests/validation/CL/QuantizationLayer.cpp index 0953688554..335d8df293 100644 --- a/tests/validation/CL/QuantizationLayer.cpp +++ b/tests/validation/CL/QuantizationLayer.cpp @@ -74,29 +74,6 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip( // clang-format on // *INDENT-ON* -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(QuantizationSmallShapes, framework::dataset::make("DataType", DataType::F32)), shape, data_type) -{ - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, data_type); - CLTensor dst = create_tensor<CLTensor>(shape, DataType::QASYMM8); - - ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS); - - // Create and configure function - CLQuantizationLayer 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 - validate(src.info()->padding(), PaddingSize()); - validate(dst.info()->padding(), PaddingSize()); -} - template <typename T> using CLQuantizationLayerQASYMM8Fixture = QuantizationValidationFixture<CLTensor, CLAccessor, CLQuantizationLayer, T, uint8_t>; template <typename T> diff --git a/tests/validation/CL/Remap.cpp b/tests/validation/CL/Remap.cpp index d849d6c1a3..802e611eba 100644 --- a/tests/validation/CL/Remap.cpp +++ b/tests/validation/CL/Remap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -49,41 +49,6 @@ constexpr float tolerance_number = 0.2f; TEST_SUITE(CL) TEST_SUITE(Remap) - -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(combine(datasets::SmallShapes(), framework::dataset::make("InterpolationPolicy", { InterpolationPolicy::NEAREST_NEIGHBOR, InterpolationPolicy::BILINEAR })), - framework::dataset::make("DataType", DataType::U8)), - framework::dataset::make("BorderModes", { BorderMode::UNDEFINED, BorderMode::CONSTANT })), - shape, policy, data_type, border_mode) -{ - CLTensor src = create_tensor<CLTensor>(shape, data_type); - CLTensor map_x = create_tensor<CLTensor>(shape, DataType::F32); - CLTensor map_y = create_tensor<CLTensor>(shape, DataType::F32); - CLTensor dst = create_tensor<CLTensor>(shape, data_type); - - ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(map_x.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(map_y.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS); - - // Create and configure function - CLRemap remap; - remap.configure(&src, &map_x, &map_y, &dst, policy, border_mode); - - // Validate valid region - const ValidRegion dst_valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), dst_valid_region); - - // Validate padding - const int total_right = ceil_to_multiple(shape[0], 4); - const int access_right = total_right + (((total_right - shape[0]) == 0) ? 1 : 0); - - const PaddingSize read_padding(1, access_right - shape[0], 1, 1); - validate(src.info()->padding(), read_padding); - - PaddingCalculator calculator(shape.x(), 4); - validate(dst.info()->padding(), calculator.required_padding()); -} - template <typename T> using CLRemapFixture = RemapValidationFixture<CLTensor, CLAccessor, CLRemap, T>; diff --git a/tests/validation/CL/ReorgLayer.cpp b/tests/validation/CL/ReorgLayer.cpp index 339b368487..d09744ca21 100644 --- a/tests/validation/CL/ReorgLayer.cpp +++ b/tests/validation/CL/ReorgLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 Arm Limited. + * Copyright (c) 2018-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -67,44 +67,6 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip( // clang-format on // *INDENT-ON* -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(datasets::SmallReorgLayerDataset(), - framework::dataset::make("DataType", { DataType::F32, DataType::F16, DataType::QASYMM8 })), - framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), - shape, stride, data_type, data_layout) -{ - // Permute the tensor shape in case of NHWC data layout - TensorShape shape_to_use = shape; - if(data_layout == DataLayout::NHWC) - { - permute(shape_to_use, PermutationVector(2U, 0U, 1U)); - } - - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape_to_use, data_type, 1, QuantizationInfo(), data_layout); - CLTensor dst; - - ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS); - - // Create and configure function - CLReorgLayer reorg_layer; - - // Auto-initialize the output within the function - reorg_layer.configure(&src, &dst, stride); - - // Validate valid region - const ValidRegion src_valid_region = shape_to_valid_region(shape_to_use); - const ValidRegion dst_valid_region = shape_to_valid_region(dst.info()->tensor_shape()); - validate(src.info()->valid_region(), src_valid_region); - validate(dst.info()->valid_region(), dst_valid_region); - - // Validate padding - const int step = 1; - const PaddingSize src_padding = PaddingCalculator(shape_to_use.x(), step).required_padding(); - const PaddingSize dst_padding = PaddingCalculator(dst.info()->tensor_shape().x(), step).required_padding(); - validate(src.info()->padding(), src_padding); - validate(dst.info()->padding(), dst_padding); -} - template <typename T> using CLReorgLayerFixture = ReorgLayerValidationFixture<CLTensor, CLAccessor, CLReorgLayer, T>; diff --git a/tests/validation/CL/Scharr.cpp b/tests/validation/CL/Scharr.cpp index fa6b48f68d..541490b01f 100644 --- a/tests/validation/CL/Scharr.cpp +++ b/tests/validation/CL/Scharr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -44,57 +44,6 @@ TEST_SUITE(Scharr) TEST_SUITE(W3x3) using CLScharr3x3Fixture = ScharrValidationFixture<CLTensor, CLAccessor, CLScharr3x3, uint8_t, int16_t>; -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format", - Format::U8)), - shape, border_mode, format) -{ - // Generate a random constant value - std::mt19937 gen(library->seed()); - std::uniform_int_distribution<uint8_t> int_dist(0, 255); - const uint8_t constant_border_value = int_dist(gen); - - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, data_type_from_format(format)); - CLTensor dst_x = create_tensor<CLTensor>(shape, DataType::S16); - CLTensor dst_y = create_tensor<CLTensor>(shape, DataType::S16); - - src.info()->set_format(format); - dst_x.info()->set_format(Format::S16); - dst_y.info()->set_format(Format::S16); - - ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(dst_x.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(dst_y.info()->is_resizable(), framework::LogLevel::ERRORS); - - // Create scharr 3x3 configure function - CLScharr3x3 scharr; - scharr.configure(&src, &dst_x, &dst_y, border_mode, constant_border_value); - - // Validate valid region - constexpr BorderSize border_size{ 1 }; - const ValidRegion dst_valid_region = shape_to_valid_region(shape, border_mode == BorderMode::UNDEFINED, border_size); - - validate(dst_x.info()->valid_region(), dst_valid_region); - validate(dst_y.info()->valid_region(), dst_valid_region); - - // Validate padding - PaddingCalculator calculator(shape.x(), 8); - - calculator.set_border_mode(border_mode); - calculator.set_border_size(1); - - const PaddingSize dst_padding = calculator.required_padding(); - - calculator.set_accessed_elements(16); - calculator.set_access_offset(-1); - - const PaddingSize src_padding = calculator.required_padding(); - - validate(src.info()->padding(), src_padding); - validate(dst_x.info()->padding(), dst_padding); - validate(dst_y.info()->padding(), dst_padding); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLScharr3x3Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format", Format::U8)), datasets::GradientDimensions())) diff --git a/tests/validation/CL/Select.cpp b/tests/validation/CL/Select.cpp index 13a8cf4930..3d7c61aab5 100644 --- a/tests/validation/CL/Select.cpp +++ b/tests/validation/CL/Select.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 Arm Limited. + * Copyright (c) 2018-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -98,37 +98,6 @@ using CLSelectFixture = SelectValidationFixture<CLTensor, CLAccessor, CLSelect, TEST_SUITE(Float) TEST_SUITE(F16) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, run_small_dataset, - shape, same_rank) -{ - const DataType dt = DataType::F16; - - // Create tensors - CLTensor ref_c = create_tensor<CLTensor>(detail::select_condition_shape(shape, same_rank), DataType::U8); - CLTensor ref_x = create_tensor<CLTensor>(shape, dt); - CLTensor ref_y = create_tensor<CLTensor>(shape, dt); - CLTensor dst = create_tensor<CLTensor>(shape, dt); - - // Create and Configure function - CLSelect select; - select.configure(&ref_c, &ref_x, &ref_y, &dst); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const int step = 16 / arm_compute::data_size_from_type(dt); - const PaddingSize padding = PaddingCalculator(shape.x(), step).required_padding(); - if(same_rank) - { - validate(ref_c.info()->padding(), padding); - } - validate(ref_x.info()->padding(), padding); - validate(ref_y.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLSelectFixture<half>, framework::DatasetMode::PRECOMMIT, @@ -149,37 +118,6 @@ FIXTURE_DATA_TEST_CASE(RunLarge, TEST_SUITE_END() // F16 TEST_SUITE(FP32) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, run_small_dataset, - shape, same_rank) -{ - const DataType dt = DataType::F32; - - // Create tensors - CLTensor ref_c = create_tensor<CLTensor>(detail::select_condition_shape(shape, same_rank), DataType::U8); - CLTensor ref_x = create_tensor<CLTensor>(shape, dt); - CLTensor ref_y = create_tensor<CLTensor>(shape, dt); - CLTensor dst = create_tensor<CLTensor>(shape, dt); - - // Create and Configure function - CLSelect select; - select.configure(&ref_c, &ref_x, &ref_y, &dst); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const int step = 16 / arm_compute::data_size_from_type(dt); - const PaddingSize padding = PaddingCalculator(shape.x(), step).required_padding(); - if(same_rank) - { - validate(ref_c.info()->padding(), padding); - } - validate(ref_x.info()->padding(), padding); - validate(ref_y.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLSelectFixture<float>, framework::DatasetMode::PRECOMMIT, @@ -202,37 +140,6 @@ TEST_SUITE_END() // Float TEST_SUITE(Quantized) TEST_SUITE(QASYMM8) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, run_small_dataset, - shape, same_rank) -{ - const DataType dt = DataType::QASYMM8; - - // Create tensors - CLTensor ref_c = create_tensor<CLTensor>(detail::select_condition_shape(shape, same_rank), DataType::U8); - CLTensor ref_x = create_tensor<CLTensor>(shape, dt); - CLTensor ref_y = create_tensor<CLTensor>(shape, dt); - CLTensor dst = create_tensor<CLTensor>(shape, dt); - - // Create and Configure function - CLSelect select; - select.configure(&ref_c, &ref_x, &ref_y, &dst); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - validate(dst.info()->valid_region(), valid_region); - - // Validate padding - const int step = 16 / arm_compute::data_size_from_type(dt); - const PaddingSize padding = PaddingCalculator(shape.x(), step).required_padding(); - if(same_rank) - { - validate(ref_c.info()->padding(), padding); - } - validate(ref_x.info()->padding(), padding); - validate(ref_y.info()->padding(), padding); - validate(dst.info()->padding(), padding); -} - FIXTURE_DATA_TEST_CASE(RunSmall, CLSelectFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, diff --git a/tests/validation/CL/Slice.cpp b/tests/validation/CL/Slice.cpp index 50b880e656..919ab9d367 100644 --- a/tests/validation/CL/Slice.cpp +++ b/tests/validation/CL/Slice.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Arm Limited. + * Copyright (c) 2018-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -63,24 +63,6 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip( // clang-format on // *INDENT-ON* -DATA_TEST_CASE(Configuration, - framework::DatasetMode::ALL, - combine(arm_compute::test::datasets::SmallSliceDataset(), framework::dataset::make("DataType", { DataType::F16, DataType::F32 })), - shape, starts, ends, data_type) -{ - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, data_type); - CLTensor dst; - - // Create and Configure function - CLSlice slice; - slice.configure(&src, &dst, starts, ends); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(dst.info()->tensor_shape()); - validate(dst.info()->valid_region(), valid_region); -} - template <typename T> using CLSliceFixture = SliceFixture<CLTensor, CLAccessor, CLSlice, T>; diff --git a/tests/validation/CL/Sobel.cpp b/tests/validation/CL/Sobel.cpp index 3670003898..725c879c47 100644 --- a/tests/validation/CL/Sobel.cpp +++ b/tests/validation/CL/Sobel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -49,57 +49,6 @@ TEST_SUITE(Sobel) TEST_SUITE(W3x3) using CLSobel3x3Fixture = SobelValidationFixture<CLTensor, CLAccessor, CLSobel3x3, uint8_t, int16_t>; -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format", - Format::U8)), - shape, border_mode, format) -{ - // Generate a random constant value - std::mt19937 gen(library->seed()); - std::uniform_int_distribution<uint8_t> int_dist(0, 255); - const uint8_t constant_border_value = int_dist(gen); - - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, data_type_from_format(format)); - CLTensor dst_x = create_tensor<CLTensor>(shape, DataType::S16); - CLTensor dst_y = create_tensor<CLTensor>(shape, DataType::S16); - - src.info()->set_format(format); - dst_x.info()->set_format(Format::S16); - dst_y.info()->set_format(Format::S16); - - ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(dst_x.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(dst_y.info()->is_resizable(), framework::LogLevel::ERRORS); - - // Create sobel 3x3 configure function - CLSobel3x3 sobel; - sobel.configure(&src, &dst_x, &dst_y, border_mode, constant_border_value); - - // Validate valid region - constexpr BorderSize border_size{ 1 }; - const ValidRegion dst_valid_region = shape_to_valid_region(shape, border_mode == BorderMode::UNDEFINED, border_size); - - validate(dst_x.info()->valid_region(), dst_valid_region); - validate(dst_y.info()->valid_region(), dst_valid_region); - - // Validate padding - PaddingCalculator calculator(shape.x(), 8); - - calculator.set_border_mode(border_mode); - calculator.set_border_size(1); - - const PaddingSize dst_padding = calculator.required_padding(); - - calculator.set_accessed_elements(16); - calculator.set_access_offset(-1); - - const PaddingSize src_padding = calculator.required_padding(); - - validate(src.info()->padding(), src_padding); - validate(dst_x.info()->padding(), dst_padding); - validate(dst_y.info()->padding(), dst_padding); -} - TEST_SUITE(X) FIXTURE_DATA_TEST_CASE(RunSmall, CLSobel3x3Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format", Format::U8)), @@ -170,56 +119,6 @@ TEST_SUITE_END() TEST_SUITE(W5x5) using CLSobel5x5Fixture = SobelValidationFixture<CLTensor, CLAccessor, CLSobel5x5, uint8_t, int16_t>; -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format", - Format::U8)), - shape, border_mode, format) -{ - // Generate a random constant value - std::mt19937 gen(library->seed()); - std::uniform_int_distribution<uint8_t> int_dist(0, 255); - const uint8_t constant_border_value = int_dist(gen); - - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, data_type_from_format(format)); - CLTensor dst_x = create_tensor<CLTensor>(shape, DataType::S16); - CLTensor dst_y = create_tensor<CLTensor>(shape, DataType::S16); - - src.info()->set_format(format); - dst_x.info()->set_format(Format::S16); - dst_y.info()->set_format(Format::S16); - - ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(dst_x.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(dst_y.info()->is_resizable(), framework::LogLevel::ERRORS); - - // Create sobel 5x5 configure function - CLSobel5x5 sobel; - sobel.configure(&src, &dst_x, &dst_y, border_mode, constant_border_value); - - // Validate valid region - constexpr BorderSize border_size{ 2 }; - const ValidRegion dst_valid_region = shape_to_valid_region(shape, border_mode == BorderMode::UNDEFINED, border_size); - - validate(dst_x.info()->valid_region(), dst_valid_region); - validate(dst_y.info()->valid_region(), dst_valid_region); - - // Validate padding - PaddingCalculator calculator(shape.x(), 8); - calculator.set_border_mode(border_mode); - calculator.set_border_size(2); - - const PaddingSize dst_padding = calculator.required_padding(); - - calculator.set_accessed_elements(16); - calculator.set_access_offset(-2); - - const PaddingSize src_padding = calculator.required_padding(); - - validate(src.info()->padding(), src_padding); - validate(dst_x.info()->padding(), dst_padding); - validate(dst_y.info()->padding(), dst_padding); -} - TEST_SUITE(X) FIXTURE_DATA_TEST_CASE(RunSmall, CLSobel5x5Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format", Format::U8)), @@ -288,56 +187,6 @@ TEST_SUITE_END() TEST_SUITE(W7x7) using CLSobel7x7Fixture = SobelValidationFixture<CLTensor, CLAccessor, CLSobel7x7, uint8_t, int32_t>; -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format", - Format::U8)), - shape, border_mode, format) -{ - // Generate a random constant value - std::mt19937 gen(library->seed()); - std::uniform_int_distribution<uint8_t> int_dist(0, 255); - const uint8_t constant_border_value = int_dist(gen); - - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, data_type_from_format(format)); - CLTensor dst_x = create_tensor<CLTensor>(shape, DataType::S32); - CLTensor dst_y = create_tensor<CLTensor>(shape, DataType::S32); - - src.info()->set_format(format); - dst_x.info()->set_format(Format::S32); - dst_y.info()->set_format(Format::S32); - - ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(dst_x.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(dst_y.info()->is_resizable(), framework::LogLevel::ERRORS); - - // Create sobel 7x7 configure function - CLSobel7x7 sobel; - sobel.configure(&src, &dst_x, &dst_y, border_mode, constant_border_value); - - // Validate valid region - constexpr BorderSize border_size{ 3 }; - const ValidRegion dst_valid_region = shape_to_valid_region(shape, border_mode == BorderMode::UNDEFINED, border_size); - - validate(dst_x.info()->valid_region(), dst_valid_region); - validate(dst_y.info()->valid_region(), dst_valid_region); - - // Validate padding - PaddingCalculator calculator(shape.x(), 8); - - calculator.set_border_mode(border_mode); - calculator.set_border_size(3); - - const PaddingSize dst_padding = calculator.required_padding(); - - calculator.set_accessed_elements(16); - calculator.set_access_offset(-3); - - const PaddingSize src_padding = calculator.required_padding(); - - validate(src.info()->padding(), src_padding); - validate(dst_x.info()->padding(), dst_padding); - validate(dst_y.info()->padding(), dst_padding); -} TEST_SUITE(X) FIXTURE_DATA_TEST_CASE(RunSmall, CLSobel7x7Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format", Format::U8)), diff --git a/tests/validation/CL/SoftmaxLayer.cpp b/tests/validation/CL/SoftmaxLayer.cpp index 0e4952b02a..76289cab44 100644 --- a/tests/validation/CL/SoftmaxLayer.cpp +++ b/tests/validation/CL/SoftmaxLayer.cpp @@ -63,42 +63,6 @@ const auto CNNDataTypes = framework::dataset::make("DataType", TEST_SUITE(CL) TEST_SUITE(SoftmaxLayer) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::SoftmaxLayerSmallShapes(), CNNDataTypes), shape, data_type) -{ - const QuantizationInfo quantization_info = is_data_type_quantized_asymmetric(data_type) ? QuantizationInfo(1.f / 255.f, 0) : QuantizationInfo(); - - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, data_type, 1, quantization_info); - CLTensor dst = create_tensor<CLTensor>(shape, data_type, 1, QuantizationInfo(1.f / 256.f, 0)); - - 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); - - // CLLogits1DMaxShiftExpSumKernel configures the paddings only in the 2D case - if(shape.num_dimensions() <= 2) - { - // Get reduction kernel info - CLLogits1DMaxShiftExpSumKernel::ParallelReductionInfo reduction_info = CLLogits1DMaxShiftExpSumKernel::is_parallel_reduction(shape.x()); - - // Validate src padding for 2D softmax - const PaddingSize padding_src = PaddingCalculator(shape.x(), std::get<1>(reduction_info)).required_padding(); - validate(src.info()->padding(), padding_src); - - // Validate dst padding for 2D softmax - const PaddingSize padding_dst = PaddingCalculator(shape.x(), 16).required_padding(); - validate(dst.info()->padding(), padding_dst); - } -} - // *INDENT-OFF* // clang-format off DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip( diff --git a/tests/validation/CL/Split.cpp b/tests/validation/CL/Split.cpp index 99110ffa79..7e6c6f9e92 100644 --- a/tests/validation/CL/Split.cpp +++ b/tests/validation/CL/Split.cpp @@ -91,66 +91,6 @@ DATA_TEST_CASE(ValidateSplitShapes, framework::DatasetMode::ALL, zip(zip(zip( // clang-format on // *INDENT-ON* -DATA_TEST_CASE(Configuration, - framework::DatasetMode::ALL, - combine(datasets::SmallSplitDataset(), framework::dataset::make("DataType", { DataType::F16, DataType::F32 })), - shape, axis, splits, data_type) -{ - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, data_type); - std::vector<CLTensor> dsts(splits); - std::vector<ICLTensor *> dsts_ptrs; - dsts_ptrs.reserve(splits); - for(auto &dst : dsts) - { - dsts_ptrs.emplace_back(&dst); - } - - // Create and Configure function - CLSplit split; - split.configure(&src, dsts_ptrs, axis); - - // Validate valid regions - for(auto &dst : dsts) - { - const ValidRegion valid_region = shape_to_valid_region(dst.info()->tensor_shape()); - validate(dst.info()->valid_region(), valid_region); - } -} - -DATA_TEST_CASE(ConfigurationSplitShapes, - framework::DatasetMode::ALL, - combine(datasets::SmallSplitShapesDataset(), framework::dataset::make("DataType", { DataType::F16, DataType::F32 })), - shape, axis, split_shapes, data_type) -{ - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, data_type); - std::vector<CLTensor> dsts; - - for(const auto &split_shape : split_shapes) - { - CLTensor dst = create_tensor<CLTensor>(split_shape, data_type); - dsts.push_back(std::move(dst)); - } - - std::vector<ICLTensor *> dsts_ptrs; - for(auto &dst : dsts) - { - dsts_ptrs.emplace_back(&dst); - } - - // Create and Configure function - CLSplit split; - split.configure(&src, dsts_ptrs, axis); - - // Validate valid regions - for(auto &dst : dsts) - { - const ValidRegion valid_region = shape_to_valid_region(dst.info()->tensor_shape()); - validate(dst.info()->valid_region(), valid_region); - } -} - template <typename T> using CLSplitFixture = SplitFixture<CLTensor, ICLTensor, CLAccessor, CLSplit, T>; @@ -182,6 +122,18 @@ FIXTURE_DATA_TEST_CASE(RunLarge, validate(CLAccessor(_target[i]), _reference[i]); } } + +FIXTURE_DATA_TEST_CASE(RunSmallSplitShapes, + CLSplitShapesFixture<half>, + framework::DatasetMode::PRECOMMIT, + combine(datasets::SmallSplitShapesDataset(), framework::dataset::make("DataType", DataType::F16))) +{ + // Validate outputs + for(unsigned int i = 0; i < _target.size(); ++i) + { + validate(CLAccessor(_target[i]), _reference[i]); + } +} TEST_SUITE_END() // FP16 TEST_SUITE(FP32) diff --git a/tests/validation/CL/StridedSlice.cpp b/tests/validation/CL/StridedSlice.cpp index 9bfad55404..1fcdf3ed29 100644 --- a/tests/validation/CL/StridedSlice.cpp +++ b/tests/validation/CL/StridedSlice.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -65,24 +65,6 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip( // clang-format on // *INDENT-ON* -DATA_TEST_CASE(Configuration, - framework::DatasetMode::ALL, - combine(arm_compute::test::datasets::SmallStridedSliceDataset(), framework::dataset::make("DataType", { DataType::F16, DataType::F32 })), - shape, starts, ends, strides, begin_mask, end_mask, shrink_mask, data_type) -{ - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, data_type); - CLTensor dst; - - // Create and Configure function - CLStridedSlice strided_slice; - strided_slice.configure(&src, &dst, starts, ends, strides, begin_mask, end_mask, shrink_mask); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(dst.info()->tensor_shape()); - validate(dst.info()->valid_region(), valid_region); -} - template <typename T> using CLStridedSliceFixture = StridedSliceFixture<CLTensor, CLAccessor, CLStridedSlice, T>; diff --git a/tests/validation/CL/TableLookup.cpp b/tests/validation/CL/TableLookup.cpp index b611ef6bd9..93e313096c 100644 --- a/tests/validation/CL/TableLookup.cpp +++ b/tests/validation/CL/TableLookup.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -51,42 +51,7 @@ TEST_SUITE(TableLookup) template <typename T> using CLTableLookupFixture = TableLookupValidationFixture<CLTensor, CLAccessor, CLTableLookup, CLLutAccessor<T>, CLLut, T>; TEST_SUITE(U8) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), framework::dataset::make("DataType", { DataType::U8, DataType::S16 })), - shape, data_type) -{ - // Create Lut - const int num_elem = (data_type == DataType::U8) ? std::numeric_limits<uint8_t>::max() + 1 : std::numeric_limits<int16_t>::max() - std::numeric_limits<int16_t>::lowest() + 1; - CLLut cllut(num_elem, data_type); - - switch(data_type) - { - case DataType::U8: - fill_lookuptable(CLLutAccessor<uint8_t>(cllut)); - break; - case DataType::S16: - fill_lookuptable(CLLutAccessor<int16_t>(cllut)); - break; - default: - ARM_COMPUTE_ERROR("Not supported"); - } - - // Create tensors - CLTensor src = create_tensor<CLTensor>(shape, data_type); - CLTensor dst = create_tensor<CLTensor>(shape, data_type); - // Create and Configure function - CLTableLookup table_lookup; - table_lookup.configure(&src, &cllut, &dst); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - 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); -} FIXTURE_DATA_TEST_CASE(RunSmallU8, CLTableLookupFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::U8))) { // Validate output diff --git a/tests/validation/CL/Threshold.cpp b/tests/validation/CL/Threshold.cpp index 215565ea6c..d5346d3d1f 100644 --- a/tests/validation/CL/Threshold.cpp +++ b/tests/validation/CL/Threshold.cpp @@ -39,31 +39,6 @@ namespace validation TEST_SUITE(CL) TEST_SUITE(Threshold) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(datasets::SmallShapes(), datasets::MixedThresholdDataset()), - framework::dataset::make("DataType", DataType::U8)), - shape, threshold, false_value, true_value, type, upper, 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 - CLThreshold thrsh; - thrsh.configure(&src, &dst, ThresholdKernelInfo(threshold, false_value, true_value, type, upper)); - - // Validate valid region - const ValidRegion valid_region = shape_to_valid_region(shape); - 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 CLThresholdFixture = ThresholdValidationFixture<CLTensor, CLAccessor, CLThreshold, T>; diff --git a/tests/validation/CL/Transpose.cpp b/tests/validation/CL/Transpose.cpp index 3a1a27d8e4..876bf29dd5 100644 --- a/tests/validation/CL/Transpose.cpp +++ b/tests/validation/CL/Transpose.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -68,27 +68,6 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip( // clang-format on // *INDENT-ON* -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::Small2DShapes(), framework::dataset::make("DataType", { DataType::S8, DataType::U8, DataType::S16, DataType::U16, DataType::U32, DataType::S32, DataType::F16, DataType::F32 })), - shape, data_type) -{ - // Make rows the columns of the original shape - TensorShape output_shape{ shape[1], shape[0] }; - - // Create tensors - CLTensor ref_src = create_tensor<CLTensor>(shape, data_type); - CLTensor dst = create_tensor<CLTensor>(output_shape, data_type); - - // Create and Configure function - CLTranspose trans; - trans.configure(&ref_src, &dst); - - // Validate dst region - const ValidRegion valid_region = shape_to_valid_region(output_shape); - validate(dst.info()->valid_region(), valid_region); - - // TODO(bsgcomp): Add padding validation (COMPMID-659) -} - template <typename T> using CLTransposeFixture = TransposeValidationFixture<CLTensor, CLAccessor, CLTranspose, T>; diff --git a/tests/validation/CL/WarpAffine.cpp b/tests/validation/CL/WarpAffine.cpp index 7779761f1f..2dacb9fe98 100644 --- a/tests/validation/CL/WarpAffine.cpp +++ b/tests/validation/CL/WarpAffine.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -54,47 +54,6 @@ constexpr AbsoluteTolerance<uint8_t> tolerance(1); TEST_SUITE(CL) TEST_SUITE(WarpAffine) -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) -{ - // Generate a random constant value if border_mode is constant - std::mt19937 gen(library->seed()); - std::uniform_int_distribution<uint8_t> distribution_u8(0, 255); - uint8_t constant_border_value = distribution_u8(gen); - - // Create the matrix - std::array<float, 9> matrix{ {} }; - fill_warp_matrix<9>(matrix); - - // 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 - CLWarpAffine warp_affine; - warp_affine.configure(&src, &dst, matrix, policy, border_mode, constant_border_value); - - // 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 - int total_right = ceil_to_multiple(shape[0], 4); - const int access_right = total_right + (((total_right - shape[0]) == 0) ? 1 : 0); - const PaddingSize read_padding(1, access_right - shape[0], 1, 1); - validate(src.info()->padding(), read_padding); - - PaddingCalculator calculator(shape.x(), 4); - validate(dst.info()->padding(), calculator.required_padding()); -} - template <typename T> using CLWarpAffineFixture = WarpAffineValidationFixture<CLTensor, CLAccessor, CLWarpAffine, T>; diff --git a/tests/validation/CL/WarpPerspective.cpp b/tests/validation/CL/WarpPerspective.cpp index 4b975057fc..b934b70184 100644 --- a/tests/validation/CL/WarpPerspective.cpp +++ b/tests/validation/CL/WarpPerspective.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018 Arm Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -50,53 +50,6 @@ constexpr float tolerance_number = 0.2f; TEST_SUITE(CL) TEST_SUITE(WarpPerspective) -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) -{ - uint8_t constant_border_value = 0; - - // Generate a random constant value if border_mode is constant - if(border_mode == BorderMode::CONSTANT) - { - std::mt19937 gen(library->seed()); - std::uniform_int_distribution<uint8_t> distribution_u8(0, 255); - constant_border_value = distribution_u8(gen); - } - - // Create the matrix - std::array<float, 9> matrix = { { 0 } }; - fill_warp_matrix<9>(matrix); - - // 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 - CLWarpPerspective warp_perspective; - warp_perspective.configure(&src, &dst, matrix, policy, border_mode, constant_border_value); - - // 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 - PaddingCalculator calculator(shape.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 CLWarpPerspectiveFixture = WarpPerspectiveValidationFixture<CLTensor, CLAccessor, CLWarpPerspective, T>; diff --git a/tests/validation/CL/WidthConcatenateLayer.cpp b/tests/validation/CL/WidthConcatenateLayer.cpp index 408fe148d7..ded1f29ce3 100644 --- a/tests/validation/CL/WidthConcatenateLayer.cpp +++ b/tests/validation/CL/WidthConcatenateLayer.cpp @@ -84,28 +84,6 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip( // clang-format on // *INDENT-ON* -TEST_CASE(Configuration, framework::DatasetMode::ALL) -{ - // Create tensors - CLTensor src1 = create_tensor<CLTensor>(TensorShape(128U, 32U, 32U), DataType::F32, 1); - CLTensor src2 = create_tensor<CLTensor>(TensorShape(32U, 32U, 32U), DataType::F32, 1); - CLTensor src3 = create_tensor<CLTensor>(TensorShape(15U, 32U, 32U), DataType::F32, 1); - CLTensor dst; - - ARM_COMPUTE_EXPECT(src1.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(src2.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(src3.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS); - - // Create and configure function - CLConcatenateLayer concat_layer; - std::vector<const ICLTensor *> inputs; - inputs.emplace_back(&src1); - inputs.emplace_back(&src2); - inputs.emplace_back(&src3); - concat_layer.configure(inputs, &dst, 0); -} - template <typename T> using CLWidthConcatenateLayerFixture = ConcatenateLayerValidationFixture<CLTensor, ICLTensor, CLAccessor, CLConcatenateLayer, T>; |