Compute Library
 22.11
Cast.cpp File Reference
#include "arm_compute/core/Types.h"
#include "arm_compute/runtime/NEON/functions/NECast.h"
#include "arm_compute/runtime/Tensor.h"
#include "arm_compute/runtime/TensorAllocator.h"
#include "src/common/cpuinfo/CpuIsaInfo.h"
#include "src/cpu/kernels/CpuCastKernel.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/CastFixture.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
 

Macros

#define CAST_SUITE(NAME, idt, odt, type, dataset, tolerance)
 

Typedefs

template<typename T >
using NECastToU8Fixture = CastValidationFixture< Tensor, Accessor, NECast, T, uint8_t >
 
template<typename T >
using NECastToU16Fixture = CastValidationFixture< Tensor, Accessor, NECast, T, uint16_t >
 
template<typename T >
using NECastToS16Fixture = CastValidationFixture< Tensor, Accessor, NECast, T, int16_t >
 
template<typename T >
using NECastToU32Fixture = CastValidationFixture< Tensor, Accessor, NECast, T, uint32_t >
 
template<typename T >
using NECastToS32Fixture = CastValidationFixture< Tensor, Accessor, NECast, T, int32_t >
 
template<typename T >
using NECastToF16Fixture = CastValidationFixture< Tensor, Accessor, NECast, T, half >
 
template<typename T >
using NECastToF32Fixture = CastValidationFixture< Tensor, Accessor, NECast, T, float >
 
template<typename T >
using NECastToQASYMM8Fixture = CastValidationFixture< Tensor, Accessor, NECast, T, uint8_t >
 
template<typename T >
using NECastToQASYMM8_SIGNEDFixture = CastValidationFixture< Tensor, Accessor, NECast, T, int8_t >
 

Functions

 TEST_SUITE (QASYMM8_SIGNED_to_S16) FIXTURE_DATA_TEST_CASE(RunSmall
 
 combine (combine(datasets::SmallShapes(), CastQASYMM8_SIGNEDtoS16Dataset), datasets::ConvertPolicies()))
 
 TEST_SUITE_END () FIXTURE_DATA_TEST_CASE(RunSmall = ActivationValidationQuantizedFixture<CLTensor, CLAccessor, CLActivationLayer, T>
 [CLActivationLayer Test snippet] More...
 
 combine (combine(datasets::SmallShapes(), CastQASYMM8_SIGNEDtoS32Dataset), datasets::ConvertPolicies()))
 
 combine (combine(datasets::SmallShapes(), CastQASYMM8_SIGNEDtoF32Dataset), datasets::ConvertPolicies()))
 
 combine (combine(datasets::SmallShapes(), CastQASYMM8toF32Dataset), datasets::ConvertPolicies()))
 
 combine (combine(datasets::SmallShapes(), CastQASYMM8toS32Dataset), datasets::ConvertPolicies()))
 
 combine (combine(datasets::SmallShapes(), CastU8toU16Dataset), datasets::ConvertPolicies()))
 
 combine (combine(datasets::SmallShapes(), CastU8toS16Dataset), datasets::ConvertPolicies()))
 
 combine (combine(datasets::SmallShapes(), CastU8toS32Dataset), datasets::ConvertPolicies()))
 
 combine (combine(datasets::SmallShapes(), CastU8toF32Dataset), datasets::ConvertPolicies()))
 
 combine (combine(datasets::SmallShapes(), CastU16toU8Dataset), datasets::ConvertPolicies()))
 
 combine (combine(datasets::SmallShapes(), CastU16toU32Dataset), datasets::ConvertPolicies()))
 
 combine (combine(datasets::SmallShapes(), CastS16toQASYMM8_SIGNEDDataset), datasets::ConvertPolicies()))
 
 combine (combine(datasets::SmallShapes(), CastS16toU8Dataset), datasets::ConvertPolicies()))
 
 combine (combine(datasets::SmallShapes(), CastS16toS32Dataset), datasets::ConvertPolicies()))
 
 combine (combine(datasets::SmallShapes(), CastS32toQASYMM8_SIGNEDDataset), datasets::ConvertPolicies()))
 
 combine (combine(datasets::SmallShapes(), CastS32toQASYMM8Dataset), datasets::ConvertPolicies()))
 
 combine (combine(datasets::SmallShapes(), CastS32toF32Dataset), datasets::ConvertPolicies()))
 
 combine (combine(datasets::SmallShapes(), CastS32toU8Dataset), datasets::ConvertPolicies()))
 
 combine (combine(datasets::SmallShapes(), CastF32toQASYMM8_SIGNEDDataset), datasets::ConvertPolicies()))
 
 combine (combine(datasets::SmallShapes(), CastF32toQASYMM8Dataset), datasets::ConvertPolicies()))
 
 combine (combine(datasets::SmallShapes(), CastF32toS32Dataset), datasets::ConvertPolicies()))
 
 combine (framework::dataset::make("CpuExt", std::string("NEON")), framework::dataset::make("DataType", { DataType::F16, DataType::U8, DataType::S32, DataType::QASYMM8, DataType::QASYMM8_SIGNED, DataType::BFLOAT16, }))
 
 if (cpu_isa.bf16)
 
 ARM_COMPUTE_ERROR_ON_NULLPTR (selected_impl)
 
 ARM_COMPUTE_EXPECT_EQUAL (expected, actual, framework::LogLevel::ERRORS)
 
 DATA_TEST_CASE (KernelSelectionSrcFP32, framework::DatasetMode::ALL, combine(framework::dataset::make("CpuExt", std::string("NEON")), framework::dataset::make("DataType", { DataType::F16, DataType::BFLOAT16, })), cpu_ext, data_type)
 

