33 #include "tests/datasets/LargeGEMMLowpDataset.h" 34 #include "tests/datasets/ShapeDatasets.h" 35 #include "tests/datasets/SmallGEMMLowpDataset.h" 40 #include "tests/validation/fixtures/GEMMLowpAssemblyFixture.h" 41 #include "tests/validation/fixtures/GEMMLowpFixture.h" 64 validate(Accessor(_target), _reference);
81 DATA_TEST_CASE(Configuration, framework::
DatasetMode::ALL, framework::dataset::
concat(datasets::SmallGEMMLowpDataset(), datasets::LargeGEMMLowpDataset()),
97 NEGEMMLowpMatrixMultiplyCore gemmlowp_mm;
98 gemmlowp_mm.configure(&a, &b, &c);
127 &b_info.clone()->set_is_resizable(
false),
128 &output_info.clone()->set_is_resizable(
false));
190 &b_info.clone()->set_is_resizable(
false),
191 &output_info.clone()->set_is_resizable(
false),
200 shape, result_offset, result_mult_int, result_shift, min, max, add_bias)
215 output_stage.
configure(&in, add_bias ? &bias :
nullptr, &out, result_offset, result_mult_int, result_shift, min, max);
220 validate(out.info()->valid_region(), valid_region);
226 validate(bias.info()->valid_region(), valid_region_bias);
232 validate(out.info()->padding(), padding);
236 validate(bias.info()->padding(), padding);
268 TEST_SUITE(QuantizeDownInt32ToUint8ScaleByFixedPoint)
279 GEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPointValidationFixture<Tensor, Accessor, NEGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPoint>;
309 &b_info.clone()->set_is_resizable(
false),
310 &output_info.clone()->set_is_resizable(
false),
319 quantize_down_int32_to_uint8_scale_by_fixedpoint_cases),
320 shape, result_fixedpoint_multiplier, result_shift, result_offset_after_shift, min, max, add_bias)
335 output_stage.
configure(&in, add_bias ? &bias :
nullptr, &out, result_fixedpoint_multiplier, result_shift, result_offset_after_shift, min, max);
340 validate(out.info()->valid_region(), valid_region);
346 validate(bias.info()->valid_region(), valid_region_bias);
352 validate(out.info()->padding(), padding);
356 validate(bias.info()->padding(), padding);
361 quantize_down_int32_to_uint8_scale_by_fixedpoint_cases))
368 quantize_down_int32_to_uint8_scale_by_fixedpoint_cases))
376 quantize_down_int32_to_uint8_scale_by_fixedpoint_relu_cases))
383 quantize_down_int32_to_uint8_scale_by_fixedpoint_relu_cases))
fixed_point< T > min(fixed_point< T > x, fixed_point< T > y)
GEMMLowpAssemblyFixture< Tensor, Accessor, NEGEMMLowpAssemblyMatrixMultiplyCore, int8_t > NEGEMMAssemblyFixture_S8
quantized, symmetric fixed-point 8-bit number
Container for 2D border size.
1 channel, 1 U8 per channel
void configure(const ITensor *input, const ITensor *bias, ITensor *output, int result_fixedpoint_multiplier, int result_shift, int result_offset_after_shift, int min=0, int max=0)
Initialise the kernel's inputs, output.
Basic function to execute NEGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPoint on NEON.
std::enable_if< is_container< T >::value, ContainerDataset< T > >::type make(std::string name, T &&values)
Helper function to create a ContainerDataset.
Basic function to execute matrix multiply assembly kernels.
Basic function to execute NEGEMMLowpQuantizeDownInt32ToUint8Scale on NEON.
This file contains all available output stages for GEMMLowp on OpenCL.
virtual ValidRegion valid_region() const =0
Valid region of the tensor.
#define TEST_SUITE(SUITE_NAME)
1 channel, 1 S32 per channel
virtual bool is_resizable() const =0
Flag indicating whether the size of the tensor can be changed.
FIXTURE_DATA_TEST_CASE(RunSmall, CLAbsoluteDifferenceFixture< uint8_t >, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), AbsoluteDifferenceU8Dataset))
validate(dst.info() ->valid_region(), dst_valid_region)
Accessor implementation for Tensor objects.
DatasetMode
Possible dataset modes.
const auto quantize_down_int32_to_uint8_scale_relu_cases
GEMMLowpMatrixMultiplyCoreValidationFixture< Tensor, Accessor, NEGEMMLowpMatrixMultiplyCore > NEGEMMLowpMatrixMultiplyCoreFixture
GEMMLowpQuantizeDownInt32ToUint8ScaleValidationFixture< Tensor, Accessor, NEGEMMLowpQuantizeDownInt32ToUint8Scale > NEGEMMLowpQuantizeDownInt32ToUint8ScaleFixture
quantized, asymmetric fixed-point 8-bit number
Basic implementation of the tensor interface.
static Status validate(const ITensorInfo *a, const ITensorInfo *b, const ITensorInfo *output, const GEMMInfo &gemm_info=GEMMInfo())
Static function to check if given info will lead to a valid configuration of NEGEMMLowpMatrixMultiply...
virtual PaddingSize padding() const =0
Padding of tensor.
virtual ITensorInfo & set_quantization_info(const QuantizationInfo &quantization_info)=0
Set the quantization settings (scale and offset) of the tensor.
static Status validate(const ITensorInfo *input, const ITensorInfo *bias, const ITensorInfo *output, int min=0, int max=0)
Static function to check if given info will lead to a valid configuration of NEGEMMLowpQuantizeDownIn...
DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), AbsoluteDifferenceU8Dataset), shape, data_type0, data_type1, output_data_type)
TEST_SUITE_END() DATA_TEST_CASE(Configuration
ARM_COMPUTE_EXPECT(src.info() ->is_resizable(), framework::LogLevel::ERRORS)
GEMMLowpAssemblyFixture< Tensor, Accessor, NEGEMMLowpAssemblyMatrixMultiplyCore, uint8_t > NEGEMMAssemblyFixture_U8
GEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPointValidationFixture< Tensor, Accessor, NEGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPoint > NEGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPointFixture
void configure(const ITensor *input, const ITensor *bias, ITensor *output, int result_offset, int result_mult_int, int result_shift, int min=0, int max=0)
Initialise the kernel's inputs, output.
combine(combine(combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), framework::dataset::make("DataType",{DataType::U8, DataType::S16})), datasets::BorderModes()), framework::dataset::make("filter_size",{5}))
Store the tensor's metadata.
fixed_point< T > max(fixed_point< T > x, fixed_point< T > y)
JoinDataset< T, U > concat(T &&dataset1, U &&dataset2)
Helper function to create a JoinDataset.
Quantization settings (used for QASYMM8 data type)
Container for valid region of a window.
static Status validate(const ITensorInfo *input, const ITensorInfo *bias, const ITensorInfo *output, int min=0, int max=0)
Static function to check if given info will lead to a valid configuration of NEGEMMLowpQuantizeDownIn...
Basic function to execute GEMMLowpMatrixMultiplyCore on NEON.
const auto quantize_down_int32_to_uint8_scale_by_fixedpoint_relu_cases
zip(zip(zip(framework::dataset::make("InputInfo",{TensorInfo(TensorShape(3U, 3U, 5U, 3U), 1, DataType::F16), TensorInfo(TensorShape(3U, 3U, 5U, 3U), 1, DataType::QASYMM8), TensorInfo(TensorShape(5U, 5U, 5U, 3U), 1, DataType::F32), TensorInfo(TensorShape(3U, 3U), 1, DataType::F32), TensorInfo(TensorShape(3U, 3U, 5U, 3U), 1, DataType::F32), TensorInfo(TensorShape(3U, 3U, 37U, 2U), 1, DataType::F32), TensorInfo(TensorShape(3U, 3U, 37U, 22U), 1, DataType::F32)}), framework::dataset::make("OutputInfo",{TensorInfo(TensorShape(3U, 5U, 16U), 1, DataType::F16), TensorInfo(TensorShape(3U, 5U, 16U), 1, DataType::QASYMM8), TensorInfo(TensorShape(3U, 5U, 16U), 1, DataType::F32), TensorInfo(TensorShape(1U, 1U, 16U), 1, DataType::F32), TensorInfo(TensorShape(3U, 5U, 16U), 1, DataType::F32), TensorInfo(TensorShape(2U, 37U, 16U), 1, DataType::F32), TensorInfo(TensorShape(22U, 37U, 36U), 1, DataType::F32)})), framework::dataset::make("WinogradInfo",{WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D(), PadStrideInfo(), DataLayout::NCHW), WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D(), PadStrideInfo(), DataLayout::NCHW), WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D(), PadStrideInfo(), DataLayout::NCHW), WinogradInfo(Size2D(3U, 3U), Size2D(3U, 3U), Size2D(), PadStrideInfo(), DataLayout::NCHW), WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D(), PadStrideInfo(), DataLayout::NCHW), WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D(), PadStrideInfo(), DataLayout::NCHW), WinogradInfo(Size2D(4U, 4U), Size2D(3U, 3U), Size2D(), PadStrideInfo(), DataLayout::NCHW)})), framework::dataset::make("Expected",{false, false, false, false, true, true, true}))
ValidRegion shape_to_valid_region(const TensorShape &a_shape, bool border_undefined=false, BorderSize border_size=BorderSize(0))
Create a valid region based on tensor shape, border mode and border size.
ITensorInfo * info() const override
Interface to be implemented by the child class to return the tensor's metadata.