Compute Library
 22.05
ArithmeticAddition.cpp File Reference
#include "arm_compute/core/Types.h"
#include "arm_compute/runtime/NEON/functions/NEArithmeticAddition.h"
#include "arm_compute/runtime/Tensor.h"
#include "arm_compute/runtime/TensorAllocator.h"
#include "src/common/cpuinfo/CpuIsaInfo.h"
#include "src/cpu/kernels/CpuAddKernel.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 NEArithmeticAdditionFixture = ArithmeticAdditionValidationFixture< Tensor, Accessor, NEArithmeticAddition, T >
 
template<typename T >
using NEArithmeticAdditionBroadcastFixture = ArithmeticAdditionBroadcastValidationFixture< Tensor, Accessor, NEArithmeticAddition, T >
 
template<typename T >
using NEArithmeticAdditionQuantizedBroadcastFixture = ArithmeticAdditionValidationQuantizedBroadcastFixture< Tensor, Accessor, NEArithmeticAddition, T >
 

Functions

 DATA_TEST_CASE (Validate, framework::DatasetMode::ALL, zip(zip(zip(framework::dataset::make("Input1Info", { TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::U8), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::U8), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), }), framework::dataset::make("Input2Info",{ TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(1U, 13U, 2U), 1, DataType::S16), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::S16), TensorInfo(TensorShape(48U, 11U, 2U), 1, DataType::F32), })), framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::S16), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::U8), TensorInfo(TensorShape(48U, 11U, 2U), 1, DataType::F32), })), framework::dataset::make("Expected", { true, false, false, false})), input1_info, input2_info, output_info, expected)
 
 DATA_TEST_CASE (KernelSelection, framework::DatasetMode::ALL, concat(concat(combine(framework::dataset::make("CpuExt", std::string("NEON")), framework::dataset::make("DataType", { DataType::F32, DataType::F16, DataType::U8, DataType::S16, DataType::S32, DataType::QASYMM8, DataType::QASYMM8_SIGNED, DataType::QSYMM16 })), combine(framework::dataset::make("CpuExt", std::string("SVE")), framework::dataset::make("DataType", { DataType::F32, DataType::F16, DataType::U8, DataType::S16, DataType::S32 }))), combine(framework::dataset::make("CpuExt", std::string("SVE2")), framework::dataset::make("DataType", { DataType::QASYMM8, DataType::QASYMM8_SIGNED, DataType::QSYMM16 }))), cpu_ext, data_type)
 
 TEST_CASE (NoPaddingAdded, framework::DatasetMode::PRECOMMIT)
 
 FIXTURE_DATA_TEST_CASE (RunSmall, NEArithmeticAdditionFixture< uint8_t >, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::U8)), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), OutOfPlaceDataSet))
 
 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::S16)), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), OutOfPlaceDataSet))
 
 FIXTURE_DATA_TEST_CASE (RunLarge, NEArithmeticAdditionFixture< 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))
 
 combine (combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F32)), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), OutOfPlaceDataSet))
 
 FIXTURE_DATA_TEST_CASE (RunLarge, NEArithmeticAdditionFixture< 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, NEArithmeticAdditionBroadcastFixture< 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, NEArithmeticAdditionBroadcastFixture< float >, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeShapesBroadcast(), framework::dataset::make("DataType", DataType::F32)), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), OutOfPlaceDataSet))
 
 FIXTURE_DATA_TEST_CASE (RunSmall, NEArithmeticAdditionQuantizedFixture< uint8_t >, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::QASYMM8)), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE })), framework::dataset::make("Src0QInfo", { QuantizationInfo(5.f/255.f, 20) })), framework::dataset::make("Src1QInfo", { QuantizationInfo(2.f/255.f, 10) })), framework::dataset::make("OutQInfo", { QuantizationInfo(1.f/255.f, 5) })), OutOfPlaceDataSet))
 
 combine (combine(combine(combine(combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE })), framework::dataset::make("Src0QInfo", { QuantizationInfo(0.5f, 20) })), framework::dataset::make("Src1QInfo", { QuantizationInfo(0.5f, 10) })), framework::dataset::make("OutQInfo", { QuantizationInfo(0.5f, 5) })), OutOfPlaceDataSet))
 
 FIXTURE_DATA_TEST_CASE (RunSmallBroadcast, NEArithmeticAdditionQuantizedBroadcastFixture< int8_t >, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(datasets::SmallShapesBroadcast(), framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE })), framework::dataset::make("Src0QInfo", { QuantizationInfo(0.5f, 20) })), framework::dataset::make("Src1QInfo", { QuantizationInfo(0.5f, 10) })), framework::dataset::make("OutQInfo", { QuantizationInfo(0.5f, 5) })), OutOfPlaceDataSet))
 
 combine (combine(combine(combine(combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::QSYMM16)), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE })), framework::dataset::make("Src0QInfo", { QuantizationInfo(1.f/32768.f, 0), QuantizationInfo(5.f/32768.f, 0) })), framework::dataset::make("Src1QInfo", { QuantizationInfo(2.f/32768.f, 0), QuantizationInfo(5.f/32768.f, 0) })), framework::dataset::make("OutQInfo", { QuantizationInfo(5.f/32768.f, 0) })), OutOfPlaceDataSet))
 

Variables

 NEArithmeticAdditionFixture< int16_t >
 
 NEArithmeticAdditionFixture< int32_t >
 
 NEArithmeticAdditionFixture< float >
 
 NEArithmeticAdditionQuantizedFixture< int8_t >
 
 NEArithmeticAdditionQuantizedFixture< int16_t >