32 #include "tests/datasets/ConvertPolicyDataset.h" 33 #include "tests/datasets/ShapeDatasets.h" 38 #include "tests/validation/fixtures/CastFixture.h" 48 constexpr AbsoluteTolerance<float> one_tolerance(1);
49 constexpr AbsoluteTolerance<float> zero_tolerance(0);
107 template <
typename T>
109 template <
typename T>
111 template <
typename T>
113 template <
typename T>
115 template <
typename T>
117 template <
typename T>
119 template <
typename T>
121 template <
typename T>
123 template <
typename T>
126 #define CAST_SUITE(NAME, idt, odt, type, dataset, tolerance) \ 128 FIXTURE_DATA_TEST_CASE(RunSmall, type, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallShapes(), dataset), \ 129 datasets::ConvertPolicies())) \ 131 validate(Accessor(_target), _reference, tolerance); \ 139 #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 141 #endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 144 #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 146 #endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 168 #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 170 #endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 175 #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 180 #endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 185 #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 187 #endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 204 using namespace cpu::kernels;
227 std::string
actual = selected_impl->name;
241 using namespace cpu::kernels;
253 std::string
actual = selected_impl->name;
Retrieve the best implementation available for the given Cpu ISA, ignoring the build flags...
1 channel, 1 U8 per channel
const CpuCastKernel::CastKernel * selected_impl
1 channel, 1 F32 per channel
CastValidationFixture< Tensor, Accessor, NECast, T, int32_t > NECastToS32Fixture
1 channel, 1 U16 per channel
std::enable_if< is_container< T >::value, ContainerDataset< T > >::type make(std::string name, T &&values)
Helper function to create a ContainerDataset.
#define CAST_SUITE(NAME, idt, odt, type, dataset, tolerance)
std::string lower_string(const std::string &val)
Lower a given string.
CastValidationFixture< Tensor, Accessor, NECast, T, int16_t > NECastToS16Fixture
Copyright (c) 2017-2022 Arm Limited.
cpuinfo::CpuIsaInfo cpu_isa
std::string cpu_impl_dt(const DataType &data_type)
Returns the suffix string of CPU kernel implementation names based on the given data type...
1 channel, 1 F16 per channel
1 channel, 1 S32 per channel
CPU ISA (Instruction Set Architecture) information.
16-bit brain floating-point number
DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QASYMM8), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::QASYMM8), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QSYMM16), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QSYMM16), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QSYMM16), }), framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F16), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QASYMM8), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::QASYMM8), TensorInfo(TensorShape(30U, 11U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QSYMM16, QuantizationInfo(1.f/32768.f, 0)), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QSYMM16, QuantizationInfo(1.f/32768.f, 0)), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QSYMM16, QuantizationInfo(1.f/32768.f, 0)), })), framework::dataset::make("ActivationInfo", { ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::TANH), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::TANH), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LOGISTIC), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::SQRT), })), framework::dataset::make("Expected", { false, true, true, true, false, false, true, true, false })), input_info, output_info, act_info, expected)
1 channel, 1 U32 per channel
TEST_SUITE_END() FIXTURE_DATA_TEST_CASE(RunSmall
[CLActivationLayer Test snippet]
quantized, asymmetric fixed-point 8-bit number unsigned
1 channel, 1 S16 per channel
CastValidationFixture< Tensor, Accessor, NECast, T, uint16_t > NECastToU16Fixture
CastValidationFixture< Tensor, Accessor, NECast, T, uint8_t > NECastToQASYMM8Fixture
CastValidationFixture< Tensor, Accessor, NECast, T, half > NECastToF16Fixture
CastValidationFixture< Tensor, Accessor, NECast, T, uint32_t > NECastToU32Fixture
ARM_COMPUTE_ERROR_ON_NULLPTR(selected_impl)
ARM_COMPUTE_EXPECT_EQUAL(expected, actual, framework::LogLevel::ERRORS)
quantized, asymmetric fixed-point 8-bit number signed
CastValidationFixture< Tensor, Accessor, NECast, T, float > NECastToF32Fixture
CastValidationFixture< Tensor, Accessor, NECast, T, uint8_t > NECastToU8Fixture
TEST_SUITE(QASYMM8_to_F32) FIXTURE_DATA_TEST_CASE(RunSmall
DataType
Available data types.
combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F32)))
CastValidationFixture< Tensor, Accessor, NECast, T, int8_t > NECastToQASYMM8_SIGNEDFixture