23.11
|
Namespaces | |
benchmark | |
colorconvert_helper | |
convolution_3d | |
detail | |
framework | |
traits | |
validation | |
Data Structures | |
class | Accessor |
Accessor implementation for Tensor objects. More... | |
class | ArrayAccessor |
ArrayAccessor implementation for Array objects. More... | |
class | AssetsLibrary |
Factory class to create and fill tensors. More... | |
class | CLAccessor |
Accessor implementation for CLTensor objects. More... | |
class | CLArrayAccessor |
Accessor implementation for CLArray objects. More... | |
class | CLSynthetizeFunction |
This template synthetizes an ICLSimpleFunction which runs the given kernel K. More... | |
class | CLSynthetizeFunctionInitOutputWithZeroAndWithZeroConstantBorder |
As above but this also initializes to zero the input tensor. More... | |
class | CLSynthetizeFunctionWithZeroConstantBorder |
As above but this also setups a Zero border on the input tensor of the specified bordersize. More... | |
class | CLSynthetizeOperator |
This template synthetizes a simple IOperator which runs the given kernel K. More... | |
class | CLSynthetizeOperatorInitOutputWithZeroAndWithZeroConstantBorder |
As above but this also initializes to zero the input tensor. More... | |
class | ClSynthetizeOperatorWithBorder |
As above but this also setups a Zero border on the input tensor of the kernel's bordersize. More... | |
struct | common_promoted_signed_type |
Find the signed promoted common type. More... | |
struct | common_promoted_unsigned_type |
Find the unsigned promoted common type. More... | |
class | ContextSchedulerUser |
struct | ContextType |
struct | ContextType< Tensor > |
class | IAccessor |
Common interface to provide information and access to tensor like structures. More... | |
class | IArrayAccessor |
Common interface to provide information and access to array like structures. More... | |
class | NESynthetizeFunction |
This template synthetizes an INESimpleFunction which runs the given kernel K. More... | |
class | NESynthetizeFunctionWithZeroConstantBorder |
As above but this also setups a Zero border on the input tensor of the specified bordersize. More... | |
class | NESynthetizeFunctionWithZeroConstantKernelBorder |
As above but this also setups a Zero border on the input tensor of the kernel's bordersize. More... | |
class | PaddingCalculator |
Calculate required padding. More... | |
class | ParametersLibrary |
Class that contains all the global parameters used by the tests. More... | |
class | RawTensor |
Subclass of SimpleTensor using uint8_t as value type. More... | |
class | SimpleTensor |
Simple tensor object that stores elements in a consecutive chunk of memory. More... | |
class | SimpleTensorAccessor |
Accessor implementation for SimpleTensor objects. More... | |
class | TensorCache |
Stores RawTensor categorised by the image they are created from including name, format and channel. More... | |
Functions | |
template<typename O , typename F , typename... As> | |
void | apply (O *obj, F &&func, const std::tuple< As... > &args) |
template<typename T , typename std::enable_if< std::is_same< typename T::value_type, std::string >::value, int >::type = 0> | |
std::string | join (T first, T last, const std::string &separator) |
Helper function to concatenate multiple strings. More... | |
template<typename T , typename UnaryOp > | |
std::string | join (T &&first, T &&last, const std::string &separator, UnaryOp &&op) |
Helper function to concatenate multiple values. More... | |
template<typename T , typename std::enable_if< std::is_arithmetic< typename T::value_type >::value, int >::type = 0> | |
std::string | join (T &&first, T &&last, const std::string &separator) |
Helper function to concatenate multiple values. More... | |
std::string | tolower (std::string string) |
Convert string to lower case. More... | |
template<typename T , typename std::enable_if< std::is_arithmetic< T >::value, int >::type = 0> | |
std::string | arithmetic_to_string (T val, int decimal_places=0) |
Create a string with the arithmetic value in full precision. More... | |
void | sleep_in_seconds (float seconds) |
Makes the calling thread to sleep for a specified number of seconds. More... | |
template<typename D , typename T , typename... Ts> | |
void | fill_tensors (D &&dist, std::initializer_list< int > seeds, T &&tensor, Ts &&... other_tensors) |
template<typename T1 , typename T2 > | |
SimpleTensor< T1 > | copy_tensor (const SimpleTensor< T2 > &tensor) |
template<typename T1 , typename T2 , typename std::enable_if< std::is_same< T1, T2 >::value, int >::type = 0> | |
SimpleTensor< T1 > | copy_tensor (const SimpleTensor< half > &tensor) |
template<typename U > | |
void | swap (SimpleTensor< U > &tensor1, SimpleTensor< U > &tensor2) |
template<typename T > | |
std::string | prettify_tensor (const SimpleTensor< T > &input, const IOFormatInfo &io_fmt=IOFormatInfo{ IOFormatInfo::PrintRegion::NoPadding }) |
template<typename T > | |
std::ostream & | operator<< (std::ostream &os, const SimpleTensor< T > &tensor) |
template<typename T > | |
std::string | to_string (const SimpleTensor< T > &tensor) |
template<typename T , typename = typename std::enable_if<std::is_floating_point<T>::value>::type> | |
T | round_half_up (T value) |
Round floating-point value with half value rounding to positive infinity. More... | |
template<typename T , typename = typename std::enable_if<std::is_floating_point<T>::value>::type> | |
T | round_half_even (T value, T epsilon=std::numeric_limits< T >::epsilon()) |
Round floating-point value with half value rounding to nearest even. More... | |
Format | get_format_for_channel (Channel channel) |
Look up the format corresponding to a channel. More... | |
Format | get_channel_format (Channel channel) |
Return the format of a channel. More... | |
template<typename F , typename T > | |
T | foldl (F &&, const T &value) |
Base case of foldl. More... | |
template<typename F , typename T , typename U > | |
auto | foldl (F &&func, T &&value1, U &&value2) -> decltype(func(value1, value2)) |
Base case of foldl. More... | |
template<typename F , typename I , typename T , typename... Vs> | |
I | foldl (F &&func, I &&initial, T &&value, Vs &&... values) |
Fold left. More... | |
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. More... | |
template<typename T > | |
void | store_value_with_data_type (void *ptr, T value, DataType data_type) |
Write the value after casting the pointer according to data_type . More... | |
template<typename U , typename T > | |
T | saturate_cast (T val) |
Saturate a value of type T against the numeric limits of type U. More... | |
Coordinates | index2coord (const TensorShape &shape, int index) |
Convert a linear index into n-dimensional coordinates. More... | |
int | coord2index (const TensorShape &shape, const Coordinates &coord) |
Linearise the given coordinate. More... | |
bool | is_in_valid_region (const ValidRegion &valid_region, Coordinates coord) |
Check if a coordinate is within a valid region. More... | |
template<typename T > | |
T | create_tensor (const TensorInfo &info, IRuntimeContext *ctx=nullptr) |
Create and initialize a tensor of the given type. More... | |
template<typename T > | |
T | create_tensor (const TensorShape &shape, DataType data_type, int num_channels=1, QuantizationInfo quantization_info=QuantizationInfo(), DataLayout data_layout=DataLayout::NCHW, IRuntimeContext *ctx=nullptr) |
Create and initialize a tensor of the given type. More... | |
template<typename T > | |
T | create_tensor (const TensorShape &shape, Format format, IRuntimeContext *ctx=nullptr) |
Create and initialize a tensor of the given type. More... | |
template<typename T , typename = typename std::enable_if<std::is_floating_point<T>::value>::type> | |
std::vector< T > | generate_random_real (unsigned int num_values, T min, T max, std::random_device::result_type seed) |
Create a vector with a uniform distribution of floating point values across the specified range. More... | |
template<typename T , typename ArrayAccessor_T > | |
void | fill_array (ArrayAccessor_T &&array, const std::vector< T > &v) |
std::string | get_typestring (DataType data_type) |
Obtain numpy type string from DataType. More... | |
template<typename TensorType > | |
void | sync_if_necessary () |
Sync if necessary. More... | |
template<typename TensorType > | |
void | sync_tensor_if_necessary (TensorType &tensor) |
Sync tensor if necessary. More... | |
ITensorInfo::TensorDimsState | construct_dims_state (int32_t value) |
Construct and return object for dimensions' state filled with the given value. More... | |
ITensorInfo::TensorDimsState | construct_dynamic_dims_state () |
Construct and return object for dimensions' state filled with the value for dynamic state. More... | |
ITensorInfo::TensorDimsState | construct_static_dims_state () |
Construct and return object for dimensions' state filled with the value for non-dynamic state. More... | |
template<typename TensorType > | |
void | set_tensor_dynamic (TensorType &t) |
Set the dimension states of the given tensor to dynamic. More... | |
template<typename TensorType > | |
void | set_tensor_static (TensorType &t) |
Set the dimension states of the given tensor to state. More... | |
experimental::dynamic_fusion::Conv2dAttributes | convert_pad_stride_info_to_conv_attr (const PadStrideInfo &info, const Size2D &dialation) |
Variables | |
std::unique_ptr< ParametersLibrary > | parameters |
std::unique_ptr< AssetsLibrary > | library |
std::unique_ptr< AssetsLibrary > | fixed_library |
void arm_compute::test::apply | ( | O * | obj, |
F && | func, | ||
const std::tuple< As... > & | args | ||
) |
Definition at line 79 of file Utils.h.
References arm_compute::test::framework::apply_impl(), and GemmTuner::args.
|
inline |
Create a string with the arithmetic value in full precision.
val | Arithmetic value |
decimal_places | How many decimal places to show |
Definition at line 164 of file Utils.h.
References arm_compute::test::validation::ss().
Referenced by PrettyPrinter::print_measurements().
|
inline |
Construct and return object for dimensions' state filled with the given value.
[in] | value | The value to fill |
Definition at line 586 of file Utils.h.
References arm_compute::test::validation::utils::fill().
Referenced by construct_dynamic_dims_state(), and construct_static_dims_state().
|
inline |
Construct and return object for dimensions' state filled with the value for dynamic state.
Definition at line 597 of file Utils.h.
References construct_dims_state(), and ITensorInfo::get_dynamic_state_value().
Referenced by set_tensor_dynamic().
|
inline |
Construct and return object for dimensions' state filled with the value for non-dynamic state.
Definition at line 606 of file Utils.h.
References construct_dims_state(), and ITensorInfo::get_static_state_value().
Referenced by set_tensor_static().
|
inline |
Definition at line 633 of file Utils.h.
References Conv2dAttributes::dilation(), arm_compute::test::validation::info, Conv2dAttributes::pad(), and Conv2dAttributes::stride().
|
inline |
Linearise the given coordinate.
Transforms the given coordinate into a linear offset in terms of elements.
[in] | shape | Shape of the n-dimensional tensor. |
[in] | coord | The to be converted coordinate. |
Definition at line 388 of file Utils.h.
References ARM_COMPUTE_ERROR_ON_MSG, Dimensions< T >::num_dimensions(), and arm_compute::test::validation::shape.
Referenced by arm_compute::test::validation::apply_2d_spatial_filter(), arm_compute::test::validation::reference::col2im(), arm_compute::test::validation::reference::conv3d(), arm_compute::test::validation::reference::instance_normalization(), RawTensor::operator()(), SimpleTensor< uint8_t >::operator()(), arm_compute::test::validation::reference::pad_layer(), arm_compute::test::validation::reference::pooling_3d_layer_internal(), arm_compute::test::validation::reference::pooling_layer_internal(), arm_compute::test::validation::reference::reverse(), arm_compute::test::validation::reference::scale_core(), arm_compute::test::validation::tensor_elem_at(), arm_compute::test::validation::reference::tile(), arm_compute::test::validation::reference::transpose(), and arm_compute::test::validation::reference::weights_reshape().
SimpleTensor< T1 > copy_tensor | ( | const SimpleTensor< half > & | tensor | ) |
Definition at line 246 of file SimpleTensor.h.
References SimpleTensor< T >::data(), SimpleTensor< T >::num_elements(), and tensor.
SimpleTensor<T1> arm_compute::test::copy_tensor | ( | const SimpleTensor< T2 > & | tensor | ) |
Definition at line 232 of file SimpleTensor.h.
References SimpleTensor< T >::data(), SimpleTensor< T >::num_elements(), and tensor.
|
inline |
Create and initialize a tensor of the given type.
[in] | info | Tensor information to be used to create the tensor |
[in] | ctx | (Optional) Pointer to the runtime context. |
Definition at line 427 of file Utils.h.
References arm_compute::test::validation::info, and tensor.
|
inline |
Create and initialize a tensor of the given type.
[in] | shape | Tensor shape. |
[in] | data_type | Data type. |
[in] | num_channels | (Optional) Number of channels. |
[in] | quantization_info | (Optional) Quantization info for asymmetric quantized types. |
[in] | data_layout | (Optional) Data layout. Default is NCHW. |
[in] | ctx | (Optional) Pointer to the runtime context. |
Definition at line 446 of file Utils.h.
References arm_compute::cpu::data_layout, arm_compute::test::validation::data_type, arm_compute::test::validation::info, arm_compute::test::validation::shape, and tensor.
|
inline |
Create and initialize a tensor of the given type.
[in] | shape | Tensor shape. |
[in] | format | Format type. |
[in] | ctx | (Optional) Pointer to the runtime context. |
Definition at line 466 of file Utils.h.
References arm_compute::test::validation::info, and arm_compute::test::validation::shape.
|
inline |
void arm_compute::test::fill_tensors | ( | D && | dist, |
std::initializer_list< int > | seeds, | ||
T && | tensor, | ||
Ts &&... | other_tensors | ||
) |
|
inline |
|
inline |
Fold left.
[in] | func | Binary function to be called. |
[in] | initial | Initial value. |
[in] | value | Argument passed to the function. |
[in] | values | Remaining arguments. |
Definition at line 205 of file Utils.h.
References foldl().
|
inline |
|
inline |
Create a vector with a uniform distribution of floating point values across the specified range.
[in] | num_values | The number of values to be created. |
[in] | min | The minimum value in distribution (inclusive). |
[in] | max | The maximum value in distribution (inclusive). |
[in] | seed | The random seed to be used. |
Return the format of a channel.
[in] | channel | Channel type. |
Definition at line 164 of file Utils.h.
References arm_compute::B, arm_compute::G, arm_compute::R, and arm_compute::U8.
Look up the format corresponding to a channel.
[in] | channel | Channel type. |
Definition at line 145 of file Utils.h.
References arm_compute::B, arm_compute::G, arm_compute::R, and arm_compute::RGB888.
Referenced by AssetsLibrary::fill(), and AssetsLibrary::get().
|
inline |
Obtain numpy type string from DataType.
[in] | data_type | Data type. |
Definition at line 510 of file Utils.h.
References ARM_COMPUTE_ERROR, arm_compute::test::validation::data_type, arm_compute::F32, arm_compute::F64, arm_compute::S16, arm_compute::S32, arm_compute::S64, arm_compute::S8, arm_compute::SIZET, arm_compute::support::cpp11::to_string(), arm_compute::U16, arm_compute::U32, arm_compute::U64, and arm_compute::U8.
|
inline |
Convert a linear index into n-dimensional coordinates.
[in] | shape | Shape of the n-dimensional tensor. |
[in] | index | Linear index specifying the i-th element. |
Definition at line 359 of file Utils.h.
References ARM_COMPUTE_ERROR_ON_MSG, and arm_compute::test::validation::shape.
Referenced by arm_compute::test::validation::reference::erode(), AssetsLibrary::fill(), AssetsLibrary::fill_boxes(), AssetsLibrary::fill_with_generator(), arm_compute::test::validation::reference::non_maxima_suppression(), arm_compute::test::validation::reference::pad_layer(), arm_compute::test::validation::reference::permute(), arm_compute::test::validation::reference::reverse(), arm_compute::test::validation::reference::scale_core(), arm_compute::test::validation::reference::tile(), arm_compute::test::validation::reference::transpose(), arm_compute::test::validation::transpose(), arm_compute::test::validation::validate(), and arm_compute::test::validation::validate_wrap().
|
inline |
Check if a coordinate is within a valid region.
Definition at line 406 of file Utils.h.
References ValidRegion::end(), Dimensions< int >::num_max_dimensions, ValidRegion::start(), and arm_compute::test::validation::valid_region.
Referenced by arm_compute::test::validation::reference::non_maxima_suppression(), arm_compute::test::validation::validate(), and arm_compute::test::validation::validate_wrap().
std::string arm_compute::test::join | ( | T && | first, |
T && | last, | ||
const std::string & | separator | ||
) |
Helper function to concatenate multiple values.
All values are converted to std::string using std::to_string before being joined.
[in] | first | Iterator pointing to the first element to be concatenated. |
[in] | last | Iterator pointing behind the last element to be concatenated. |
[in] | separator | String used to join the elements. |
separator
. Definition at line 136 of file Utils.h.
References join(), and arm_compute::support::cpp11::to_string().
std::string arm_compute::test::join | ( | T && | first, |
T && | last, | ||
const std::string & | separator, | ||
UnaryOp && | op | ||
) |
Helper function to concatenate multiple values.
All values are converted to std::string using the provided operation before being joined.
The signature of op has to be equivalent to std::string op(const T::value_type &val).
[in] | first | Iterator pointing to the first element to be concatenated. |
[in] | last | Iterator pointing behind the last element to be concatenated. |
[in] | separator | String used to join the elements. |
[in] | op | Conversion function. |
separator
. Definition at line 117 of file Utils.h.
References arm_compute::test::validation::reference::accumulate().
std::string arm_compute::test::join | ( | T | first, |
T | last, | ||
const std::string & | separator | ||
) |
Helper function to concatenate multiple strings.
[in] | first | Iterator pointing to the first element to be concatenated. |
[in] | last | Iterator pointing behind the last element to be concatenated. |
[in] | separator | String used to join the elements. |
separator
. Definition at line 93 of file Utils.h.
References arm_compute::test::validation::reference::accumulate().
Referenced by join(), and JSONPrinter::print_measurements().
|
inline |
Definition at line 131 of file SimpleTensorPrinter.h.
References IOFormatInfo::NoPadding, prettify_tensor(), and tensor.
|
inline |
Definition at line 41 of file SimpleTensorPrinter.h.
References IOFormatInfo::NoPadding.
Referenced by operator<<().
|
inline |
Round floating-point value with half value rounding to nearest even.
[in] | value | floating-point value to be rounded. |
[in] | epsilon | precision. |
value
. Definition at line 82 of file Utils.h.
References arm_compute::support::cpp11::copysign(), arm_compute::quantization::epsilon, and arm_compute::support::cpp11::round().
|
inline |
T arm_compute::test::saturate_cast | ( | T | val | ) |
Saturate a value of type T against the numeric limits of type U.
[in] | val | Value to be saturated. |
Definition at line 313 of file Utils.h.
References arm_compute::support::cpp11::lowest().
void arm_compute::test::set_tensor_dynamic | ( | TensorType & | t | ) |
Set the dimension states of the given tensor to dynamic.
[in] | t | The tensor to set to dynamic state |
Definition at line 617 of file Utils.h.
References construct_dynamic_dims_state(), and tf_frozen_model_extractor::t.
void arm_compute::test::set_tensor_static | ( | TensorType & | t | ) |
Set the dimension states of the given tensor to state.
[in] | t | The tensor to set to static state |
Definition at line 628 of file Utils.h.
References construct_static_dims_state(), and tf_frozen_model_extractor::t.
|
inline |
Create a valid region based on tensor shape, border mode and border size.
[in] | a_shape | Shape used as size of the valid region. |
[in] | border_undefined | (Optional) Boolean indicating if the border mode is undefined. |
[in] | border_size | (Optional) Border size used to specify the region to exclude. |
shape
if border_undefined
is false; otherwise return A valid region starting at (border_size.left
, border_size.top
, ...) with reduced size of shape
. Definition at line 219 of file Utils.h.
References ValidRegion::anchor, ARM_COMPUTE_ERROR_ON, Dimensions< T >::set(), arm_compute::test::validation::shape, ValidRegion::shape, and arm_compute::test::validation::valid_region.
Referenced by arm_compute::test::validation::reference::non_maxima_suppression(), arm_compute::test::validation::validate(), and arm_compute::test::validation::validate_wrap().
void arm_compute::test::sleep_in_seconds | ( | float | seconds | ) |
Makes the calling thread to sleep for a specified number of seconds.
[in] | seconds | Amount of seconds to sleep. Will return immediately if less or equal to zero. |
Definition at line 38 of file Utils.cpp.
Referenced by Framework::run().
void arm_compute::test::store_value_with_data_type | ( | void * | ptr, |
T | value, | ||
DataType | data_type | ||
) |
Write the value after casting the pointer according to data_type
.
[out] | ptr | Pointer to memory where the value will be written. |
[in] | value | Value that will be written. |
[in] | data_type | Data type that will be written. |
Definition at line 252 of file Utils.h.
References ARM_COMPUTE_ERROR, arm_compute::BFLOAT16, arm_compute::test::validation::data_type, arm_compute::F16, arm_compute::F32, arm_compute::F64, arm_compute::QASYMM16, arm_compute::QASYMM8, arm_compute::QASYMM8_SIGNED, arm_compute::QSYMM16, arm_compute::QSYMM8, arm_compute::QSYMM8_PER_CHANNEL, arm_compute::S16, arm_compute::S32, arm_compute::S64, arm_compute::S8, arm_compute::SIZET, arm_compute::U16, arm_compute::U32, arm_compute::U64, and arm_compute::U8.
Referenced by AssetsLibrary::fill(), AssetsLibrary::fill_boxes(), and AssetsLibrary::fill_with_generator().
void arm_compute::test::swap | ( | SimpleTensor< U > & | tensor1, |
SimpleTensor< U > & | tensor2 | ||
) |
|
inline |
Sync if necessary.
Definition at line 558 of file Utils.h.
References CLScheduler::get(), arm_compute::opencl_is_available(), CLScheduler::sync(), and type.
|
inline |
Sync tensor if necessary.
[in] | tensor | Tensor to be sync. |
Definition at line 575 of file Utils.h.
References ARM_COMPUTE_UNUSED, and tensor.
|
inline |
Definition at line 138 of file SimpleTensorPrinter.h.
References arm_compute::test::validation::ss(), and tensor.
Referenced by main().
|
inline |
Convert string to lower case.
[in] | string | To be converted string. |
Definition at line 147 of file Utils.h.
References arm_compute::mlgo::parser::end().
Referenced by arm_compute::test::framework::dataset_mode_from_name(), arm_compute::test::framework::instrument_type_from_name(), arm_compute::test::framework::log_format_from_name(), and arm_compute::test::framework::log_level_from_name().
std::unique_ptr< AssetsLibrary > fixed_library |
std::unique_ptr< AssetsLibrary > library |
Definition at line 77 of file main.cpp.
Referenced by arm_compute::test::validation::reference::accumulate(), arm_compute::test::validation::reference::accumulate_squared(), arm_compute::test::validation::reference::accumulate_weighted(), arm_compute::test::validation::add_padding_x(), arm_compute::test::validation::compute_float_reference(), arm_compute::test::validation::compute_float_target_in_place(), arm_compute::test::validation::DATA_TEST_CASE(), arm_compute::test::validation::utils::fill(), fill_tensors(), main(), and arm_compute::test::validation::TEST_CASE().
std::unique_ptr< ParametersLibrary > parameters |
Definition at line 46 of file Framework.cpp.
Referenced by DepthwiseDepthfirstMultiplier< TInput, TWeight, TOutput, TAccum, is_generic, OutputStage >::compute_tile_padded(), StrategyType< IsGeneric, TInput, TWeight, TOutput, TAccum, OutputStage >::execute(), StrategyType< true, TInput, TWeight, TOutput, TAccum, OutputStage >::execute(), StrategyType< false, TInput, TWeight, TOutput, int32_t, arm_gemm::Requantize32 >::execute(), StrategyType< true, TInput, TWeight, TOutput, int32_t, arm_gemm::Requantize32 >::execute(), main(), and arm_compute::test::validation::TEST_CASE().