24 #ifndef ARM_COMPUTE_TEST_QUANTIZATION_LAYER_FIXTURE
25 #define ARM_COMPUTE_TEST_QUANTIZATION_LAYER_FIXTURE
45 template <
typename TensorType,
typename AccessorType,
typename FunctionType,
typename T>
49 template <
typename...>
52 _target = compute_target(shape, data_type);
53 _reference = compute_reference(shape, data_type);
60 library->fill_tensor_uniform(tensor, 0);
71 quantization_layer.configure(&src, &dst);
77 src.allocator()->allocate();
78 dst.allocator()->allocate();
84 fill(AccessorType(src));
87 quantization_layer.run();
95 SimpleTensor<T> src{
shape, data_type };
100 return reference::quantization_layer<T>(src);
103 TensorType _target{};
104 SimpleTensor<uint8_t> _reference{};
107 template <
typename TensorType,
typename AccessorType,
typename FunctionType,
typename T>
111 template <
typename...>
ARM_COMPUTE_EXPECT(shape.num_dimensions()==dimension+1, framework::LogLevel::ERRORS)
std::unique_ptr< AssetsLibrary > library
void setup()
Setup function.
void setup(TensorShape shape, DataType data_type)
DataType
Available data types.
void setup(TensorShape shape, DataType data_type)
__kernel void quantization_layer(__global uchar *input_ptr, uint input_stride_x, uint input_step_x, uint input_stride_y, uint input_step_y, uint input_stride_z, uint input_step_z, uint input_offset_first_element_in_bytes, __global uchar *output_ptr, uint output_stride_x, uint output_step_x, uint output_stride_y, uint output_step_y, uint output_stride_z, uint output_step_z, uint output_offset_first_element_in_bytes, __global uchar *min_max_ptr, uint min_max_stride_x, uint min_max_step_x, uint min_max_offset_first_element_in_bytes)
This performs the quantization of floating point inputs to 8-bit unsigned integers.