Variables

 NECastToS16Fixture< int8_t >
 
 NECastToS32Fixture< int8_t >
 
 NECastToF32Fixture< int8_t >
 
 NECastToF32Fixture< uint8_t >
 
 NECastToS32Fixture< uint8_t >
 
 NECastToU16Fixture< uint8_t >
 
 NECastToS16Fixture< uint8_t >
 
 NECastToU8Fixture< uint16_t >
 
 NECastToU32Fixture< uint16_t >
 
 NECastToQASYMM8_SIGNEDFixture< int16_t >
 
 NECastToU8Fixture< int16_t >
 
 NECastToS32Fixture< int16_t >
 
 NECastToQASYMM8_SIGNEDFixture< int32_t >
 
 NECastToQASYMM8Fixture< int32_t >
 
 NECastToF32Fixture< int32_t >
 
 NECastToU8Fixture< int32_t >
 
 NECastToQASYMM8_SIGNEDFixture< float >
 
 NECastToQASYMM8Fixture< float >
 
 NECastToS32Fixture< float >
 
 cpu_ext
 
 data_type
 
const CpuCastKernel::CastKernel * selected_impl = CpuCastKernel::get_implementation(CastDataTypeISASelectorData{ data_type, DataType::F16, cpu_isa }, cpu::KernelSelectionType::Preferred)
 
cpuinfo::CpuIsaInfo cpu_isa {}
 
cpu_isa neon = (cpu_ext == "NEON")
 
cpu_isa bf16 = (data_type == DataType::BFLOAT16)
 
 else
 
std::string actual = selected_impl->name
 

Macro Definition Documentation

◆ CAST_SUITE

#define CAST_SUITE (   NAME,
  idt,
  odt,
  type,
  dataset,
  tolerance 
)
Value:
TEST_SUITE(NAME) \
FIXTURE_DATA_TEST_CASE(RunSmall, type, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallShapes(), dataset), \
datasets::ConvertPolicies())) \
{ \
validate(Accessor(_target), _reference, tolerance); \
} \
TEST_SUITE_END()
decltype(strategy::transforms) typedef type
#define TEST_SUITE(SUITE_NAME)
Definition: Macros.h:34
combine(framework::dataset::make("CpuExt", std::string("NEON")), framework::dataset::make("DataType", { DataType::F16, DataType::U8, DataType::S32, DataType::QASYMM8, DataType::QASYMM8_SIGNED, DataType::BFLOAT16, }))

Definition at line 126 of file Cast.cpp.