Compute Library
 22.05
ArithmeticSubtraction.cpp File Reference
#include "arm_compute/core/Types.h"
#include "arm_compute/runtime/NEON/functions/NEArithmeticSubtraction.h"
#include "arm_compute/runtime/Tensor.h"
#include "arm_compute/runtime/TensorAllocator.h"
#include "tests/NEON/Accessor.h"
#include "tests/PaddingCalculator.h"
#include "tests/datasets/ConvertPolicyDataset.h"
#include "tests/datasets/ShapeDatasets.h"
#include "tests/framework/Asserts.h"
#include "tests/framework/Macros.h"
#include "tests/framework/datasets/Datasets.h"
#include "tests/validation/Validation.h"
#include "tests/validation/fixtures/ArithmeticOperationsFixture.h"

Go to the source code of this file.

Namespaces

 arm_compute
 Copyright (c) 2017-2022 Arm Limited.
 
 arm_compute::test
 
 arm_compute::test::validation
 

Typedefs

template<typename T >
using NEArithmeticSubtractionFixture = ArithmeticSubtractionValidationFixture< Tensor, Accessor, NEArithmeticSubtraction, T >
 
using NEArithmeticSubtractionQASYMM8SignedFixture = ArithmeticSubtractionValidationQuantizedFixture< Tensor, Accessor, NEArithmeticSubtraction, int8_t >
 
using NEArithmeticSubtractionQASYMM8SignedBroadcastFixture = ArithmeticSubtractionValidationQuantizedBroadcastFixture< Tensor, Accessor, NEArithmeticSubtraction, int8_t >
 
using NEArithmeticSubtractionQSYMM16Fixture = ArithmeticSubtractionValidationQuantizedFixture< Tensor, Accessor, NEArithmeticSubtraction, int16_t >
 
template<typename T >
using NEArithmeticSubtractionBroadcastFixture = ArithmeticSubtractionBroadcastValidationFixture< Tensor, Accessor, NEArithmeticSubtraction, T >
 

Functions

 DATA_TEST_CASE (Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(framework::dataset::make("Input1Info", { TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::U8), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(48U, 11U, 2U), 1, DataType::QASYMM8), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QASYMM8), }), framework::dataset::make("Input2Info",{ TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::S16), TensorInfo(TensorShape(48U, 11U, 2U), 1, DataType::F32), TensorInfo(TensorShape(48U, 11U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QASYMM8), })), framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::U8), TensorInfo(TensorShape(48U, 11U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QASYMM8), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QASYMM8), })), framework::dataset::make("ConvertPolicy",{ ConvertPolicy::SATURATE, ConvertPolicy::SATURATE, ConvertPolicy::WRAP, ConvertPolicy::WRAP, ConvertPolicy::WRAP, })), framework::dataset::make("Expected", { true, false, false, false, false})), input1_info, input2_info, output_info, policy, expected)
 
 TEST_CASE (SingleTensor, framework::DatasetMode::ALL)
 
 TEST_CASE (ValidBroadCast, framework::DatasetMode::ALL)
 
 TEST_CASE (InvalidBroadcastOutput, framework::DatasetMode::ALL)
 
 TEST_CASE (InvalidBroadcastBoth, framework::DatasetMode::ALL)
 
 TEST_SUITE_END () FIXTURE_DATA_TEST_CASE(RunSmall = ActivationValidationQuantizedFixture<CLTensor, CLAccessor, CLActivationLayer, T>
 [CLActivationLayer Test snippet] More...
 
 combine (combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::U8)), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), OutOfPlaceDataSet))
 
 FIXTURE_DATA_TEST_CASE (RunSmall, NEArithmeticSubtractionQASYMM8Fixture, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::QASYMM8)), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE })), ArithmeticSubtractionQuantizationInfoDataset), OutOfPlaceDataSet))
 
 combine (combine(combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE })), ArithmeticSubtractionQuantizationInfoSignedDataset), OutOfPlaceDataSet))
 
 FIXTURE_DATA_TEST_CASE (RunSmallBroadcast, NEArithmeticSubtractionQASYMM8SignedBroadcastFixture, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallShapesBroadcast(), framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE })), ArithmeticSubtractionQuantizationInfoSignedDataset), OutOfPlaceDataSet))
 
 FIXTURE_DATA_TEST_CASE (RunTinyBroadcastInPlace, NEArithmeticSubtractionQASYMM8SignedBroadcastFixture, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::TinyShapesBroadcastInplace(), framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE })), ArithmeticSubtractionQuantizationInfoSignedInPlaceDataset), InPlaceDataSet))
 
 combine (combine(combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::QSYMM16)), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE })), ArithmeticSubtractionQuantizationInfoSymmetric), OutOfPlaceDataSet))
 
 combine (combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::S16)), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), OutOfPlaceDataSet))
 
 FIXTURE_DATA_TEST_CASE (RunLarge, NEArithmeticSubtractionFixture< int16_t >, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeShapes(), framework::dataset::make("DataType", DataType::S16)), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), OutOfPlaceDataSet))
 
 combine (combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::S32)), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), OutOfPlaceDataSet))
 
 FIXTURE_DATA_TEST_CASE (RunLarge, NEArithmeticSubtractionFixture< int32_t >, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeShapes(), framework::dataset::make("DataType", DataType::S32)), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), OutOfPlaceDataSet))
 
 combine (combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F32)), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), InPlaceDataSet))
 
 FIXTURE_DATA_TEST_CASE (RunLarge, NEArithmeticSubtractionFixture< float >, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeShapes(), framework::dataset::make("DataType", DataType::F32)), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), OutOfPlaceDataSet))
 
 FIXTURE_DATA_TEST_CASE (RunSmallBroadcast, NEArithmeticSubtractionBroadcastFixture< float >, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallShapesBroadcast(), framework::dataset::make("DataType", DataType::F32)), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), OutOfPlaceDataSet))
 
 FIXTURE_DATA_TEST_CASE (RunLargeBroadcast, NEArithmeticSubtractionBroadcastFixture< float >, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeShapesBroadcast(), framework::dataset::make("DataType", DataType::F32)), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), OutOfPlaceDataSet))
 

Variables

 NEArithmeticSubtractionFixture< uint8_t >
 
 NEArithmeticSubtractionFixture< int16_t >
 
 NEArithmeticSubtractionFixture< int32_t >
 
 NEArithmeticSubtractionFixture< float >