Compute Library
 24.04
arm_compute Namespace Reference

Copyright (c) 2017-2024 Arm Limited. More...

Namespaces

 assembly_utils
 
 cl_direct_conv
 
 cl_dwc
 
 cl_gemm
 
 cl_indirect_conv
 
 cl_matmul
 
 cl_tuner
 
 cpu
 
 cpuinfo
 
 detail
 
 experimental
 
 gpu
 
 graph
 
 graph_utils
 
 helpers
 
 io
 
 kernels
 
 logging
 
 misc
 
 mlgo
 
 opencl
 Interface to convert the 2D Fully Connected weights from NCHW to NHWC or vice versa.
 
 quantization
 
 scale_helpers
 
 scale_utils
 
 scheduler_utils
 
 softmax_helpers
 
 support
 
 test
 
 utility
 
 utils
 
 weights_transformations
 
 wrapper
 

Data Structures

class  AccessWindowAutoPadding
 Dummy access window. More...
 
class  AccessWindowHorizontal
 Implementation of a row access pattern. More...
 
class  AccessWindowRectangle
 Implementation of a rectangular access pattern. More...
 
class  AccessWindowStatic
 Implementation of a static rectangular access pattern. More...
 
class  AccessWindowTranspose
 Implementation of a XY-transpose access pattern. More...
 
class  AccessWindowVertical
 Implementation of a column access pattern. More...
 
class  ActivationLayerInfo
 Activation Layer Information class. More...
 
class  Allocator
 Default malloc allocator implementation. More...
 
class  AllocatorWrapper
 Default malloc allocator implementation. More...
 
class  Array
 Basic implementation of the IArray interface which allocates a static number of T values
More...
 
class  bfloat16
 Brain floating point representation class. More...
 
struct  BlobInfo
 Meta-data information for each blob. More...
 
class  BlobLifetimeManager
 Concrete class that tracks the lifetime of registered tensors and calculates the systems memory requirements in terms of blobs. More...
 
class  BlobMemoryPool
 Blob memory pool. More...
 
struct  BorderSize
 Container for 2D border size. More...
 
class  BoundingBoxTransformInfo
 Bounding Box Transform information class. More...
 
class  BoxNMSLimitInfo
 BoxWithNonMaximaSuppressionLimit Information class. More...
 
class  CLAbsLayer
 Basic function to get the absolute value of an input tensor. More...
 
class  CLActivationLayer
 Basic function to run opencl::kernels::ClActivationKernel. More...
 
class  CLArgMinMaxLayer
 Function to calculate the index of the minimum or maximum values in a tensor based on an axis. More...
 
class  CLArgMinMaxLayerKernel
 Interface for the reduction operation kernel. More...
 
class  CLArithmeticAddition
 Basic function to run opencl::kernels::ClSaturatedArithmeticKernel for addition. More...
 
class  CLArithmeticDivision
 Basic function to run opencl::kernels::ClSaturatedArithmeticKernel for division. More...
 
class  CLArithmeticSubtraction
 Basic function to run opencl::kernels::ClSaturatedArithmeticKernel for subtraction. More...
 
class  CLArray
 CLArray implementation
More...
 
class  CLBatchNormalizationLayer
 Basic function to run CLNormalizationLayerKernel and simulate a batch normalization layer. More...
 
class  CLBatchNormalizationLayerKernel
 Interface for the BatchNormalization layer kernel. More...
 
class  CLBatchToSpaceLayer
 Basic function to run CLBatchToSpaceLayerKernel. More...
 
class  CLBatchToSpaceLayerKernel
 Interface for the batch to space kernel. More...
 
class  CLBitwiseAnd
 Basic function to perform bitwise AND by running CLBitwiseKernel. More...
 
class  CLBitwiseKernel
 Interface for the bitwise operation kernel. More...
 
class  CLBitwiseNot
 Basic function to perform bitwise NOT by running CLBitwiseKernel. More...
 
class  CLBitwiseOr
 Basic function to perform bitwise OR by running CLBitwiseKernel. More...
 
class  CLBitwiseXor
 Basic function to perform bitwise XOR by running CLBitwiseKernel. More...
 
class  CLBoundingBoxTransform
 Basic function to run CLBoundingBoxTransformKernel. More...
 
class  CLBoundingBoxTransformKernel
 Interface for the bounding box kernel. More...
 
class  CLBufferAllocator
 Default OpenCL cl buffer allocator implementation. More...
 
class  CLBufferMemoryRegion
 OpenCL buffer memory region implementation. More...
 
class  CLBuildOptions
 Build options. More...
 
class  CLCast
 Basic function to run opencl::kernels::ClCastKernel. More...
 
class  CLChannelShuffleLayer
 Basic function to run CLChannelShuffleLayerKernel. More...
 
class  CLChannelShuffleLayerKernel
 Interface for the channel shuffle kernel. More...
 
class  CLCoarseSVMMemoryRegion
 OpenCL coarse-grain SVM memory region implementation. More...
 
class  CLCommandBuffer
 Command buffer contains a list of commands that is constructed once and later enqueued multiple times. More...
 
class  CLComparison
 Basic function to run CLComparisonKernel. More...
 
class  CLComparisonKernel
 Interface for the comparison kernel. More...
 
class  CLComparisonStatic
 Basic function to run CLComparisonKernel. More...
 
class  CLCompatCommandBuffer
 Command buffer implementation for platform without mutable dispatch command buffer extension. More...
 
class  CLCompileContext
 CLCompileContext class. More...
 
class  CLComplexPixelWiseMultiplication
 Basic function to run opencl::ClComplexMul. More...
 
class  CLComputeAllAnchorsKernel
 Interface for Compute All Anchors kernel. More...
 
class  CLComputeMeanVariance
 Interface for compute Mean and Variance per channel. More...
 
class  CLConcatenateLayer
 Basic function to execute concatenate tensors along a given axis. More...
 
class  CLConv3D
 Basic function to compute the convolution3d layer. More...
 
class  CLConvertFullyConnectedWeights
 Basic function to run an opencl::kernels::ClConvertFullyConnectedWeightsKernel. More...
 
class  CLConvolutionLayer
 Basic function to compute the convolution layer. More...
 
class  CLCopy
 Basic function to run opencl::kernels::ClCopyKernel. More...
 
class  CLCrop
 Basic function to run opencl::kernels::ClCropKernel. More...
 
class  CLCropResize
 Function to perform cropping and resizing. More...
 
class  CLDeconvolutionLayer
 Basic function to compute the deconvolution layer. More...
 
class  CLDeconvolutionLayerUpsample
 Basic function to execute deconvolution upsample on OpenCL. More...
 
class  CLDeconvolutionLayerUpsampleKernel
 Interface for the Deconvolution layer kernel on OpenCL. More...
 
class  CLDeconvolutionReshapeOutputKernel
 Interface for the OpenCL kernel to be used for reshaping the tensor before returning the result of deconvolution. More...
 
class  CLDepthConvertLayer
 Basic function to run opencl::kernels::ClCastKernel. More...
 
class  CLDepthToSpaceLayer
 Basic function to run CLDepthToSpaceLayerKernel. More...
 
class  CLDepthToSpaceLayerKernel
 Interface for the depth to space kernel. More...
 
class  CLDepthwiseConvolutionLayer
 Function to execute a depthwise convolution. More...
 
class  CLDepthwiseConvolutionLayerNativeKernel
 Interface for the kernel to run a MxN depthwise convolution. More...
 
class  CLDequantizationLayer
 Basic function to run opencl::ClDequantize that dequantizes an input tensor. More...
 
class  CLDevice
 OpenCL device type class. More...
 
struct  CLDeviceOptions
 OpenCL device options. More...
 
class  CLDirectConvolutionLayer
 Basic function to execute direct convolution function: More...
 
class  CLDirectDeconvolutionLayer
 Function to run the deconvolution layer. More...
 
class  CLElementwiseMax
 Basic function to run opencl::kernels::ClArithmeticKernel for max. More...
 
class  CLElementwiseMin
 Basic function to run opencl::kernels::ClArithmeticKernel for min. More...
 
class  CLElementwisePower
 Basic function to run opencl::kernels::ClArithmeticKernel for power. More...
 
class  CLElementwiseSquaredDiff
 Basic function to run opencl::kernels::ClArithmeticKernel for squared difference. More...
 
class  CLExpLayer
 Basic function to perform exponential on an input tensor. More...
 
class  CLFFT1D
 Basic function to execute one dimensional FFT. More...
 
class  CLFFT2D
 Basic function to execute two dimensional FFT. More...
 
class  CLFFTConvolutionLayer
 Basic function to execute FFT-based convolution on OpenCL. More...
 
class  CLFFTDigitReverseKernel
 Interface for the digit reverse operation kernel. More...
 
class  CLFFTRadixStageKernel
 Interface for the FFT radix stage kernel. More...
 
class  CLFFTScaleKernel
 Interface for the inverse fft scale kernel. More...
 
class  CLFill
 Basic function to run opencl::kernels::ClFillKernel. More...
 
class  CLFillBorderKernel
 Interface for filling the border of a kernel. More...
 
class  CLFineSVMMemoryRegion
 OpenCL fine-grain SVM memory region implementation. More...
 
class  CLFlattenLayer
 Basic function to execute flatten. More...
 
class  CLFloor
 Basic function to run opencl::kernels::ClFloorKernel. More...
 
class  CLFullyConnectedLayer
 Basic function to compute a Fully Connected layer on OpenCL. More...
 
class  CLFuseBatchNormalization
 Basic function to fuse the batch normalization node to a preceding convolution node. More...
 
class  CLFuseBatchNormalizationKernel
 OpenCL kernel to fuse the batch normalization node to a preceding convolution node. More...
 
class  CLGather
 Basic function to run CLGatherKernel. More...
 
class  CLGatherKernel
 Interface for the kernel to perform tensor reshaping. More...
 
class  CLGEMM
 Basic function to execute GEMM on OpenCL. More...
 
class  CLGEMMConvolutionLayer
 Basic function to compute the convolution layer. More...
 
class  CLGEMMDeconvolutionLayer
 Function to run the deconvolution layer through a call to GEMM. More...
 
class  CLGEMMHeuristicsHandle
 Handle for loading and retrieving GEMM heuristics. More...
 
struct  CLGEMMKernelSelectionParams
 OpenCL GEMM kernel selection parameters. More...
 
class  CLGEMMLowpMatrixMultiplyCore
 Basic function to execute GEMMLowpMatrixMultiplyCore on OpenCL. More...
 
class  CLGEMMLowpOutputStage
 Basic function to execute GEMMLowpQuantizeDown kernels on CL. More...
 
class  CLGenerateProposalsLayer
 Basic function to generate proposals for a RPN (Region Proposal Network) More...
 
class  CLIndirectConvolutionLayer
 Basic function to run the indirect convolution function. More...
 
class  CLInstanceNormalizationLayer
 Basic function to perform a Instance normalization. More...
 
class  CLInstanceNormalizationLayerKernel
 Interface for performing an instance normalization. More...
 
class  CLKernelLibrary
 CLKernelLibrary class. More...
 
class  CLL2NormalizeLayer
 Basic function to perform a L2 normalization on a given axis. More...
 
class  CLL2NormalizeLayerKernel
 Interface for performing a L2 normalize on a given axis given the square sum of it in this axis. More...
 
class  CLLogicalAnd
 Basic function to run arm_compute::opencl::kernels::ClLogicalBinaryKernel. More...
 
class  CLLogicalNot
 Basic function to do logical NOT operation. More...
 
class  CLLogicalOr
 Basic function to run arm_compute::opencl::kernels::ClLogicalBinaryKernel. More...
 
class  CLLogLayer
 Basic function to perform elementwise log on an input tensor. More...
 
class  CLLSTMLayer
 This function performs a single time step in a Long Short-Term Memory (LSTM) layer. More...
 
class  CLLSTMLayerQuantized
 Basic function to run CLLSTMLayerQuantized. More...
 
class  CLMatMul
 Basic function to execute MatMul (Matrix Multiplication) on OpenCL. More...
 
class  CLMaxUnpoolingLayer
 Function to perform MaxUnpooling. More...
 
class  CLMaxUnpoolingLayerKernel
 Interface for the pooling layer kernel. More...
 
class  CLMeanStdDevNormalizationKernel
 Interface for the kernel to normalize the input 2D tensor across the first dimension with respect to mean and standard deviation of the same dimension. More...
 
class  CLMeanStdDevNormalizationLayer
 Basic function to execute mean and standard deviation normalization by calling CLMeanStdDevNormalizationKernel. More...
 
class  CLMemory
 OpenCL implementation of memory object. More...
 
class  CLMutableCommandBuffer
 Command buffer implementaton based on CL mutable dispatch command buffer extension. More...
 
class  CLNegLayer
 Basic function to negate an input tensor. More...
 
class  CLNormalizationLayer
 Basic function to compute a normalization layer. More...
 
class  CLNormalizationLayerKernel
 Interface for the normalization layer kernel. More...
 
class  CLNormalizePlanarYUVLayer
 Basic function to run CLNormalizePlanarYUVLayerKernel. More...
 
class  CLNormalizePlanarYUVLayerKernel
 Interface for the NormalizePlanarYUV layer kernel. More...
 
class  CLPadLayer
 Basic function to pad a tensor. More...
 
class  CLPadLayerKernel
 Interface for the PadLayer function. More...
 
class  CLPermute
 Basic function to execute an opencl::kernels::ClPermuteKernel. More...
 
class  CLPixelWiseMultiplication
 Basic function to run opencl::ClMul. More...
 
class  CLPooling3dLayer
 Basic function to run opencl::ClPool3d. More...
 
class  CLPoolingLayer
 Basic function to run opencl::ClPool2d. More...
 
class  CLPReluLayer
 Basic function to run opencl::kernels::ClArithmeticKernel for PRELU. More...
 
class  CLPriorBoxLayer
 Basic function to run CLPriorBoxLayerKernel. More...
 
class  CLPriorBoxLayerKernel
 Interface for the PriorBox layer kernel. More...
 
class  CLQLSTMLayer
 Basic function to run CLQLSTMLayer. More...
 
class  CLQLSTMLayerNormalizationKernel
 Interface for the kernel to do layer normalization. More...
 
struct  CLQuantization
 OpenCL quantization data. More...
 
class  CLQuantizationLayer
 Basic function to simulate a quantization layer. More...
 
class  CLRange
 Basic function to run CLRangeKernel. More...
 
class  CLRangeKernel
 Kernel class for Range. More...
 
class  CLReduceMean
 Basic function to perform reduce operation. More...
 
class  CLReductionOperation
 Perform reduction operation. More...
 
class  CLReductionOperationKernel
 Interface for the reduction operation kernel. More...
 
class  CLReorgLayer
 
class  CLReorgLayerKernel
 OpenCL kernel to perform a reorg layer. More...
 
class  CLReshapeLayer
 Basic function to run opencl::kernels::ClReshapeKernel. More...
 
class  CLReverse
 Basic function to run CLReverseKernel. More...
 
class  CLReverseKernel
 Interface for the reverse kernel. More...
 
class  CLRNNLayer
 Basic function to run CLRNNLayer. More...
 
class  CLROIAlignLayer
 Basic function to run CLROIAlignLayerKernel. More...
 
class  CLROIAlignLayerKernel
 Interface for the RoIAlign kernel. More...
 
class  CLROIPoolingLayer
 Basic function to run CLROIPoolingLayerKernel. More...
 
class  CLROIPoolingLayerKernel
 Interface for the ROI pooling layer kernel. More...
 
class  CLRoundLayer
 Basic function to get the round (to the nearest even) value of an input tensor. More...
 
class  CLRsqrtLayer
 Basic function to perform inverse square root on an input tensor. More...
 
class  CLRuntimeContext
 Runtime context. More...
 
class  CLScale
 Basic function to run opencl::ClScale. More...
 
class  CLScatter
 Function to compute ScatterND Layer. More...
 
class  CLScheduler
 Provides global access to a CL context and command queue. More...
 
class  CLSelect
 Basic function to run CLSelect. More...
 
class  CLSelectKernel
 OpenCL interface for executing the select kernel. More...
 
class  CLSinLayer
 Basic function to calculate sine of an input tensor. More...
 
class  CLSlice
 Basic function to perform tensor slicing. More...
 
class  CLSoftmaxLayerGeneric
 Basic function to compute a SoftmaxLayer. More...
 
class  CLSpaceToBatchLayer
 Basic function to spatial divide a tensor. More...
 
class  CLSpaceToBatchLayerKernel
 Interface for the space to batch kernel. More...
 
class  CLSpaceToDepthLayer
 Basic function to run CLSpaceToDepthLayerKernel. More...
 
class  CLSpaceToDepthLayerKernel
 Interface for the space to depth kernel. More...
 
class  CLSplit
 Basic function to split a tensor along a given axis. More...
 
class  CLStackLayer
 Basic function to stack tensors along an axis. More...
 
class  CLStackLayerKernel
 OpenCL kernel to stacks a rank-R tensor into one with rank-(R+1) along the axis dimension. More...
 
class  CLStridedSlice
 Basic function to run CLStridedSliceKernel. More...
 
class  CLStridedSliceKernel
 Interface for the kernel to perform tensor strided slicing. More...
 
class  CLSubTensor
 Basic implementation of the OpenCL sub-tensor interface. More...
 
class  CLSymbols
 Class for loading OpenCL symbols. More...
 
class  CLTensor
 Basic implementation of the OpenCL tensor interface. More...
 
class  CLTensorAllocator
 Basic implementation of a CL memory tensor allocator. More...
 
class  CLTile
 Basic function to run CLTileKernel. More...
 
class  CLTileKernel
 OpenCL kernel to perform a Tile operation. More...
 
class  CLTranspose
 Basic function to execute an opencl::kernels::ClTransposeKernel. More...
 
class  CLTuner
 Basic implementation of the OpenCL tuner interface. More...
 
struct  CLTuningInfo
 
class  CLTuningParams
 < OpenCL tuner parameters More...
 
class  CLUnstack
 Basic function to unpack a rank-R tensor into rank-(R-1) tensors. More...
 
class  CLWinogradConvolutionLayer
 Basic function to execute Winograd-based convolution on OpenCL. More...
 
class  ComputeAnchorsInfo
 ComputeAnchors information class. More...
 
struct  Conv2dInfo
 Descriptor used by the 2d Convolution function. More...
 
struct  Conv3dInfo
 Descriptor used by the 3d Convolution function. More...
 
struct  ConvolutionInfo
 
class  Coordinates
 Coordinates of an item. More...
 
struct  Coordinates2D
 Coordinate type. More...
 
struct  Coordinates3D
 Coordinate type. More...
 
class  CPPBoxWithNonMaximaSuppressionLimit
 Basic function to run CPPBoxWithNonMaximaSuppressionLimitKernel. More...
 
class  CPPBoxWithNonMaximaSuppressionLimitKernel
 CPP kernel to perform computation of BoxWithNonMaximaSuppressionLimit. More...
 
class  CPPDetectionOutputLayer
 CPP Function to generate the detection output based on location and confidence predictions by doing non maximum suppression. More...
 
class  CPPDetectionPostProcessLayer
 CPP Function to generate the detection output based on center size encoded boxes, class prediction and anchors by doing non maximum suppression. More...
 
class  CPPNonMaximumSuppression
 CPP Function to perform non maximum suppression on the bounding boxes and scores. More...
 
class  CPPNonMaximumSuppressionKernel
 CPP Function to perform non maximum suppression on the bounding boxes and scores. More...
 
class  CPPPermute
 Basic function to run CPPPermuteKernel. More...
 
class  CPPPermuteKernel
 CPP kernel to perform tensor permutation. More...
 
class  CPPScheduler
 C++11 implementation of a pool of threads to automatically split a kernel's execution among several threads. More...
 
class  CPPSplit
 Basic function to split a tensor along a given axis. More...
 
class  CPPTopKV
 Basic function to run CPPTopKVKernel. More...
 
class  CPPTopKVKernel
 CPP kernel to perform tensor TopKV operation. More...
 
class  CPPUpsample
 Basic function to run CPPUpsample. More...
 
class  CPPUpsampleKernel
 CPP kernel to perform tensor upsample. More...
 
class  CPUInfo
 
class  CpuMatMulSettings
 Settings for MatMul Cpu implementation. More...
 
class  DetectionOutputLayerInfo
 Detection Output layer info. More...
 
class  DetectionPostProcessLayerInfo
 Detection Output layer info. More...
 
struct  DetectionWindow
 Detection window used for the object detection. More...
 
class  Dimensions
 Dimensions with dimensionality. More...
 
struct  DirectConvComputeKernelInfo
 Compute descriptor used by the direct convolution kernel. More...
 
struct  DirectConvolutionLayerOutputStageKernelInfo
 Descriptor used by the direct convolution layer output stage kernels. More...
 
struct  DWCComputeKernelInfo
 Compute descriptor used by the depthwise convolution native kernel. More...
 
struct  enable_bitwise_ops
 Disable bitwise operations by default. More...
 
struct  enable_bitwise_ops< arm_compute::GPUTarget >
 Enable bitwise operations on GPUTarget enumerations. More...
 
struct  ErfLutEntry
 Lookup table for erf(x) calculation. More...
 
struct  FFT1DInfo
 Descriptor used by the FFT1D function. More...
 
struct  FFT2DInfo
 Descriptor used by the FFT2D function. More...
 
struct  FFTDigitReverseKernelInfo
 Descriptor for FFT digit reverse kernels. More...
 
struct  FFTRadixStageKernelInfo
 Descriptor used by the FFT core kernels. More...
 
struct  FFTScaleKernelInfo
 Descriptor for FFT scale kernels. More...
 
struct  FullyConnectedLayerInfo
 Fully connected layer info. More...
 
class  GEMMInfo
 GEMM information class. More...
 
struct  GEMMKernelInfo
 Descriptor used by the GEMM kernels. More...
 
struct  GEMMLHSMatrixInfo
 GEMM LHS (Left Hand Side) matrix information. More...
 
struct  GEMMLowpOutputStageInfo
 GEMMLowp output stage info. More...
 
struct  GEMMLowpReductionKernelInfo
 
class  GEMMReshapeInfo
 GEMM reshape information class. More...
 
struct  GEMMRHSMatrixInfo
 GEMM RHS (Right Hand Side) matrix information. More...
 
class  GenerateProposalsInfo
 Generate Proposals Information class. More...
 
class  GpuMatMulSettings
 Settings for MatMul OpenCL implementation. More...
 
class  IAccessWindow
 Interface describing methods to update access window and padding based on kernel parameters. More...
 
class  IAllocator
 Allocator interface. More...
 
class  IArray
 Array of type T. More...
 
class  IAssetManager
 Asset manager interface. More...
 
class  ICLArray
 Interface for OpenCL Array. More...
 
class  ICLKernel
 Common interface for all the OpenCL kernels. More...
 
class  ICLMemoryRegion
 OpenCL memory region interface. More...
 
class  ICLSimple2DKernel
 Interface for simple OpenCL kernels having 1 tensor input and 1 tensor output. More...
 
class  ICLSimple3DKernel
 Interface for simple OpenCL kernels having 1 tensor input and 1 tensor output. More...
 
class  ICLSimpleFunction
 Basic interface for functions which have a single OpenCL kernel. More...
 
class  ICLSimpleKernel
 Interface for simple OpenCL kernels having 1 tensor input and 1 tensor output. More...
 
class  ICLSVMMemoryRegion
 OpenCL SVM memory region interface. More...
 
class  ICLTensor
 Interface for OpenCL tensor. More...
 
class  ICLTuner
 Basic interface for tuning the OpenCL kernels. More...
 
class  IContext
 Context interface. More...
 
class  ICPPKernel
 Common interface for all kernels implemented in C++. More...
 
class  ICPPSimpleFunction
 Basic interface for functions which have a single CPP kernel. More...
 
class  IDevice
 Interface for device object. More...
 
class  IFunction
 Base class for all functions. More...
 
class  IKernel
 Common information for all the kernels. More...
 
class  ILifetimeManager
 Interface for managing the lifetime of objects. More...
 
class  IMemory
 Memory interface. More...
 
class  IMemoryGroup
 Memory group interface. More...
 
class  IMemoryManageable
 Interface of an object than can be memory managed. More...
 
class  IMemoryManager
 Memory manager interface to handle allocations of backing memory. More...
 
class  IMemoryPool
 Memory Pool Inteface. More...
 
class  IMemoryRegion
 Memory region interface. More...
 
class  INESimpleFunction
 Basic interface for functions which have a single CPU kernel. More...
 
class  INESimpleFunctionNoBorder
 Basic interface for functions which have a single CPU kernel and no border. More...
 
struct  InstanceNormalizationLayerKernelInfo
 
struct  IOFormatInfo
 IO formatting information class. More...
 
class  IOperator
 Base class specifying the operator interface. More...
 
class  IPoolManager
 Memory pool manager interface. More...
 
class  IQueue
 Base class specifying the queue interface. More...
 
class  IRuntimeContext
 Context interface. More...
 
class  IScheduler
 Scheduler interface to run kernels. More...
 
class  ISimpleLifetimeManager
 Abstract class of the simple lifetime manager interface. More...
 
class  ITensor
 Interface for CPU tensor. More...
 
class  ITensorAllocator
 Interface to allocate tensors. More...
 
class  ITensorInfo
 Store the tensor's metadata. More...
 
class  ITensorPack
 Tensor packing service. More...
 
class  ITensorV2
 Base class specifying the tensor interface. More...
 
class  Iterator
 Iterator updated by execute_window_loop for each window element. More...
 
class  ITransformWeights
 Weights tensor transform interface In order to identify the different reshape functions, each reshape function has to generate a unique id. More...
 
class  IWeightsManager
 Weights manager interface to handle weights transformations. More...
 
class  Kernel
 Kernel class. More...
 
class  LSTMParams
 
struct  LUTInfo
 
class  LUTManager
 
class  MatMulInfo
 Class for holding information related to matrix multiplication function. More...
 
struct  MatMulKernelInfo
 
class  Memory
 CPU implementation of memory object. More...
 
class  MemoryGroup
 Memory group. More...
 
class  MemoryGroupResourceScope
 Memory group resources scope handling class. More...
 
class  MemoryManagerOnDemand
 On-demand memory manager. More...
 
class  MemoryRegion
 Memory region CPU implementation. More...
 
struct  MinMaxLocationValues
 Min and max values and locations. More...
 
class  NEActivationLayer
 Basic function to run cpu::kernels::CpuActivationKernel. More...
 
class  NEAddMulAdd
 Function to compute Add+Mul+Add fused operation. More...
 
class  NEArgMinMaxLayer
 Function to calculate the index of the minimum or maximum values in a tensor based on an axis. More...
 
class  NEArithmeticAddition
 Basic function to run cpu::kernels::CpuAddKernel. More...
 
class  NEArithmeticSubtraction
 Basic function to run cpu::kernels::CpuSubKernel. More...
 
class  NEBatchNormalizationLayer
 Basic function to run NENormalizationLayerKernel and simulate a batch normalization layer. More...
 
class  NEBatchNormalizationLayerKernel
 Interface for the batch normalization layer kernel. More...
 
class  NEBatchToSpaceLayer
 Basic function to run NEBatchToSpaceLayerKernel. More...
 
class  NEBatchToSpaceLayerKernel
 Interface for the batch to space kernel. More...
 
class  NEBitwiseAnd
 Basic function to run NEBitwiseAndKernel. More...
 
class  NEBitwiseAndKernel
 Interface for the kernel to perform bitwise AND between XY-planes of two tensors. More...
 
class  NEBitwiseNot
 Basic function to run NEBitwiseNotKernel. More...
 
class  NEBitwiseNotKernel
 Interface for the kernel to perform bitwise NOT operation. More...
 
class  NEBitwiseOr
 Basic function to run NEBitwiseOrKernel. More...
 
class  NEBitwiseOrKernel
 Interface for the kernel to perform bitwise inclusive OR between two tensors. More...
 
class  NEBitwiseXor
 Basic function to run NEBitwiseXorKernel. More...
 
class  NEBitwiseXorKernel
 Interface for the kernel to perform bitwise exclusive OR (XOR) between two tensors. More...
 
class  NEBoundingBoxTransform
 Basic function to run NEBoundingBoxTransformKernel. More...
 
class  NEBoundingBoxTransformKernel
 Interface for the bounding box kernel. More...
 
class  NECast
 Basic function to run cpu::kernels::CpuCastKernel. More...
 
class  NEChannelShuffleLayer
 Basic function to run NEChannelShuffleLayerKernel. More...
 
class  NEChannelShuffleLayerKernel
 Interface for the channel shuffle kernel. More...
 
class  NECol2ImKernel
 Kernel to perform col2im reshaping. More...
 
class  NEComplexPixelWiseMultiplication
 Basic function to run cpu::CpuComplexMul. More...
 
class  NEComputeAllAnchorsKernel
 Interface for Compute All Anchors kernel. More...
 
class  NEConcatenateLayer
 Basic function to execute concatenate tensors along a given axis. More...
 
class  NEConv3D
 Basic function to simulate a 3d convolution. More...
 
class  NEConvertFullyConnectedWeights
 Basic function to run cpu::kernels::CpuConvertFullyConnectedWeightsKernel. More...
 
class  NEConvolutionLayer
 Basic function to simulate a convolution layer. More...
 
class  NECopy
 Basic function to run cpu::kernels::CpuCopyKernel. More...
 
class  NECropKernel
 Interface for the kernel to perform tensor cropping. More...
 
class  NECropResize
 Function to perform cropping and resizing. More...
 
class  NEDeconvolutionLayer
 Function to run the deconvolution layer. More...
 
class  NEDepthConvertLayer
 Basic function to run cpu::kernels::CpuCastKernel. More...
 
class  NEDepthToSpaceLayer
 Basic function to run NEDepthToSpaceLayerKernel. More...
 
class  NEDepthToSpaceLayerKernel
 Interface for the depth to space kernel. More...
 
class  NEDepthwiseConvolutionLayer
 Function to execute a depthwise convolution. More...
 
class  NEDequantizationLayer
 Basic function to run cpu::CpuDequantize that dequantizes an input tensor. More...
 
class  NEDetectionPostProcessLayer
 NE Function to generate the detection output based on center size encoded boxes, class prediction and anchors by doing non maximum suppression. More...
 
class  NEDirectConvolutionLayer
 Function to run the direct convolution. More...
 
class  NEElementwiseComparison
 Basic function to run cpu::kernels::CpuComparisonKernel. More...
 
class  NEElementwiseComparisonStatic
 Basic function to run cpu::kernels::CpuComparisonKernel. More...
 
class  NEElementwiseDivision
 Basic function to run cpu::kernels::CpuArithmeticKernel for division. More...
 
class  NEElementwiseMax
 Basic function to run cpu::kernels::CpuArithmeticKernel for max. More...
 
class  NEElementwiseMin
 Basic function to run cpu::kernels::CpuArithmeticKernel for min. More...
 
class  NEElementwisePower
 Basic function to run cpu::kernels::CpuArithmeticKernel for power. More...
 
class  NEElementwiseSquaredDiff
 Basic function to run cpu::kernels::CpuArithmeticKernel for squared difference. More...
 
class  NEElementwiseUnaryLayer
 Basic function to perform unary elementwise operations. More...
 
class  NEFFT1D
 Basic function to execute one dimensional FFT. More...
 
class  NEFFT2D
 Basic function to execute two dimensional FFT. More...
 
class  NEFFTConvolutionLayer
 Basic function to execute FFT-based convolution on CPU. More...
 
class  NEFFTDigitReverseKernel
 Interface for the digit reverse operation kernel. More...
 
class  NEFFTRadixStageKernel
 Interface for the FFT kernel. More...
 
class  NEFFTScaleKernel
 Interface for the inverse fft scale kernel. More...
 
class  NEFill
 Basic function to run cpu::kernels::CpuFillKernel. More...
 
class  NEFillBorder
 Basic function to run NEFillBorderKernel. More...
 
class  NEFillBorderKernel
 Interface for the kernel to fill borders. More...
 
class  NEFlattenLayer
 Basic function to execute flatten layer kernel. More...
 
class  NEFloor
 Basic function to run cpu::kernels::CpuFloorKernel. More...
 
class  NEFullyConnectedLayer
 Basic function to compute a Fully Connected layer. More...
 
class  NEFuseBatchNormalization
 Basic function to fuse the batch normalization node to a preceding convolution node. More...
 
class  NEFuseBatchNormalizationKernel
 OpenNE kernel to fuse the batch normalization node to a preceding convolution node. More...
 
class  NEGather
 Basic function to run NEGatherKernel. More...
 
class  NEGatherKernel
 Kernel to perform gather operation. More...
 
class  NEGEMM
 Basic function to execute GEMM. More...
 
class  NEGEMMConv2d
 Basic function to compute the convolution layer. More...
 
class  NEGEMMConvolutionLayer
 Basic function to compute the convolution layer. More...
 
class  NEGEMMLowpMatrixMultiplyCore
 Function to run Gemm on quantized types. More...
 
class  NEGEMMLowpOutputStage
 Basic function to execute GEMMLowpQuantizeDown kernels. More...
 
class  NEGenerateProposalsLayer
 Basic function to generate proposals for a RPN (Region Proposal Network) More...
 
class  NEInstanceNormalizationLayer
 Basic function to perform a Instance normalization. More...
 
class  NEInstanceNormalizationLayerKernel
 Interface for performing an instance normalization. More...
 
class  NEL2NormalizeLayer
 Basic function to perform a L2 normalization on a given axis. More...
 
class  NEL2NormalizeLayerKernel
 Interface for performing a L2 normalize on a given axis given the square sum of it in this axis. More...
 
class  NELogicalAnd
 Basic function to perform logical AND. More...
 
class  NELogicalNot
 Basic function to perform logical NOT. More...
 
class  NELogicalOr
 Basic function to perform logical OR. More...
 
class  NELSTMLayer
 Basic function to run NELSTMLayer. More...
 
class  NELSTMLayerQuantized
 Basic function to run NELSTMLayerQuantized. More...
 
class  NEMatMul
 Basic function to run the following operators: More...
 
class  NEMaxUnpoolingLayer
 Function to perform MaxUnpooling. More...
 
class  NEMeanStdDevNormalizationKernel
 Interface for the kernel to normalize the input 2D tensor across the first dimension with respect to mean and standard deviation of the same dimension. More...
 
class  NEMeanStdDevNormalizationLayer
 Basic function to execute mean and standard deviation normalization by calling NEMeanStdDevNormalizationKernel. More...
 
class  NENormalizationLayer
 Basic function to compute a normalization layer. More...
 
class  NENormalizationLayerKernel
 Interface for the normalization layer kernel. More...
 
class  NEPadLayer
 Basic function to pad a tensor. More...
 
class  NEPadLayerKernel
 Basic kernel to pad the input tensor given padding information. More...
 
class  NEPermute
 Basic function to run cpu::kernels::CpuPermuteKernel. More...
 
class  NEPixelWiseMultiplication
 Basic function to run cpu::CpuMul. More...
 
class  NEPooling3dLayer
 Basic function to simulate a pooling 3d layer with the specified pooling operation. More...
 
class  NEPoolingLayer
 Basic function to simulate a pooling layer with the specified pooling operation. More...
 
class  NEPReluLayer
 Basic function to run cpu::kernels::CpuArithmeticKernel for PRELU. More...
 
class  NEPriorBoxLayer
 Basic function to run NEPriorBoxLayerKernel. More...
 
class  NEPriorBoxLayerKernel
 Interface for the kernel to calculate prior boxes. More...
 
class  NEQLSTMLayer
 Basic function to run NEQLSTMLayer. More...
 
class  NEQLSTMLayerNormalizationKernel
 Kernel to perform layer normalization for QLSTM. More...
 
class  NEQuantizationLayer
 Basic function to run a quantization layer using cpu::CpuQuantize. More...
 
class  NERange
 Basic function to run NERangeKernel. More...
 
class  NERangeKernel
 Kernel class for Range. More...
 
class  NEReduceMean
 Basic function to perform reduce operation. More...
 
class  NEReductionOperation
 Basic function to simulate a reduction operation. More...
 
class  NEReductionOperationKernel
 Kernel to perform a reduction operation. More...
 
class  NEReorgLayer
 Basic function to run NEReorgLayerKernel. More...
 
class  NEReorgLayerKernel
 Interface for the kernel to perform tensor re-organization. More...
 
class  NEReshapeLayer
 Basic function to run cpu::kernels::CpuReshapeKernel. More...
 
class  NEReverse
 Basic function to run NEReverseKernel. More...
 
class  NEReverseKernel
 Interface for the reverse layer kernel. More...
 
class  NERNNLayer
 Basic function to run NERNNLayer. More...
 
class  NEROIAlignLayer
 Basic function to run NEROIAlignLayerKernel. More...
 
class  NEROIAlignLayerKernel
 Interface for the RoIAlign kernel. More...
 
class  NEROIPoolingLayer
 Basic function to run NEROIPoolingLayerKernel. More...
 
class  NEROIPoolingLayerKernel
 Interface for the ROI pooling layer kernel. More...
 
class  NEScale
 Basic function to compute Scale. More...
 
class  NESelect
 Basic function to run NESelect. More...
 
class  NESelectKernel
 Interface for the select kernel. More...
 
class  NESlice
 Basic function to perform tensor slicing. More...
 
class  NESoftmaxLayerGeneric
 Basic function to compute a SoftmaxLayer and a Log SoftmaxLayer. More...
 
class  NESpaceToBatchLayer
 Basic function to spatial divide a tensor. More...
 
class  NESpaceToBatchLayerKernel
 Interface for the space to batch kernel. More...
 
class  NESpaceToDepthLayer
 Basic function to run NESpaceToDepthLayerKernel. More...
 
class  NESpaceToDepthLayerKernel
 Interface for the space to depth kernel. More...
 
class  NESplit
 Basic function to split a tensor along a given axis. More...
 
class  NEStackLayer
 Basic function to stack tensors along an axis. More...
 
class  NEStackLayerKernel
 Basic kernel to stack a rank-R tensor into one with rank-(R+1) along the axis dimension. More...
 
class  NEStridedSlice
 Basic function to run NEStridedSliceKernel. More...
 
class  NEStridedSliceKernel
 Interface for the kernel to perform tensor strided slicing. More...
 
class  NETile
 Basic function to run NETileKernel. More...
 
class  NETileKernel
 Basic kernel to perform a tile operation. More...
 
class  NETranspose
 Basic function to run cpu::kernels::CpuTransposeKernel. More...
 
class  NEUnstack
 Basic function to unpack a rank-R tensor into rank-(R-1) tensors. More...
 
class  NEWinogradConvolutionLayer
 Basic function to simulate a convolution layer. More...
 
class  NormalizationLayerInfo
 Normalization Layer Information class. More...
 
class  OffsetLifetimeManager
 Concrete class that tracks the lifetime of registered tensors and calculates the systems memory requirements in terms of a single blob and a list of offsets. More...
 
class  OffsetMemoryPool
 Offset based memory pool. More...
 
class  OMPScheduler
 Pool of threads to automatically split a kernel's execution among several threads. More...
 
struct  Padding2D
 Padding and stride information class. More...
 
struct  Padding3D
 Padding information for 3D operations like Conv3d. More...
 
class  PadStrideInfo
 
class  PixelValue
 Class describing the value of a pixel for any image format. More...
 
struct  Pooling3dLayerInfo
 Pooling Layer Information struct. More...
 
struct  PoolingLayerInfo
 Pooling Layer Information struct. More...
 
class  PoolManager
 Memory pool manager. More...
 
class  PriorBoxLayerInfo
 PriorBox layer info. More...
 
class  Program
 Program class. More...
 
struct  Qasymm8QuantizationHelper
 
class  QuantizationInfo
 Quantization information. More...
 
struct  Rectangle
 Rectangle type. More...
 
class  ROIPoolingLayerInfo
 ROI Pooling Layer Information class. More...
 
class  RuntimeContext
 Runtime context. More...
 
struct  ScaleKernelInfo
 
struct  ScatterInfo
 Scatter operator information. More...
 
class  Scheduler
 Configurable scheduler which supports multiple multithreading APIs and choosing between different schedulers at runtime. More...
 
class  SchedulerFactory
 Scheduler Factory. More...
 
class  Semaphore
 Semamphore class. More...
 
class  SingleThreadScheduler
 Pool of threads to automatically split a kernel's execution among several threads. More...
 
class  Size2D
 Class for specifying the size of an image or rectangle. More...
 
class  Size3D
 Class for specifying the size of a 3D shape or object. More...
 
struct  SoftmaxKernelInfo
 Descriptor used by the softmax kernels. More...
 
class  Status
 Status class. More...
 
class  Steps
 Class to describe a number of elements in each dimension. More...
 
class  StridedSliceLayerInfo
 
class  Strides
 Strides of an item in bytes. More...
 
class  SubTensor
 Basic implementation of the sub-tensor interface. More...
 
class  SubTensorInfo
 Store the sub tensor's metadata. More...
 
class  Tensor
 Basic implementation of the tensor interface. More...
 
class  TensorAccessor
 Tensor accessors to make it easier to interface with arm_gemm. More...
 
class  TensorAllocator
 Basic implementation of a CPU memory tensor allocator. More...
 
class  TensorInfo
 Store the tensor's metadata. More...
 
class  TensorPack
 Tensor packing service. More...
 
class  TensorShape
 Shape of a tensor. More...
 
struct  ThreadInfo
 Information about executing thread and CPU. More...
 
struct  UniformQuantizationInfo
 Quantization info when assuming per layer quantization. More...
 
struct  ValidRegion
 Container for valid region of a window. More...
 
class  WeightsInfo
 Convolution Layer Weights Information class. More...
 
class  Window
 Describe a multidimensional execution window. More...
 
class  WindowIterator
 Iterate over a portion of a Window. More...
 
struct  WinogradInfo
 Winograd information. More...
 
struct  WorkspaceDataElement
 

Typedefs

using ICLUInt8Array = ICLArray< cl_uchar >
 Interface for OpenCL Array of uint8s. More...
 
using ICLUInt16Array = ICLArray< cl_ushort >
 Interface for OpenCL Array of uint16s. More...
 
using ICLUInt32Array = ICLArray< cl_uint >
 Interface for OpenCL Array of uint32s. More...
 
using ICLInt16Array = ICLArray< cl_short >
 Interface for OpenCL Array of int16s. More...
 
using ICLInt32Array = ICLArray< cl_int >
 Interface for OpenCL Array of int32s. More...
 
using ICLFloatArray = ICLArray< cl_float >
 Interface for OpenCL Array of floats. More...
 
using ICLImage = ICLTensor
 
using half = half_float::half
 16-bit floating point type More...
 
using PermutationVector = Strides
 Permutation vector. More...
 
using IUInt8Array = IArray< uint8_t >
 Interface for Array of uint8s. More...
 
using IUInt16Array = IArray< uint16_t >
 Interface for Array of uint16s. More...
 
using IUInt32Array = IArray< uint32_t >
 Interface for Array of uint32s. More...
 
using IInt16Array = IArray< int16_t >
 Interface for Array of int16s. More...
 
using IInt32Array = IArray< int32_t >
 Interface for Array of int32s. More...
 
using IFloatArray = IArray< float >
 Interface for Array of floats. More...
 
using IImage = ITensor
 
using qasymm8_signed_t = int8_t
 8 bit signed quantized asymmetric scalar value More...
 
using qasymm8_t = uint8_t
 8 bit quantized asymmetric scalar value More...
 
using qsymm16_t = int16_t
 16 bit quantized symmetric scalar value More...
 
using qasymm16_t = uint16_t
 16 bit quantized asymmetric scalar value More...
 
using BiStrides = Coordinates
 Bidirectional strides. More...
 
using PaddingSize = BorderSize
 Container for 2D padding size. More...
 
using PaddingInfo = std::pair< uint32_t, uint32_t >
 Padding information as a pair of unsigned int start/end. More...
 
using PaddingList = std::vector< PaddingInfo >
 List of padding information. More...
 
using Multiples = std::vector< uint32_t >
 Information to produce a tiled version of a Tensor. More...
 
using BBox = std::array< float, 4 >
 
using LabelBBox = std::map< int, std::vector< BBox > >
 
using CropInfo = Padding2D
 Class for holding information related to cropping. More...
 
using UInt8Array = Array< uint8_t >
 Array of uint8s. More...
 
using UInt16Array = Array< uint16_t >
 Array of uint16s. More...
 
using UInt32Array = Array< uint32_t >
 Array of uint32s. More...
 
using Int16Array = Array< int16_t >
 Array of int16s. More...
 
using Int32Array = Array< int32_t >
 Array of int32s. More...
 
using FloatArray = Array< float >
 Array of floats. More...
 
using CLUInt8Array = CLArray< cl_uchar >
 OpenCL Array of uint8s. More...
 
using CLUInt16Array = CLArray< cl_ushort >
 OpenCL Array of uint16s. More...
 
using CLUInt32Array = CLArray< cl_uint >
 OpenCL Array of uint32s. More...
 
using CLInt16Array = CLArray< cl_short >
 OpenCL Array of int16s. More...
 
using CLInt32Array = CLArray< cl_int >
 OpenCL Array of int32s. More...
 
using CLFloatArray = CLArray< cl_float >
 OpenCL Array of floats. More...
 
using CLImage = CLTensor
 OpenCL Image. More...
 
using CLEqual = CLComparisonStatic< ComparisonOperation::Equal >
 Basic function to run equal comparison. More...
 
using CLNotEqual = CLComparisonStatic< ComparisonOperation::NotEqual >
 Basic function to run not equal comparison. More...
 
using CLGreater = CLComparisonStatic< ComparisonOperation::Greater >
 Basic function to run greater comparison. More...
 
using CLGreaterEqual = CLComparisonStatic< ComparisonOperation::GreaterEqual >
 Basic function to run greater-equal comparison. More...
 
using CLLess = CLComparisonStatic< ComparisonOperation::Less >
 Basic function to run less comparison. More...
 
using CLLessEqual = CLComparisonStatic< ComparisonOperation::LessEqual >
 Basic function to run less-equal comparison. More...
 
using CLSoftmaxLayer = CLSoftmaxLayerGeneric< false >
 
using CLLogSoftmaxLayer = CLSoftmaxLayerGeneric< true >
 
using NEEqual = NEElementwiseComparisonStatic< ComparisonOperation::Equal >
 Basic function to run equal comparison. More...
 
using NENotEqual = NEElementwiseComparisonStatic< ComparisonOperation::NotEqual >
 Basic function to run not equal comparison. More...
 
using NEGreater = NEElementwiseComparisonStatic< ComparisonOperation::Greater >
 Basic function to run greater comparison. More...
 
using NEGreaterEqual = NEElementwiseComparisonStatic< ComparisonOperation::GreaterEqual >
 Basic function to run greater-equal comparison. More...
 
using NELess = NEElementwiseComparisonStatic< ComparisonOperation::Less >
 Basic function to run less comparison. More...
 
using NELessEqual = NEElementwiseComparisonStatic< ComparisonOperation::LessEqual >
 Basic function to run less-equal comparison. More...
 
using NERsqrtLayer = NEElementwiseUnaryLayer< ElementWiseUnary::RSQRT >
 
using NEExpLayer = NEElementwiseUnaryLayer< ElementWiseUnary::EXP >
 
using NENegLayer = NEElementwiseUnaryLayer< ElementWiseUnary::NEG >
 
using NELogLayer = NEElementwiseUnaryLayer< ElementWiseUnary::LOG >
 
using NEAbsLayer = NEElementwiseUnaryLayer< ElementWiseUnary::ABS >
 
using NERoundLayer = NEElementwiseUnaryLayer< ElementWiseUnary::ROUND >
 
using NESinLayer = NEElementwiseUnaryLayer< ElementWiseUnary::SIN >
 
using NESoftmaxLayer = NESoftmaxLayerGeneric< false >
 
using NELogSoftmaxLayer = NESoftmaxLayerGeneric< true >
 
using INEKernel = ICPPKernel
 Common interface for all kernels implemented in Neon. More...
 
using NEScheduler = Scheduler
 CPU Scheduler. More...
 
using Image = Tensor
 Image. More...
 
using MemoryMappings = std::map< IMemory *, size_t >
 A map of (handle, index/offset), where handle is the memory handle of the object to provide the memory for and index/offset is the buffer/offset from the pool that should be used. More...
 
using GroupMappings = std::map< size_t, MemoryMappings >
 A map of the groups and memory mappings. More...
 
using MemoryRequirements = experimental::MemoryRequirements
 
template<typename TensorType >
using WorkspaceData = std::vector< WorkspaceDataElement< TensorType > >
 
using qasymm8x8_t = uint8x8_t
 8 bit quantized asymmetric vector with 8 elements More...
 
using qasymm8x8x2_t = uint8x8x2_t
 8 bit quantized asymmetric vector with 16 elements More...
 
using qasymm8x8x3_t = uint8x8x3_t
 8 bit quantized asymmetric vector with 24 elements More...
 
using qasymm8x8x4_t = uint8x8x4_t
 8 bit quantized asymmetric vector with 32 elements More...
 
using qasymm8x16_t = uint8x16_t
 8 bit quantized asymmetric vector with 16 elements More...
 
using qasymm8x8_signed_t = int8x8_t
 8 bit quantized signed asymmetric vector with 8 elements More...
 
using qasymm8x8x2_signed_t = int8x8x2_t
 8 bit quantized signed asymmetric vector with 16 elements More...
 
using qasymm8x8x3_signed_t = int8x8x3_t
 8 bit quantized signed asymmetric vector with 24 elements More...
 
using qasymm8x8x4_signed_t = int8x8x4_t
 8 bit quantized signed asymmetric vector with 32 elements More...
 
using qasymm8x16_signed_t = int8x16_t
 8 bit quantized signed asymmetric vector with 16 elements More...
 
using qsymm8_t = int8_t
 8 bit quantized symmetric scalar value More...
 
using qsymm16x8_t = int16x8_t
 16 bit quantized symmetric vector with 8 elements More...
 
using qsymm16x8x2_t = int16x8x2_t
 16 bit quantized symmetric vector with 16 elements More...
 
typedef float float32_t
 
using OperatorType = opencl::ClGemm
 
using Mutex = std::mutex
 Wrapper of Mutex data-object. More...
 
template<typename Mutex >
using lock_guard = std::lock_guard< Mutex >
 Wrapper of lock_guard data-object. More...
 
template<typename Mutex >
using unique_lock = std::unique_lock< Mutex >
 Wrapper of lock_guard data-object. More...
 

Enumerations

enum  CLVersion {
  CL10, CL11, CL12, CL20,
  CL30, UNKNOWN
}
 Available OpenCL Version. More...
 
enum  CLKernelType {
  UNKNOWN, UNKNOWN, DEPTHWISE, DIRECT,
  ELEMENTWISE, GEMM, POOL, WINOGRAD
}
 
enum  Channel {
  UNKNOWN, C0, C1, C2,
  C3, R, G, B,
  A, Y, U, V
}
 Available channels. More...
 
enum  Format {
  UNKNOWN, U8, S16, U16,
  S32, U32, S64, U64,
  BFLOAT16, F16, F32, UV88,
  RGB888, RGBA8888, YUV444, YUYV422,
  NV12, NV21, IYUV, UYVY422
}
 Image colour formats. More...
 
enum  DataType {
  UNKNOWN, U8, S8, QSYMM8,
  QASYMM8, QASYMM8_SIGNED, QSYMM8_PER_CHANNEL, U16,
  S16, QSYMM16, QASYMM16, U32,
  S32, U64, S64, BFLOAT16,
  F16, F32, F64, SIZET
}
 Available data types. More...
 
enum  DataLayout {
  UNKNOWN, NCHW, NHWC, NCDHW,
  NDHWC
}
 [DataLayout enum definition] More...
 
enum  DataLayoutDimension {
  CHANNEL, HEIGHT, WIDTH, DEPTH,
  BATCHES
}
 [DataLayout enum definition] More...
 
enum  DimensionRoundingType { FLOOR, CEIL }
 Dimension rounding type when down-scaling on CNNs. More...
 
enum  WeightFormat {
  UNSPECIFIED = 0x1, ANY = 0x2, OHWI = 0x100100, OHWIo2 = 0x100200,
  OHWIo4 = 0x100400, OHWIo8 = 0x100800, OHWIo16 = 0x101000, OHWIo32 = 0x102000,
  OHWIo64 = 0x104000, OHWIo128 = 0x108000, OHWIo4i2 = 0x200400, OHWIo4i2_bf16 = 0x200410,
  OHWIo8i2 = 0x200800, OHWIo8i2_bf16 = 0x200810, OHWIo16i2 = 0x201000, OHWIo16i2_bf16 = 0x201010,
  OHWIo32i2 = 0x202000, OHWIo32i2_bf16 = 0x202010, OHWIo64i2 = 0x204000, OHWIo64i2_bf16 = 0x204010,
  OHWIo4i4 = 0x400400, OHWIo4i4_bf16 = 0x400410, OHWIo8i4 = 0x400800, OHWIo8i4_bf16 = 0x400810,
  OHWIo16i4 = 0x401000, OHWIo16i4_bf16 = 0x401010, OHWIo32i4 = 0x402000, OHWIo32i4_bf16 = 0x402010,
  OHWIo64i4 = 0x404000, OHWIo64i4_bf16 = 0x404010, OHWIo2i8 = 0x800200, OHWIo4i8 = 0x800400,
  OHWIo8i8 = 0x800800, OHWIo16i8 = 0x801000, OHWIo32i8 = 0x802000, OHWIo64i8 = 0x804000
}
 Memory layouts for the weights tensor. More...
 
enum  CPUModel {
  X, GENERIC, GENERIC_FP16, GENERIC_FP16_DOT,
  A53, A55r0, A55r1, A35,
  A73, A76, A510, X1,
  V1, A64FX, N1
}
 CPU models types. More...
 
enum  ErrorCode { OK, RUNTIME_ERROR, UNSUPPORTED_EXTENSION_USE }
 Available error codes. More...
 
enum  TensorType : int32_t {
  ACL_UNKNOWN = -1, ACL_SRC_DST = 0, ACL_SRC = 0, ACL_SRC_0 = 0,
  ACL_SRC_1 = 1, ACL_SRC_2 = 2, ACL_SRC_3 = 3, ACL_SRC_4 = 4,
  ACL_SRC_5 = 5, ACL_SRC_6 = 6, ACL_SRC_END = 6, ACL_DST = 30,
  ACL_DST_0 = 30, ACL_DST_1 = 31, ACL_DST_2 = 32, ACL_DST_END = 32,
  ACL_INT = 50, ACL_INT_0 = 50, ACL_INT_1 = 51, ACL_INT_2 = 52,
  ACL_INT_3 = 53, ACL_INT_4 = 54, ACL_SRC_VEC = 256, ACL_DST_VEC = 512,
  ACL_INT_VEC = 1024, ACL_BIAS = ACL_SRC_2, ACL_VEC_ROW_SUM = ACL_SRC_3, ACL_VEC_COL_SUM = ACL_SRC_4,
  ACL_SHIFTS = ACL_SRC_5, ACL_MULTIPLIERS = ACL_SRC_6
}
 Memory type. More...
 
enum  GPUTarget {
  UNKNOWN = 0x101, GPU_ARCH_MASK = 0xF00, GPU_GENERATION_MASK = 0x0F0, MIDGARD = 0x100,
  BIFROST = 0x200, VALHALL = 0x300, FIFTHGEN = 0X400, T600 = 0x110,
  T700 = 0x120, T800 = 0x130, G71 = 0x210, G72 = 0x220,
  G51 = 0x221, G51BIG = 0x222, G51LIT = 0x223, G31 = 0x224,
  G76 = 0x230, G52 = 0x231, G52LIT = 0x232, G77 = 0x310,
  G57 = 0x311, G78 = 0x320, G68 = 0x321, G78AE = 0x330,
  G710 = 0x340, G610 = 0x341, G510 = 0x342, G310 = 0x343,
  G715 = 0x350, G615 = 0x351, G720 = 0x410, G620 = 0X411
}
 Available GPU Targets. More...
 
enum  DeviceType { NEON, CL }
 Device types. More...
 
enum  RoundingPolicy { TO_ZERO, TO_NEAREST_UP, TO_NEAREST_EVEN }
 Rounding method. More...
 
enum  SamplingPolicy { CENTER, TOP_LEFT }
 Available Sampling Policies. More...
 
enum  ConvolutionMethod {
  GEMM, GEMM_CONV2D, DIRECT, INDIRECT,
  WINOGRAD, FFT
}
 Available ConvolutionMethod. More...
 
enum  DepthwiseConvolutionFunction { OPTIMIZED, GENERIC }
 Available DepthwiseConvolutionFunction. More...
 
enum  DeconvolutionMethod { GEMM, DIRECT, UPSCALE_CONV2D }
 Available DeconvolutionMethod. More...
 
enum  FuseBatchNormalizationType { CONVOLUTION, DEPTHWISECONVOLUTION }
 Available FuseBatchNormalizationType. More...
 
enum  PaddingMode { CONSTANT, REFLECT, SYMMETRIC }
 Padding mode to use for PadLayer. More...
 
enum  ComparisonOperation {
  Equal, NotEqual, Greater, GreaterEqual,
  Less, LessEqual
}
 Supported comparison operations. More...
 
enum  BorderMode { UNDEFINED, CONSTANT, REPLICATE }
 Methods available to handle borders. More...
 
enum  ConvertPolicy { WRAP, SATURATE }
 Policy to handle integer overflow. More...
 
enum  InterpolationPolicy { NEAREST_NEIGHBOR, BILINEAR, AREA }
 Interpolation method. More...
 
enum  BilinearInterpolation { BILINEAR_OLD_NEW, BILINEAR_SCHARR }
 Bilinear Interpolation method used by LKTracker. More...
 
enum  ReductionOperation {
  ARG_IDX_MAX, ARG_IDX_MIN, MEAN_SUM, PROD,
  SUM_SQUARE, SUM, MIN, MAX
}
 Available reduction operations. More...
 
enum  ArithmeticOperation {
  ADD, SUB, DIV, MIN,
  MAX, SQUARED_DIFF, POWER, PRELU
}
 Available element-wise operations. More...
 
enum  ElementWiseUnary {
  RSQRT, EXP, NEG, LOG,
  ABS, SIN, ROUND, LOGICAL_NOT
}
 Available element wise unary operations. More...
 
enum  BitwiseOperation { AND, NOT, OR, XOR }
 Available bitwise operations. More...
 
enum  NormType { IN_MAP_1D, IN_MAP_2D, CROSS_MAP }
 The normalization type used for the normalization layer. More...
 
enum  PoolingType { MAX, AVG, L2 }
 Available pooling types. More...
 
enum  NMSType { LINEAR, GAUSSIAN, ORIGINAL }
 Available non maxima suppression types. More...
 
enum  DetectionOutputLayerCodeType { CORNER, CENTER_SIZE, CORNER_SIZE, TF_CENTER }
 Available Detection Output code types. More...
 
enum  ActivationFunction {
  LOGISTIC, TANH, RELU, BOUNDED_RELU,
  LU_BOUNDED_RELU, LEAKY_RELU, SOFT_RELU, ELU,
  ABS, SQUARE, SQRT, LINEAR,
  IDENTITY, HARD_SWISH, SWISH, GELU
}
 Available activation functions. More...
 
enum  GEMMLowpOutputStageType { NONE, QUANTIZE_DOWN, QUANTIZE_DOWN_FIXEDPOINT, QUANTIZE_DOWN_FLOAT }
 GEMMLowp output stage type. More...
 
enum  ScatterFunction {
  Update = 0, Add = 1, Sub = 2, Max = 3,
  Min = 4
}
 Scatter Function. More...
 
enum  CLTunerMode { EXHAUSTIVE, NORMAL, RAPID }
 < OpenCL tuner modes More...
 
enum  CLGEMMKernelType { NATIVE, RESHAPED, RESHAPED_ONLY_RHS, RESHAPED_ONLY_RHS_MMUL }
 OpenCL GEMM kernel types. More...
 
enum  CLBackendType { Native, Clvk }
 List the possible OpenCL backends. More...
 
enum  FFTDirection { Forward, Inverse }
 FFT direction to use. More...
 
enum  MappingType { BLOBS, OFFSETS }
 Mapping type. More...
 
enum  StatusCode {
  Success = AclSuccess, RuntimeError = AclRuntimeError, OutOfMemory = AclOutOfMemory, Unimplemented = AclUnimplemented,
  UnsupportedTarget = AclUnsupportedTarget, InvalidTarget = AclInvalidTarget, InvalidArgument = AclInvalidArgument, UnsupportedConfig = AclUnsupportedConfig,
  InvalidObjectState = AclInvalidObjectState
}
 
enum  Target { Cpu = AclTarget::AclCpu, GpuOcl = AclTarget::AclGpuOcl }
 
enum  ExecutionMode { FastRerun = AclPreferFastRerun, FastStart = AclPreferFastStart }
 
enum  ImportMemoryType { HostPtr = AclImportMemoryType::AclHostPtr }
 
enum  CLImage2DType { ReadOnly, WriteOnly }
 OpenCL Image2D types. More...
 
enum  LogicalOperation { Unknown, And, Or, Not }
 List of supported logical operations. More...
 

Functions

std::string get_cl_type_from_data_type (const DataType &dt)
 Translates a tensor data type to the appropriate OpenCL type. More...
 
std::string get_cl_promoted_type_from_data_type (const DataType &dt)
 Translates a tensor data type to the appropriate OpenCL promoted type. More...
 
std::string get_cl_unsigned_type_from_element_size (size_t element_size)
 Translates the element size to an unsigned integer data type. More...
 
std::string get_cl_signed_type_from_element_size (size_t element_size)
 Translates the element size to an signed integer data type. More...
 
std::string get_cl_select_type_from_data_type (const DataType &dt)
 Translates a tensor data type to the appropriate OpenCL select type. More...
 
std::string get_cl_dot8_acc_type_from_data_type (const DataType &dt)
 Translates a tensor data type to the appropriate OpenCL dot8 accumulator type. More...
 
std::string get_data_size_from_data_type (const DataType &dt)
 Get the size of a data type in number of bits. More...
 
GPUTarget get_target_from_device (const cl::Device &device)
 Helper function to get the GPU target from CL device. More...
 
CLVersion get_cl_version (const cl::Device &device)
 Helper function to get the highest OpenCL version supported. More...
 
size_t get_cl_image_pitch_alignment (const cl::Device &device)
 Helper function to get the cl_image pitch alignment in pixels. More...
 
bool get_cl_non_uniform_work_group_supported (const cl::Device &device)
 Helper function to check whether non-uniform work group is supported. More...
 
bool device_supports_extension (const cl::Device &device, const char *extension_name)
 Helper function to check whether a given extension is supported. More...
 
bool fp16_supported (const cl::Device &device)
 Helper function to check whether the cl_khr_fp16 extension is supported. More...
 
bool arm_non_uniform_workgroup_supported (const cl::Device &device)
 Helper function to check whether the arm_non_uniform_work_group_size extension is supported. More...
 
bool dot8_supported (const cl::Device &device)
 Helper function to check whether the cl_arm_integer_dot_product_int8 extension is supported. More...
 
bool dot8_acc_supported (const cl::Device &device)
 Helper function to check whether the cl_arm_integer_dot_product_accumulate_int8 extension is supported. More...
 
bool cl_winograd_convolution_layer_supported (const Size2D &output_tile, const Size2D &kernel_size, DataLayout data_layout)
 This function checks if the Winograd configuration (defined through the output tile, kernel size and the data layout) is supported on OpenCL. More...
 
size_t preferred_vector_width (const cl::Device &device, DataType dt)
 Helper function to get the preferred native vector width size for built-in scalar types that can be put into vectors. More...
 
bool preferred_dummy_work_items_support (const cl::Device &device)
 Helper function to check if "dummy work-items" are preferred to have a power of two NDRange In case dummy work-items is enabled, it is OpenCL kernel responsibility to check if the work-item is out-of range or not. More...
 
bool image2d_from_buffer_supported (const cl::Device &device)
 Helper function to check whether the cl_khr_image2d_from_buffer extension is supported. More...
 
cl::Kernel create_kernel (const CLCompileContext &ctx, const std::string &kernel_name, const std::set< std::string > &build_opts=std::set< std::string >())
 Creates an opencl kernel using a compile context. More...
 
cl::NDRange create_lws_hint_parallel_implementations (unsigned int input_dimension, unsigned int vector_size)
 Creates a suitable LWS hint object for parallel implementations. More...
 
bool get_wbsm_support_info (const cl::Device &device)
 
void set_wbsm (cl::Kernel &kernel, cl_int wbsm_hint)
 
bool export_to_cl_image (const ITensorInfo *tensor)
 
void set_unroll_with_pragma (CLBuildOptions &built_opts, std::initializer_list< int > values)
 
bool arm_matrix_multiply_supported (const cl::Device &device)
 Helper function to check whether the cl_arm_matrix_multiply extension is supported. More...
 
bool command_buffer_supported (const cl::Device &device)
 Check whether cl_khr_command_buffer extension is supported by the specified CL device. More...
 
bool command_buffer_mutable_dispatch_supported (const cl::Device &device)
 Check whether cl_khr_command_buffer_mutable_dispatch extension is supported by the specified CL device. More...
 
bool opencl_is_available ()
 Check if OpenCL is available. More...
 
template<typename T >
bool operator== (const Dimensions< T > &lhs, const Dimensions< T > &rhs)
 Check that given dimensions are equal. More...
 
template<typename T >
bool operator!= (const Dimensions< T > &lhs, const Dimensions< T > &rhs)
 Check that given dimensions are not equal. More...
 
template<typename... T>
void ignore_unused (T &&...)
 Ignores unused arguments. More...
 
Status create_error (ErrorCode error_code, std::string msg)
 Creates an error containing the error message. More...
 
Status create_error_msg (ErrorCode error_code, const char *func, const char *file, int line, const char *msg)
 Creates an error and the error message. More...
 
void throw_error (Status err)
 Throw an std::runtime_error. More...
 
const std::string & string_from_target (GPUTarget target)
 Translates a given gpu device target to string. More...
 
GPUTarget get_target_from_name (const std::string &device_name)
 Helper function to get the GPU target from a device name. More...
 
GPUTarget get_arch_from_target (GPUTarget target)
 Helper function to get the GPU arch. More...
 
template<typename... Args>
bool gpu_target_is_in (GPUTarget target_to_check, GPUTarget target, Args... targets)
 Helper function to check whether a gpu target is equal to the provided targets. More...
 
bool gpu_target_is_in (GPUTarget target_to_check, GPUTarget target)
 Variant of gpu_target_is_in for comparing two targets. More...
 
template<typename L , typename... Ts>
void execute_window_loop (const Window &w, L &&lambda_function, Ts &&...iterators)
 Iterate through the passed window, automatically adjusting the iterators and calling the lambda_functino for each element. More...
 
template<typename T >
void permute (Dimensions< T > &dimensions, const PermutationVector &perm)
 Permutes given Dimensions according to a permutation vector. More...
 
void permute (TensorShape &shape, const PermutationVector &perm)
 Permutes given TensorShape according to a permutation vector. More...
 
ValidRegion calculate_valid_region_scale (const ITensorInfo &src_info, const TensorShape &dst_shape, InterpolationPolicy interpolate_policy, SamplingPolicy sampling_policy, bool border_undefined)
 Helper function to calculate the Valid Region for Scale. More...
 
Coordinates index2coords (const TensorShape &shape, int index)
 Convert a linear index into n-dimensional coordinates. More...
 
int coords2index (const TensorShape &shape, const Coordinates &coord)
 Convert n-dimensional coordinates into a linear index. More...
 
const std::map< DataLayout, std::vector< DataLayoutDimension > > & get_layout_map ()
 Returns a static map used to find an index or dimension based on a data layout. More...
 
size_t get_data_layout_dimension_index (const DataLayout &data_layout, const DataLayoutDimension &data_layout_dimension)
 Get the index of the given dimension. More...
 
DataLayoutDimension get_index_data_layout_dimension (const DataLayout &data_layout, const size_t index)
 Get the DataLayoutDimension of a given index and layout. More...
 
Size2D compute_winograd_convolution_tiles (const Size2D &in_dims, const Size2D &kernel_size, const Size2D &output_tile_size, const PadStrideInfo &conv_info)
 Calculate the number of output tiles required by Winograd Convolution layer. More...
 
template<typename T >
wrap_around (T x, T m)
 Wrap-around a number within the range 0 <= x < m. More...
 
Coordinatesconvert_negative_axis (Coordinates &coords, int max_value)
 Convert negative coordinates to positive in the range [0, num_dims_input]. More...
 
int adjust_down (int required, int available, int step)
 Decrease required in steps of step until it's less than available. More...
 
int adjust_up (int required, int available, int step)
 Increase required in steps of step until it's greater than available. More...
 
bool operator== (const QuantizationInfo &lhs, const QuantizationInfo &rhs)
 Check whether two quantization info are equal. More...
 
bool operator!= (const QuantizationInfo &lhs, const QuantizationInfo &rhs)
 Check whether two quantization info are not equal. More...
 
bool operator== (const UniformQuantizationInfo &lhs, const UniformQuantizationInfo &rhs)
 Check whether two quantization info are equal. More...
 
bool operator!= (const UniformQuantizationInfo &lhs, const UniformQuantizationInfo &rhs)
 Check whether two quantization info are not equal. More...
 
template<typename INFO_TYPE >
uint8_t quantize_qasymm8 (float value, const INFO_TYPE &qinfo, RoundingPolicy rounding_policy=RoundingPolicy::TO_NEAREST_UP)
 Quantize a value given an unsigned 8-bit asymmetric quantization scheme. More...
 
template<typename INFO_TYPE >
int8_t quantize_qasymm8_signed (float value, const INFO_TYPE &qinfo, RoundingPolicy rounding_policy=RoundingPolicy::TO_NEAREST_UP)
 Quantize a value given a signed 8-bit asymmetric quantization scheme. More...
 
int8_t quantize_qsymm8 (float value, const QuantizationInfo &qinfo)
 Quantize a value given a 8-bit symmetric quantization scheme. More...
 
int8_t quantize_qsymm8_per_channel (float value, const QuantizationInfo &qinfo, size_t channel_id=0)
 Quantize a value given a 8-bit symmetric per channel quantization scheme. More...
 
template<typename INFO_TYPE >
float dequantize_qasymm8 (uint8_t value, const INFO_TYPE &qinfo)
 Dequantize a value given an unsigned 8-bit asymmetric quantization scheme. More...
 
template<typename INFO_TYPE >
float dequantize_qasymm8_signed (int8_t value, const INFO_TYPE &qinfo)
 Dequantize a value given a signed 8-bit asymmetric quantization scheme. More...
 
float dequantize (uint8_t value, float scale, int32_t offset)
 Dequantize a value given an 8-bit asymmetric quantization scheme. More...
 
float dequantize_qsymm8 (int8_t value, const UniformQuantizationInfo &qinfo)
 Dequantize a value given a 8-bit symmetric quantization scheme. More...
 
float dequantize (int8_t value, float scale)
 Dequantize a value given a 8-bit symmetric quantization scheme. More...
 
float dequantize (int16_t value, float scale)
 Dequantize a value given a 16-bit symmetric quantization scheme. More...
 
float dequantize (uint16_t value, float scale, int32_t offset)
 Dequantize a value given a 16-bit asymmetric quantization scheme. More...
 
float dequantize (int32_t value, float scale, int32_t offset)
 Dequantize a value given a 32-bit asymmetric quantization scheme. More...
 
int16_t quantize_qsymm16 (float value, const UniformQuantizationInfo &qinfo, RoundingPolicy rounding_policy=RoundingPolicy::TO_NEAREST_UP)
 Quantize a value given a 16-bit symmetric quantization scheme. More...
 
float dequantize_qsymm16 (int16_t value, const UniformQuantizationInfo &qinfo)
 Dequantize a value given a 16-bit symmetric quantization scheme. More...
 
int16_t quantize_qsymm16 (float value, const QuantizationInfo &qinfo)
 Quantize a value given a 16-bit symmetric quantization scheme. More...
 
float dequantize_qsymm16 (int16_t value, const QuantizationInfo &qinfo)
 Dequantize a value given a 16-bit symmetric quantization scheme. More...
 
uint16_t quantize_qasymm16 (float value, const UniformQuantizationInfo &qinfo, RoundingPolicy rounding_policy=RoundingPolicy::TO_NEAREST_UP)
 Quantize a value given a 16-bit asymmetric quantization scheme. More...
 
float dequantize_qasymm16 (uint16_t value, const UniformQuantizationInfo &qinfo)
 Dequantize a value given a 16-bit asymmetric quantization scheme. More...
 
uint16_t quantize_qasymm16 (float value, const QuantizationInfo &qinfo)
 Quantize a value given a 16-bit asymmetric quantization scheme. More...
 
float dequantize_qasymm16 (uint16_t value, const QuantizationInfo &qinfo)
 Dequantize a value given a 16-bit asymmetric quantization scheme. More...
 
float dequantize_s32 (int32_t value, const UniformQuantizationInfo &qinfo)
 Dequantize a value given a 32-bit asymmetric quantization scheme. More...
 
float dequantize_s32 (int32_t value, const QuantizationInfo &qinfo)
 Dequantize a value given a 32-bit asymmetric quantization scheme. More...
 
UniformQuantizationInfo compute_requantization_scale_offset (const UniformQuantizationInfo &uqinfo_in, const UniformQuantizationInfo &uqinfo_out)
 
int round (float x, RoundingPolicy rounding_policy)
 Return a rounded value of x. More...
 
bool operator== (const TensorInfo &lhs, const TensorInfo &rhs)
 Check whether two tensor info are equal. More...
 
bool operator== (const ValidRegion &lhs, const ValidRegion &rhs)
 
int interleave_by (const WeightFormat wf)
 
int block_by (const WeightFormat wf)
 
bool is_fixed_format (const WeightFormat &wf)
 
bool is_fixed_format_fast_math (const WeightFormat &wf)
 
const std::string & string_from_activation_func (const ActivationFunction &act)
 Translates a given activation function to a string. More...
 
const std::string & string_from_data_layout (DataLayout dl)
 Convert a data layout identity into a string. More...
 
size_t data_size_from_type (DataType data_type)
 The size in bytes of the data type. More...
 
size_t element_size_from_data_type (DataType dt)
 The size in bytes of the data type. More...
 
DataType data_type_from_format (Format format)
 Return the data type used by a given single-planar pixel format. More...
 
DataType get_promoted_data_type (DataType dt)
 Return the promoted data type of a given data type. More...
 
std::tuple< PixelValue, PixelValueget_min_max (DataType dt)
 Compute the mininum and maximum values a data type can take. More...
 
const std::string & string_from_data_type (DataType dt)
 Convert a data type identity into a string. More...
 
DataType data_type_from_name (const std::string &name)
 Convert a string to DataType. More...
 
inline ::std::istream & operator>> (::std::istream &stream, DataType &data_type)
 Input Stream operator for DataType. More...
 
bool is_data_type_float (DataType dt)
 Check if a given data type is of floating point type. More...
 
bool is_data_type_quantized (DataType dt)
 Check if a given data type is of quantized type. More...
 
bool is_data_type_quantized_asymmetric (DataType dt)
 Check if a given data type is of asymmetric quantized type. More...
 
bool is_data_type_quantized_asymmetric_signed (DataType dt)
 Check if a given data type is of asymmetric quantized signed type. More...
 
bool is_data_type_quantized_asymmetric_char (DataType dt)
 Check if a given data type is of 8-bit asymmetric quantized signed type. More...
 
bool is_data_type_quantized_symmetric (DataType dt)
 Check if a given data type is of symmetric quantized type. More...
 
bool is_data_type_quantized_per_channel (DataType dt)
 Check if a given data type is of per channel type. More...
 
template<typename T >
bool check_value_range (T val, DataType dt, QuantizationInfo qinfo=QuantizationInfo())
 Returns true if the value can be represented by the given data type. More...
 
std::string cpu_impl_dt (const DataType &data_type)
 Returns the suffix string of CPU kernel implementation names based on the given data type. More...
 
size_t pixel_size_from_format (Format format)
 The size in bytes of the pixel format. More...
 
int plane_idx_from_channel (Format format, Channel channel)
 Return the plane index of a given channel given an input format. More...
 
int channel_idx_from_format (Format format, Channel channel)
 Return the channel index of a given channel given an input format. More...
 
size_t num_planes_from_format (Format format)
 Return the number of planes for a given format. More...
 
size_t num_channels_from_format (Format format)
 Return the number of channels for a given single-planar pixel format. More...
 
const std::string & string_from_format (Format format)
 Convert a tensor format into a string. More...
 
unsigned int adjust_vec_size (unsigned int vec_size, size_t dim0)
 Returns the adjusted vector size in case it is less than the input's first dimension, getting rounded down to its closest valid vector size. More...
 
const std::string & string_from_interpolation_policy (InterpolationPolicy policy)
 Translates a given interpolation policy to a string. More...
 
template<typename S , typename T >
constexpr auto DIV_CEIL (S val, T m) -> decltype((val+m - 1)/m)
 Calculate the rounded up quotient of val / m. More...
 
template<typename S , typename T >
auto ceil_to_multiple (S value, T divisor) -> decltype(((value+divisor - 1)/divisor) *divisor)
 Computes the smallest number larger or equal to value that is a multiple of divisor. More...
 
template<typename S , typename T >
auto floor_to_multiple (S value, T divisor) -> decltype((value/divisor) *divisor)
 Computes the largest number smaller or equal to value that is a multiple of divisor. More...
 
std::string lower_string (const std::string &val)
 Lower a given string. More...
 
std::string upper_string (const std::string &val)
 Raise a given string to upper case. More...
 
std::string float_to_string_with_full_precision (float val)
 Create a string with the float in full precision. More...
 
std::string join (const std::vector< std::string > strings, const std::string &sep)
 Join a sequence of strings with separator sep. More...
 
std::string read_file (const std::string &filename, bool binary)
 Load an entire file in memory. More...
 
template<typename T >
void permute_strides (Dimensions< T > &dimensions, const PermutationVector &perm)
 Permutes the given dimensions according the permutation vector. More...
 
PadStrideInfo calculate_same_pad (TensorShape input_shape, TensorShape weights_shape, PadStrideInfo conv_info, DataLayout data_layout=DataLayout::NCHW, const Size2D &dilation=Size2D(1u, 1u), const DimensionRoundingType &rounding_type=DimensionRoundingType::FLOOR)
 Calculate padding requirements in case of SAME padding. More...
 
std::pair< unsigned int, unsigned int > deconvolution_output_dimensions (unsigned int in_width, unsigned int in_height, unsigned int kernel_width, unsigned int kernel_height, const PadStrideInfo &pad_stride_info)
 Returns expected width and height of the deconvolution's output tensor. More...
 
std::pair< unsigned int, unsigned int > scaled_dimensions (int width, int height, int kernel_width, int kernel_height, const PadStrideInfo &pad_stride_info, const Size2D &dilation=Size2D(1U, 1U))
 Returns expected width and height of output scaled tensor depending on dimensions rounding mode. More...
 
std::pair< int, int > scaled_dimensions_signed (int width, int height, int kernel_width, int kernel_height, const PadStrideInfo &pad_stride_info)
 Returns calculated width and height of output scaled tensor depending on dimensions rounding mode. More...
 
std::tuple< int, int, int > scaled_3d_dimensions_signed (int width, int height, int depth, int kernel_width, int kernel_height, int kernel_depth, const Pooling3dLayerInfo &pool3d_info)
 Returns calculated width, height and depth of output scaled tensor depending on dimensions rounding mode. More...
 
bool needs_serialized_reduction (ReductionOperation op, DataType dt, unsigned int axis)
 Check if the given reduction operation should be handled in a serial way. More...
 
QuantizationInfo get_softmax_output_quantization_info (DataType input_type, bool is_log)
 Returns output quantization information for softmax layer. More...
 
std::pair< int32_t, int32_t > get_quantized_activation_min_max (const ActivationLayerInfo &act_info, DataType data_type, UniformQuantizationInfo oq_info)
 Returns a pair of minimum and maximum values for a quantized activation. More...
 
const std::string & string_from_channel (Channel channel)
 Convert a channel identity into a string. More...
 
const std::string & string_from_border_mode (BorderMode border_mode)
 Translates a given border mode policy to a string. More...
 
const std::string & string_from_norm_type (NormType type)
 Translates a given normalization type to a string. More...
 
const std::string & string_from_pooling_type (PoolingType type)
 Translates a given pooling type to a string. More...
 
bool is_pool_region_entirely_outside_input (const PoolingLayerInfo &info)
 Check if the pool region is entirely outside the input tensor. More...
 
bool is_pool_3d_region_entirely_outside_input (const Pooling3dLayerInfo &info)
 Check if the 3d pool region is entirely outside the input tensor. More...
 
bool is_symmetric (const Padding3D &info)
 Check if the 3D padding is symmetric i.e. More...
 
const std::string & string_from_gemmlowp_output_stage (GEMMLowpOutputStageType output_stage)
 Translates a given GEMMLowp output stage to a string. More...
 
std::string string_from_pixel_value (const PixelValue &value, const DataType data_type)
 Convert a PixelValue to a string, represented through the specific data type. More...
 
std::unordered_map< const ITensorInfo *, PaddingSizeget_padding_info (std::initializer_list< const ITensorInfo * > infos)
 Stores padding information before configuring a kernel. More...
 
std::unordered_map< const ITensorInfo *, PaddingSizeget_padding_info (std::initializer_list< const ITensor * > tensors)
 Stores padding information before configuring a kernel. More...
 
bool has_padding_changed (const std::unordered_map< const ITensorInfo *, PaddingSize > &padding_map)
 Check if the previously stored padding info has changed after configuring a kernel. More...
 
size_t num_of_elements_in_range (const float start, const float end, const float step)
 Returns the number of elements required to go from start to end with the wanted step. More...
 
template<typename... Ts>
arm_compute::Status error_on_nullptr (const char *function, const char *file, const int line, Ts &&...pointers)
 Create an error if one of the pointers is a nullptr. More...
 
arm_compute::Status error_on_mismatching_windows (const char *function, const char *file, const int line, const Window &full, const Window &win)
 Return an error if the passed window is invalid. More...
 
arm_compute::Status error_on_invalid_subwindow (const char *function, const char *file, const int line, const Window &full, const Window &sub)
 Return an error if the passed subwindow is invalid. More...
 
arm_compute::Status error_on_window_not_collapsable_at_dimension (const char *function, const char *file, const int line, const Window &full, const Window &window, const int dim)
 Return an error if the window can't be collapsed at the given dimension. More...
 
arm_compute::Status error_on_coordinates_dimensions_gte (const char *function, const char *file, const int line, const Coordinates &pos, unsigned int max_dim)
 Return an error if the passed coordinates have too many dimensions. More...
 
arm_compute::Status error_on_window_dimensions_gte (const char *function, const char *file, const int line, const Window &win, unsigned int max_dim)
 Return an error if the passed window has too many dimensions. More...
 
template<typename T , typename... Ts>
arm_compute::Status error_on_mismatching_dimensions (const char *function, const char *file, int line, const Dimensions< T > &dim1, const Dimensions< T > &dim2, Ts &&...dims)
 Return an error if the passed dimension objects differ. More...
 
bool has_format_horizontal_subsampling (Format format)
 Return true if the given format has horizontal subsampling. More...
 
bool has_format_vertical_subsampling (Format format)
 Return true if the given format has vertical subsampling. More...
 
TensorShape adjust_odd_shape (const TensorShape &shape, Format format)
 Adjust tensor shape size if width or height are odd for a given multi-planar format. More...
 
template<typename... Ts>
arm_compute::Status error_on_tensors_not_even (const char *function, const char *file, int line, const Format &format, const ITensor *tensor1, Ts... tensors)
 Return an error if the passed tensor objects are not even. More...
 
TensorShape calculate_subsampled_shape (const TensorShape &shape, Format format, Channel channel=Channel::UNKNOWN)
 Calculate subsampled shape for a given format and channel. More...
 
template<typename... Ts>
arm_compute::Status error_on_tensors_not_subsampled (const char *function, const char *file, int line, const Format &format, const TensorShape &shape, const ITensor *tensor1, Ts... tensors)
 Return an error if the passed tensor objects are not sub-sampled. More...
 
template<typename... Ts>
arm_compute::Status error_on_mismatching_shapes (const char *function, const char *file, const int line, const ITensorInfo *tensor_info_1, const ITensorInfo *tensor_info_2, Ts... tensor_infos)
 Return an error if the passed two tensor infos have different shapes from the given dimension. More...
 
template<typename... Ts>
arm_compute::Status error_on_mismatching_shapes (const char *function, const char *file, const int line, const ITensor *tensor_1, const ITensor *tensor_2, Ts... tensors)
 Return an error if the passed two tensors have different shapes from the given dimension. More...
 
template<typename... Ts>
arm_compute::Status error_on_mismatching_shapes (const char *function, const char *file, const int line, unsigned int upper_dim, const ITensorInfo *tensor_info_1, const ITensorInfo *tensor_info_2, Ts... tensor_infos)
 Return an error if the passed two tensors have different shapes from the given dimension. More...
 
template<typename... Ts>
arm_compute::Status error_on_mismatching_shapes (const char *function, const char *file, const int line, unsigned int upper_dim, const ITensor *tensor_1, const ITensor *tensor_2, Ts... tensors)
 Return an error if the passed two tensors have different shapes from the given dimension. More...
 
template<typename... Ts>
arm_compute::Status error_on_mismatching_data_layouts (const char *function, const char *file, const int line, const ITensorInfo *tensor_info, Ts... tensor_infos)
 Return an error if the passed tensor infos have different data layouts. More...
 
template<typename... Ts>
arm_compute::Status error_on_mismatching_data_layouts (const char *function, const char *file, const int line, const ITensor *tensor, Ts... tensors)
 Return an error if the passed tensors have different data layouts. More...
 
template<typename... Ts>
arm_compute::Status error_on_mismatching_data_types (const char *function, const char *file, const int line, const ITensorInfo *tensor_info, Ts... tensor_infos)
 Return an error if the passed two tensor infos have different data types. More...
 
template<typename... Ts>
arm_compute::Status error_on_mismatching_data_types (const char *function, const char *file, const int line, const ITensor *tensor, Ts... tensors)
 Return an error if the passed two tensors have different data types. More...
 
template<typename... Ts>
arm_compute::Status error_on_mismatching_quantization_info (const char *function, const char *file, const int line, const ITensorInfo *tensor_info_1, const ITensorInfo *tensor_info_2, Ts... tensor_infos)
 Return an error if the passed tensor infos have different asymmetric quantized data types or different quantization info. More...
 
template<typename... Ts>
arm_compute::Status error_on_mismatching_quantization_info (const char *function, const char *file, const int line, const ITensor *tensor_1, const ITensor *tensor_2, Ts... tensors)
 Return an error if the passed tensor have different asymmetric quantized data types or different quantization info. More...
 
template<typename T , typename F , typename... Fs>
void error_on_format_not_in (const char *function, const char *file, const int line, const T *object, F &&format, Fs &&...formats)
 Throw an error if the format of the passed tensor/multi-image does not match any of the formats provided. More...
 
template<typename T , typename... Ts>
arm_compute::Status error_on_data_type_not_in (const char *function, const char *file, const int line, const ITensorInfo *tensor_info, T &&dt, Ts &&...dts)
 Return an error if the data type of the passed tensor info does not match any of the data types provided. More...
 
template<typename T , typename... Ts>
arm_compute::Status error_on_data_type_not_in (const char *function, const char *file, const int line, const ITensor *tensor, T &&dt, Ts &&...dts)
 Return an error if the data type of the passed tensor does not match any of the data types provided. More...
 
template<typename T , typename... Ts>
arm_compute::Status error_on_data_layout_not_in (const char *function, const char *file, const int line, const ITensorInfo *tensor_info, T &&dl, Ts &&...dls)
 Return an error if the data layout of the passed tensor info does not match any of the data layouts provided. More...
 
template<typename T , typename... Ts>
arm_compute::Status error_on_data_layout_not_in (const char *function, const char *file, const int line, const ITensor *tensor, T &&dl, Ts &&...dls)
 Return an error if the data layout of the passed tensor does not match any of the data layout provided. More...
 
template<typename T , typename... Ts>
arm_compute::Status error_on_data_type_channel_not_in (const char *function, const char *file, const int line, const ITensorInfo *tensor_info, size_t num_channels, T &&dt, Ts &&...dts)
 Return an error if the data type or the number of channels of the passed tensor info does not match any of the data types and number of channels provided. More...
 
template<typename T , typename... Ts>
arm_compute::Status error_on_data_type_channel_not_in (const char *function, const char *file, const int line, const ITensor *tensor, size_t num_channels, T &&dt, Ts &&...dts)
 Return an error if the data type or the number of channels of the passed tensor does not match any of the data types and number of channels provided. More...
 
arm_compute::Status error_on_unsupported_fp16 (const char *function, const char *file, const int line, const ITensorInfo *tensor_info, bool is_fp16_supported)
 Return an error if the data type of the passed tensor info is FP16 and FP16 extension is not supported by the device. More...
 
arm_compute::Status error_on_unsupported_fp16 (const char *function, const char *file, const int line, const ITensor *tensor, bool is_fp16_supported)
 Return an error if the data type of the passed tensor is FP16 and FP16 extension is not supported by the device. More...
 
arm_compute::Status error_on_tensor_not_2d (const char *function, const char *file, const int line, const ITensor *tensor)
 Return an error if the tensor is not 2D. More...
 
arm_compute::Status error_on_tensor_not_2d (const char *function, const char *file, const int line, const ITensorInfo *tensor)
 Return an error if the tensor info is not 2D. More...
 
template<typename T , typename... Ts>
arm_compute::Status error_on_channel_not_in (const char *function, const char *file, const int line, T cn, T &&channel, Ts &&...channels)
 Return an error if the channel is not in channels. More...
 
arm_compute::Status error_on_channel_not_in_known_format (const char *function, const char *file, const int line, Format fmt, Channel cn)
 Return an error if the channel is not in format. More...
 
arm_compute::Status error_on_unconfigured_kernel (const char *function, const char *file, const int line, const IKernel *kernel)
 Return an error if the kernel is not configured. More...
 
arm_compute::Status error_on_invalid_subtensor (const char *function, const char *file, const int line, const TensorShape &parent_shape, const Coordinates &coords, const TensorShape &shape)
 Return an error if if the coordinates and shape of the subtensor are within the parent tensor. More...
 
arm_compute::Status error_on_invalid_subtensor_valid_region (const char *function, const char *file, const int line, const ValidRegion &parent_valid_region, const ValidRegion &valid_region)
 Return an error if the valid region of a subtensor is not inside the valid region of the parent tensor. More...
 
std::string build_information ()
 Returns the arm_compute library build information. More...
 
void swap (Window &lhs, Window &rhs)
 
bool operator== (const Window &lhs, const Window &rhs)
 
Coordinates convert_window_coord_to_position (const Window &w, const Coordinates &offset)
 Convert an offset in window steps into absolute coordinates. More...
 
template<typename L >
WindowIterator< L > create_window_iterator (const Window &w, const Coordinates &start, const Coordinates &end, L &&lambda_function)
 Create a WindowIterator object. More...
 
arm_compute::DataLayout data_layout_from_name (const std::string &name)
 Converts a string to a strong types enumeration DataLayout. More...
 
inline ::std::istream & operator>> (::std::istream &stream, arm_compute::DataLayout &data_layout)
 Input Stream operator for DataLayout. More...
 
std::tuple< cl::Context, cl::Device, cl_int > create_opencl_context_and_device (CLBackendType cl_backend_type)
 This function creates an OpenCL context and a device. More...
 
void schedule_kernel_on_ctx (CLRuntimeContext *ctx, ICLKernel *kernel, bool flush=true)
 Schedules a kernel using the context if not nullptr else uses the legacy scheduling flow. More...
 
cl::Platform select_preferable_platform (CLBackendType cl_backend_type)
 This function selects the OpenCL platform based on the backend type. More...
 
CLTunerMode tuner_mode_from_name (const std::string &name)
 Converts a string to a strong types enumeration CLTunerMode. More...
 
inline ::std::istream & operator>> (::std::istream &stream, CLTunerMode &tuner_mode)
 Input Stream operator for CLTunerMode. More...
 
void save_program_cache_to_file (const std::string &filename="cache.bin")
 This function saves opencl kernels library to a file. More...
 
void restore_program_cache_from_file (const std::string &filename="cache.bin")
 This function loads prebuilt opencl kernels from a file. More...
 
IContextget_internal (AclContext ctx)
 Extract internal representation of a Context. More...
 
IOperatorget_internal (AclOperator op)
 Extract internal representation of an Operator. More...
 
IQueueget_internal (AclQueue queue)
 Extract internal representation of a Queue. More...
 
ITensorV2get_internal (AclTensor tensor)
 Extract internal representation of a Tensor. More...
 
TensorPackget_internal (AclTensorPack pack)
 Extract internal representation of a TensoPack. More...
 
cl::Image2D create_image2d_from_tensor (const ICLTensor *tensor, CLImage2DType image_type)
 Create a cl::Image2D object from a tensor. More...
 
cl::Image2D create_image2d_from_buffer (const cl::Context &ctx, const cl::Buffer &buffer, const TensorShape &shape2d, DataType data_type, size_t image_row_pitch, CLImage2DType image_type)
 Create a cl::Image2D object from an OpenCL buffer. More...
 
void handle_cl_error (const std::string &function_name, cl_int error_code)
 Check for CL error code and throw exception accordingly. More...
 
arm_compute::Status error_on_unsupported_int64_base_atomics (const char *function, const char *file, const int line)
 Return an error if int64_base_atomics extension is not supported by the device. More...
 
cl::NDRange get_default_lws_for_type (CLKernelType kernel_type, cl::NDRange gws)
 
void enqueue (cl::CommandQueue &queue, ICLKernel &kernel, const Window &window, const cl::NDRange &lws_hint=CLKernelLibrary::get().default_ndrange(), bool use_dummy_work_items=false)
 Add the kernel to the command queue with the given window. More...
 
Status error_on_unsupported_cpu_fp16 (const char *function, const char *file, const int line, const ITensorInfo *tensor_info)
 Return an error if the data type of the passed tensor info is FP16 and FP16 support is not compiled in. More...
 
Status error_on_unsupported_cpu_bf16 (const char *function, const char *file, const int line, const ITensorInfo *tensor_info)
 Return an error if the data type of the passed tensor info is BFLOAT16 and BFLOAT16 support is not compiled in. More...
 
Status error_on_unsupported_cpu_fp16 (const char *function, const char *file, const int line, const ITensor *tensor)
 Return an error if the data type of the passed tensor is FP16 and FP16 support is not compiled in. More...
 
Status error_on_unsupported_cpu_bf16 (const char *function, const char *file, const int line, const ITensor *tensor)
 Return an error if the data type of the passed tensor is BFLOAT16 and BFLOAT16 support is not compiled in. More...
 
bool auto_init_if_empty (ITensorInfo &info, const TensorShape &shape, int num_channels, DataType data_type, QuantizationInfo quantization_info=QuantizationInfo())
 Auto initialize the tensor info (shape, number of channels and data type) if the current assignment is empty. More...
 
bool auto_init_if_empty (ITensorInfo &info_sink, const ITensorInfo &info_source)
 Auto initialize the tensor info using another tensor info. More...
 
bool set_shape_if_empty (ITensorInfo &info, const TensorShape &shape)
 Set the shape to the specified value if the current assignment is empty. More...
 
bool set_format_if_unknown (ITensorInfo &info, Format format)
 Set the format, data type and number of channels to the specified value if the current data type is unknown. More...
 
bool set_data_type_if_unknown (ITensorInfo &info, DataType data_type)
 Set the data type and number of channels to the specified value if the current data type is unknown. More...
 
bool set_data_layout_if_unknown (ITensorInfo &info, DataLayout data_layout)
 Set the data layout to the specified value if the current data layout is unknown. More...
 
bool set_quantization_info_if_empty (ITensorInfo &info, QuantizationInfo quantization_info)
 Set the quantization info to the specified value if the current quantization info is empty and the data type of asymmetric quantized type. More...
 
int offset_int_vec (int offset)
 
template<typename TensorType >
WorkspaceData< TensorTypemanage_workspace (const experimental::MemoryRequirements &mem_reqs, MemoryGroup &mgroup, ITensorPack &run_pack)
 
template<typename TensorType >
WorkspaceData< TensorTypemanage_workspace (const experimental::MemoryRequirements &mem_reqs, MemoryGroup &mgroup, ITensorPack &run_pack, ITensorPack &prep_pack)
 
template<typename TensorType >
void release_prepare_tensors (WorkspaceData< TensorType > &workspace, ITensorPack &prep_pack)
 
template<typename TensorType >
void release_temporaries (const experimental::MemoryRequirements &mem_reqs, WorkspaceData< TensorType > &workspace)
 Utility function to release tensors with lifetime marked as Prepare. More...
 
unsigned int get_normalization_dimension_index (DataLayout layout, const NormalizationLayerInfo &info)
 Calculate the normalization dimension index for a given normalization type. More...
 
bool has_holes (const ITensorInfo &info)
 Check if the tensor has any holes. More...
 
bool has_holes (const ITensorInfo &info, size_t dimension)
 Check if the tensor has any holes. More...
 
template<typename T , typename... Ts>
Strides compute_strides (const ITensorInfo &info, T stride_x, Ts &&...fixed_strides)
 Create a strides object based on the provided strides and the tensor dimensions. More...
 
template<typename... Ts>
Strides compute_strides (const ITensorInfo &info)
 Create a strides object based on the tensor dimensions. More...
 
unsigned int get_next_power_two (unsigned int x)
 Given an integer value, this function returns the next power of two. More...
 
Window calculate_max_window (const ValidRegion &valid_region, const Steps &steps, bool skip_border, BorderSize border_size)
 
Window calculate_max_window (const TensorShape &shape, const Steps &steps, bool skip_border, BorderSize border_size)
 
Window calculate_max_enlarged_window (const ValidRegion &valid_region, const Steps &steps, BorderSize border_size)
 
Window calculate_max_window_horizontal (const ValidRegion &valid_region, const Steps &steps, bool skip_border, BorderSize border_size)
 
std::pair< Window, size_t > calculate_squashed_or_max_window (const ITensorInfo &src0, const ITensorInfo &src1)
 
std::pair< Window, size_t > calculate_squashed_or_max_window (const ITensorInfo &src)
 
template<typename... Ts>
bool update_window_and_padding (Window &win, Ts &&...patterns)
 Update window and padding size for each of the access patterns. More...
 
template<typename... Ts>
ValidRegion intersect_valid_regions (const Ts &...regions)
 Intersect multiple valid regions. More...
 
void colorconvert_rgb_to_rgbx (const void *__restrict input, void *__restrict output, const Window &win)
 Convert RGB to RGBX. More...
 
void colorconvert_rgb_to_u8 (const void *__restrict input, void *__restrict output, const Window &win)
 Convert RGB to U8. More...
 
void colorconvert_rgbx_to_rgb (const void *input, void *output, const Window &win)
 Convert RGBX to RGB. More...
 
template<bool yuyv, bool alpha>
void colorconvert_yuyv_to_rgb (const void *__restrict input, void *__restrict output, const Window &win)
 Convert YUYV to RGB. More...
 
template<bool uv, bool alpha>
void colorconvert_nv12_to_rgb (const void *__restrict input, void *__restrict output, const Window &win)
 Convert NV12 to RGB. More...
 
template<bool alpha>
void colorconvert_iyuv_to_rgb (const void *__restrict input, void *__restrict output, const Window &win)
 Convert IYUV to RGB. More...
 
template<bool yuyv>
void colorconvert_yuyv_to_nv12 (const void *__restrict input, void *__restrict output, const Window &win)
 Convert YUYV to NV12. More...
 
void colorconvert_iyuv_to_nv12 (const void *__restrict input, void *__restrict output, const Window &win)
 Convert IYUV to NV12. More...
 
template<bool uv>
void colorconvert_nv12_to_iyuv (const void *__restrict input, void *__restrict output, const Window &win)
 Convert NV12 to IYUV. More...
 
template<bool yuyv>
void colorconvert_yuyv_to_iyuv (const void *__restrict input, void *__restrict output, const Window &win)
 Convert YUYV to IYUV. More...
 
template<bool uv>
void colorconvert_nv12_to_yuv4 (const void *__restrict input, void *__restrict output, const Window &win)
 Convert NV12 to YUV4. More...
 
void colorconvert_iyuv_to_yuv4 (const void *__restrict input, void *__restrict output, const Window &win)
 Convert IYUV to YUV4. More...
 
template<bool alpha>
void colorconvert_rgb_to_nv12 (const void *__restrict input, void *__restrict output, const Window &win)
 Convert RGB to NV12. More...
 
template<bool alpha>
void colorconvert_rgb_to_iyuv (const void *__restrict input, void *__restrict output, const Window &win)
 Convert RGB to IYUV. More...
 
template<bool alpha>
void colorconvert_rgb_to_yuv4 (const void *__restrict input, void *__restrict output, const Window &win)
 Convert RGB to YUV4. More...
 
template<typename T >
void run_reverse (const Window &window, const ITensor *input, const ITensor *axis, ITensor *output, bool use_inverted_axis)
 
template<RoundingPolicy round_policy = RoundingPolicy::TO_ZERO>
qasymm8x16_t vmlaq_qasymm8 (qasymm8x16_t vd, float32x4_t vs, float32x4_t vo)
 Perform a multiply-accumulate on all 16 components of a QASYMM8 vector. More...
 
template<RoundingPolicy round_policy = RoundingPolicy::TO_ZERO>
qasymm8x16_signed_t vmlaq_qasymm8_signed (qasymm8x16_signed_t vd, float32x4_t vs, float32x4_t vo)
 Perform a multiply-accumulate on all 16 components of a QASYMM8_SIGNED vector. More...
 
uint8x16_t finalize_quantization (int32x4x4_t &in_s32, int result_fixedpoint_multiplier, int32_t result_shift, int32x4_t result_offset_after_shift_s32, uint8x16_t min_u8, uint8x16_t max_u8, bool is_bounded_relu)
 Performs final quantization step on 16 elements. More...
 
int8x16_t finalize_quantization (int32x4x4_t &in_s32, int result_fixedpoint_multiplier, int32_t result_shift, int32x4_t result_offset_after_shift_s32, int8x16_t min_s8, int8x16_t max_s8, bool is_bounded_relu)
 Performs final quantization step on 16 elements. More...
 
int8x16_t finalize_quantization_symm (int32x4x4_t &in_s32, const int32x4x4_t &result_fixedpoint_multiplier, const int32x4x4_t &result_shift, const int32x4_t &result_offset_after_shift_s32, const int8x16_t &min_s8, const int8x16_t &max_s8, const bool is_bounded_relu)
 Performs final quantization step on 16 elements for symmetric quantization. More...
 
uint8_t finalize_quantization (int32_t in_value, int result_fixedpoint_multiplier, int32_t result_shift, int32_t result_offset_after_shift_s32, uint8_t min_u8, uint8_t max_u8, bool is_bounded_relu)
 Performs final quantization step on single element. More...
 
int8_t finalize_quantization (int32_t in_value, int result_fixedpoint_multiplier, int32_t result_shift, int32_t result_offset_after_shift_s32, int8_t min_s8, int8_t max_s8, bool is_bounded_relu)
 Performs final quantization step on single element. More...
 
float32x4x2_t vdequantize (const uint8x8_t &qv, const UniformQuantizationInfo &qi)
 Dequantize a neon vector holding 8 quantized values. More...
 
float32x4x2_t vdequantize (const int8x8_t &qv, const UniformQuantizationInfo &qi)
 Dequantize a neon vector holding 8 singed quantized values. More...
 
float32x4x4_t vdequantize (const uint8x16_t &qv, const UniformQuantizationInfo &qi)
 Dequantize a neon vector holding 16 quantized values. More...
 
float32x4x4_t vdequantize (const int8x16_t &qv, const UniformQuantizationInfo &qi)
 Dequantize a neon vector holding 16 signed quantized values. More...
 
float32x4x4_t vdequantize (const uint8x16_t &qv, float scale, int32_t offset)
 Dequantize following an asymmetric quantization scheme a neon vector holding 16 quantized values. More...
 
float32x4x4_t vdequantize (const int8x16_t &qv, float scale, int32_t offset)
 Dequantize a vector of 16 values stored as signed asymmetric. More...
 
float32x4x4_t vdequantize (const int8x16_t &qv, const float32x4x4_t vscale)
 Dequantize following symmetric quantization scheme a neon vector holding 16 quantized values. More...
 
float32x4x4_t vdequantize (const int8x16_t &qv, float scale)
 Dequantize following a symmetric quantization scheme a neon vector holding 16 quantized values. More...
 
uint8x8_t vquantize (const float32x4x2_t &qv, const UniformQuantizationInfo &qi)
 Quantize a neon vector holding 8 floating point values. More...
 
int8x8_t vquantize_signed (const float32x4x2_t &qv, const UniformQuantizationInfo &qi)
 Quantize a neon vector holding 8 floating point values. More...
 
int32x4x4_t vquantize_internal (const float32x4x4_t &qv, float scale, int32_t offset)
 
uint8x16_t vquantize (const float32x4x4_t &qv, const UniformQuantizationInfo &qi)
 Quantize a neon vector holding 16 floating point values. More...
 
int8x16_t vquantize_signed (const float32x4x4_t &qv, const UniformQuantizationInfo &qi)
 Signed quantize a neon vector holding 16 floating point values. More...
 
uint16x8x2_t vquantize_qasymm16 (const float32x4x4_t &qv, const UniformQuantizationInfo &qi)
 Quantize to QASYMM16 a neon vector holding 16 floating point values. More...
 
float32x4x2_t vmax2q_f32 (float32x4x2_t a, float32x4x2_t b)
 Compute lane-by-lane maximum between elements of a float vector with 4x2 elements. More...
 
float32x4_t vfloorq_f32 (float32x4_t val)
 Calculate floor of a vector. More...
 
float32x4_t vroundq_rte_f32 (float32x4_t val)
 Calculate round value of a vector to nearest with ties to even. More...
 
float32x2_t vinvsqrt_f32 (float32x2_t x)
 Calculate inverse square root. More...
 
float32x4_t vinvsqrtq_f32 (float32x4_t x)
 Calculate inverse square root. More...
 
float32x2_t vinv_f32 (float32x2_t x)
 Calculate reciprocal. More...
 
float32x4_t vinvq_f32 (float32x4_t x)
 Calculate reciprocal. More...
 
float32x4_t vtaylor_polyq_f32 (float32x4_t x, const std::array< float32x4_t, 8 > &coeffs)
 Perform a 7th degree polynomial approximation using Estrin's method. More...
 
float32x4_t vexpq_f32 (float32x4_t x)
 Calculate exponential. More...
 
float32x4_t verfq_f32 (float32x4_t x)
 Calculate error function. More...
 
float32x4_t vlogq_f32 (float32x4_t x)
 Calculate logarithm. More...
 
float32x4_t vtanhq_f32 (float32x4_t val)
 Calculate hyperbolic tangent. More...
 
float32x4_t vpowq_f32 (float32x4_t val, float32x4_t n)
 Calculate n power of a number. More...
 
int32x4_t rounding_divide_by_pow2 (int32x4_t x, int32x4_t exponent)
 Round to the nearest division by a power-of-two using exponent. More...
 
int32x4_t rounding_divide_by_pow2 (int32x4_t x, int exponent)
 Round to the nearest division by a power-of-two using exponent. More...
 
int32_t rounding_divide_by_pow2 (int32_t x, int exponent)
 Round to the nearest division by a power-of-two using exponent. More...
 
float32x4x4_t convert_uint8x16_to_float32x4x4 (const uint8x16_t &in)
 Converts from uint8x16 to float32x4x4_t. More...
 
float32x4x4_t convert_int8x16_to_float32x4x4 (const int8x16_t &in)
 Converts from int8x16 to float32x4x4_t. More...
 
template<typename T >
float32x4x4_t convert_to_float32x4x4 (const T &in)
 Converts to float32x4x4_t from the specified templated 16 elements vectors. More...
 
void convert_float32x4x3_to_uint8x8x3 (const float32x4x3_t &in1, const float32x4x3_t &in2, uint8x8x3_t &out)
 Converts from two float32x4x3_t to just one uint8x8x3_t. More...
 
void convert_float32x4x4_to_uint8x16 (const float32x4x4_t &in, uint8x16_t &out)
 Converts from two float32x4x4_t to just one uint8x16_t. More...
 
void convert_float32x4x4_to_int8x16 (const float32x4x4_t &in, int8x16_t &out)
 Converts from float32x4x4_t to just one int8x16_t. More...
 
template<typename float_vec_type , typename int_vec_type >
int_vec_type convert_float_to_int (const float_vec_type &in)
 Converts from float vector to integer vector. More...
 
template<typename float_vec_type , typename int_vec_type >
float_vec_type convert_int_to_float (const int_vec_type &in)
 Converts from integer vector to float vector. More...
 
float32x4_t vsinq_f32 (float32x4_t val)
 Calculate sine. More...
 
float32x2_t vsin_f32 (float32x2_t val)
 Calculate sine. More...
 
float vreduce (const float32x4_t &v)
 Reduce a vector to be a scalar by accumulating all lanes in the vector. More...
 
template<>
float32x4x4_t convert_to_float32x4x4 (const uint8x16_t &in)
 
template<>
float32x4x4_t convert_to_float32x4x4 (const int8x16_t &in)
 
template<>
uint8x16_t convert_float_to_int< float32x4x4_t, uint8x16_t > (const float32x4x4_t &in)
 
template<>
float32x4x4_t convert_int_to_float< float32x4x4_t, uint8x16_t > (const uint8x16_t &in)
 
template<>
int8x16_t convert_float_to_int< float32x4x4_t, int8x16_t > (const float32x4x4_t &in)
 
template<>
float32x4x4_t convert_int_to_float< float32x4x4_t, int8x16_t > (const int8x16_t &in)
 
template<bool is_bounded_relu>
int16x8_t finalize_quantization_int16 (int32x4x2_t &in_s32, int result_fixedpoint_multiplier, int32_t result_shift, int16x8_t min_s16, int16x8_t max_s16)
 Performs final quantization step on 8 signed 16-bit elements. More...
 
template<bool is_bounded_relu>
int16_t finalize_quantization_int16 (int32_t in_value, int result_fixedpoint_multiplier, int32_t result_shift, int16_t min_s16, int16_t max_s16)
 Performs final quantization step on single signed 16-bit element. More...
 
float32x4x2_t vdequantize_int16 (const int16x8_t &qv, float scale)
 Dequantize a neon vector holding 8 16-bit quantized values. More...
 
int16x8_t vquantize_int16 (const float32x4x2_t &qv, float scale)
 Quantize a neon vector holding 8 floating point values. More...
 
float32x4x4_t vdequantize (const int16x8x2_t &qv, const UniformQuantizationInfo &qi)
 Dequantize a neon vector holding 16 16-bit quantized values. More...
 
qsymm16x8x2_t vquantize_qsymm16 (const float32x4x4_t &qv, const UniformQuantizationInfo &qi)
 Quantize a neon vector holding 16 floating point values. More...
 
int32x4x2_t multiply_by_quantized_multiplier_2row (int32x4x2_t input, int32_t qmul, int32_t shift)
 Multiply a neon vector using quantized multiplier and shift. More...
 
template<typename T , unsigned int S, unsigned int dim, bool do_2D_norm>
void normalize_float (const Window &window, const ITensor *in, const ITensor *in_squared, ITensor *out, NormalizationLayerInfo ninfo)
 Function to perform normalization depending on the given template dimension. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const ClComponentElementwiseBinary::Attributes::ElementwiseOp &op)
 Formatted output of the pute::experimental::dynamic_fusion::ClComponentElementwiseBinary::Attributes::ElementwiseOp type. More...
 
std::string to_string (const ClComponentElementwiseBinary::Attributes::ElementwiseOp &op)
 Formatted output of the arm_compute::experimental::dynamic_fusion::ClComponentElementwiseBinary::Attributes::ElementwiseOp type. More...
 
Status validate (const ITensorInfo *scores_in, const ITensorInfo *boxes_in, const ITensorInfo *batch_splits_in, const ITensorInfo *scores_out, const ITensorInfo *boxes_out, const ITensorInfo *classes, const ITensorInfo *batch_splits_out, const ITensorInfo *keeps, const ITensorInfo *keeps_size, const BoxNMSLimitInfo info)
 
inline ::std::istream & operator>> (::std::istream &is, BorderMode &mode)
 Formatted input of the BorderMode type. More...
 
template<typename T >
std::string to_string_if_not_null (T *arg)
 Formatted output if arg is not null. More...
 
template<typename T >
std::string to_string (const T &val)
 Fallback method: try to use std::to_string: More...
 
template<typename T >
::std::ostream & operator<< (::std::ostream &os, const std::vector< T > &args)
 Formatted output of a vector of objects. More...
 
template<typename T >
std::string to_string (const std::vector< T > &args)
 Formatted output of a vector of objects. More...
 
template<typename T >
inline ::std::ostream & operator<< (::std::ostream &os, const Dimensions< T > &dimensions)
 Formatted output of the Dimensions type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const RoundingPolicy &rounding_policy)
 Formatted output of the RoundingPolicy type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const WeightsInfo &weights_info)
 Formatted output of the WeightsInfo type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const ROIPoolingLayerInfo &pool_info)
 Formatted output of the ROIPoolingInfo type. More...
 
std::string to_string (const ROIPoolingLayerInfo &pool_info)
 Formatted output of the ROIPoolingInfo type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const GEMMKernelInfo &gemm_info)
 Formatted output of the GEMMKernelInfo type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const GEMMLHSMatrixInfo &gemm_info)
 Formatted output of the GEMMLHSMatrixInfo type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const GEMMRHSMatrixInfo &gemm_info)
 Formatted output of the GEMMRHSMatrixInfo type. More...
 
std::string to_string (const GEMMRHSMatrixInfo &gemm_info)
 Formatted output of the GEMMRHSMatrixInfo type. More...
 
std::string to_string (const GEMMLHSMatrixInfo &gemm_info)
 Formatted output of the GEMMLHSMatrixInfo type. More...
 
std::string to_string (const GEMMKernelInfo &gemm_info)
 Formatted output of the GEMMKernelInfo type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const BoundingBoxTransformInfo &bbox_info)
 Formatted output of the BoundingBoxTransformInfo type. More...
 
std::string to_string (const BoundingBoxTransformInfo &bbox_info)
 Formatted output of the BoundingBoxTransformInfo type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const ComputeAnchorsInfo &anchors_info)
 Formatted output of the ComputeAnchorsInfo type. More...
 
std::string to_string (const ComputeAnchorsInfo &anchors_info)
 Formatted output of the ComputeAnchorsInfo type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const GenerateProposalsInfo &proposals_info)
 Formatted output of the GenerateProposalsInfo type. More...
 
std::string to_string (const GenerateProposalsInfo &proposals_info)
 Formatted output of the GenerateProposalsInfo type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const QuantizationInfo &qinfo)
 Formatted output of the QuantizationInfo type. More...
 
std::string to_string (const QuantizationInfo &quantization_info)
 Formatted output of the QuantizationInfo type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const ActivationLayerInfo::ActivationFunction &act_function)
 Formatted output of the activation function type. More...
 
std::string to_string (const arm_compute::ActivationLayerInfo &info)
 Formatted output of the activation function info type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const ActivationLayerInfo *info)
 Formatted output of the activation function info. More...
 
std::string to_string (const arm_compute::ActivationLayerInfo::ActivationFunction &function)
 Formatted output of the activation function type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const NormType &norm_type)
 Formatted output of the NormType type. More...
 
std::string to_string (const arm_compute::NormalizationLayerInfo &info)
 Formatted output of NormalizationLayerInfo. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const NormalizationLayerInfo &info)
 Formatted output of NormalizationLayerInfo. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const PoolingType &pool_type)
 Formatted output of the PoolingType type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const PoolingLayerInfo &info)
 Formatted output of PoolingLayerInfo. More...
 
std::string to_string (const RoundingPolicy &rounding_policy)
 Formatted output of RoundingPolicy. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const DataLayout &data_layout)
 [Print DataLayout type] More...
 
std::string to_string (const arm_compute::DataLayout &data_layout)
 Formatted output of the DataLayout type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const DataLayoutDimension &data_layout_dim)
 [Print DataLayout type] More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const DataType &data_type)
 Formatted output of the DataType type. More...
 
std::string to_string (const arm_compute::DataType &data_type)
 Formatted output of the DataType type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const Format &format)
 Formatted output of the Format type. More...
 
std::string to_string (const Format &format)
 Formatted output of the Format type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const Channel &channel)
 Formatted output of the Channel type. More...
 
std::string to_string (const Channel &channel)
 Formatted output of the Channel type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const BorderMode &mode)
 Formatted output of the BorderMode type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const BorderSize &border)
 Formatted output of the BorderSize type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const PaddingList &padding)
 Formatted output of the PaddingList type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const Multiples &multiples)
 Formatted output of the Multiples type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const InterpolationPolicy &policy)
 Formatted output of the InterpolationPolicy type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const SamplingPolicy &policy)
 Formatted output of the SamplingPolicy type. More...
 
inline ::std::ostream & operator<< (std::ostream &os, const ITensorInfo *info)
 Formatted output of the ITensorInfo type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const TensorInfo &info)
 Formatted output of the const TensorInfo& type. More...
 
std::string to_string (const TensorInfo &info)
 Formatted output of the const TensorInfo& type. More...
 
std::string to_string (const ITensorInfo &info)
 Formatted output of the const ITensorInfo& type. More...
 
std::string to_string (const ITensorInfo *info)
 Formatted output of the const ITensorInfo* type. More...
 
std::string to_string (ITensorInfo *info)
 Formatted output of the ITensorInfo* type. More...
 
std::string to_string (const ITensor *tensor)
 Formatted output of the ITensorInfo type obtained from const ITensor* type. More...
 
std::string to_string (ITensor *tensor)
 Formatted output of the ITensorInfo type obtained from the ITensor* type. More...
 
std::string to_string (ITensor &tensor)
 Formatted output of the ITensorInfo type obtained from the ITensor& type. More...
 
template<typename T >
std::string to_string (const Dimensions< T > &dimensions)
 Formatted output of the Dimensions type. More...
 
std::string to_string (const Strides &stride)
 Formatted output of the Strides type. More...
 
std::string to_string (const TensorShape &shape)
 Formatted output of the TensorShape type. More...
 
std::string to_string (const Coordinates &coord)
 Formatted output of the Coordinates type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const GEMMReshapeInfo &info)
 Formatted output of the GEMMReshapeInfo type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const GEMMInfo &info)
 Formatted output of the GEMMInfo type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const Window::Dimension &dim)
 Formatted output of the Window::Dimension type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const Window &win)
 Formatted output of the Window type. More...
 
std::string to_string (const WeightsInfo &info)
 Formatted output of the WeightsInfo type. More...
 
std::string to_string (const GEMMReshapeInfo &info)
 Formatted output of the GEMMReshapeInfo type. More...
 
std::string to_string (const GEMMInfo &info)
 Formatted output of the GEMMInfo type. More...
 
std::string to_string (const Window::Dimension &dim)
 Formatted output of the Window::Dimension type. More...
 
std::string to_string (const Window &win)
 Formatted output of the Window& type. More...
 
std::string to_string (Window *win)
 Formatted output of the Window* type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const Rectangle &rect)
 Formatted output of the Rectangle type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const PaddingMode &mode)
 Formatted output of the PaddingMode type. More...
 
std::string to_string (const PaddingMode &mode)
 Formatted output of the PaddingMode type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const PadStrideInfo &pad_stride_info)
 Formatted output of the PadStrideInfo type. More...
 
std::string to_string (const PadStrideInfo &pad_stride_info)
 Formatted output of the PadStrideInfo type. More...
 
std::string to_string (const BorderMode &mode)
 Formatted output of the BorderMode type. More...
 
std::string to_string (const BorderSize &border)
 Formatted output of the BorderSize type. More...
 
std::string to_string (const PaddingList &padding)
 Formatted output of the PaddingList type. More...
 
std::string to_string (const Multiples &multiples)
 Formatted output of the Multiples type. More...
 
std::string to_string (const InterpolationPolicy &policy)
 Formatted output of the InterpolationPolicy type. More...
 
std::string to_string (const SamplingPolicy &policy)
 Formatted output of the SamplingPolicy type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const ConvertPolicy &policy)
 Formatted output of the ConvertPolicy type. More...
 
std::string to_string (const ConvertPolicy &policy)
 
inline ::std::ostream & operator<< (::std::ostream &os, const ArithmeticOperation &op)
 Formatted output of the ArithmeticOperation type. More...
 
std::string to_string (const ArithmeticOperation &op)
 Formatted output of the Arithmetic Operation. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const ReductionOperation &op)
 Formatted output of the Reduction Operations. More...
 
std::string to_string (const ReductionOperation &op)
 Formatted output of the Reduction Operations. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const ComparisonOperation &op)
 Formatted output of the Comparison Operations. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const ElementWiseUnary &op)
 Formatted output of the Elementwise unary Operations. More...
 
std::string to_string (const ComparisonOperation &op)
 Formatted output of the Comparison Operations. More...
 
std::string to_string (const ElementWiseUnary &op)
 Formatted output of the Elementwise unary Operations. More...
 
std::string to_string (const NormType &type)
 Formatted output of the Norm Type. More...
 
std::string to_string (const PoolingType &type)
 Formatted output of the Pooling Type. More...
 
std::string to_string (const PoolingLayerInfo &info)
 Formatted output of the Pooling Layer Info. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const Size3D &size)
 Formatted output of the Size3D type. More...
 
std::string to_string (const Size3D &type)
 Formatted output of the Size3D type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const Padding3D &padding3d)
 Formatted output of the Padding3D type. More...
 
std::string to_string (const Padding3D &padding3d)
 Converts a Padding3D to string. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const DimensionRoundingType &rounding_type)
 Formatted output of the DimensionRoundingType type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const Pooling3dLayerInfo &info)
 Formatted output of the Pooling 3d Layer Info. More...
 
std::string to_string (const Pooling3dLayerInfo &info)
 Formatted output of the Pooling 3d Layer Info. More...
 
std::string to_string (const PriorBoxLayerInfo &info)
 Formatted output of the PriorBoxLayerInfo. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const Size2D &size)
 Formatted output of the Size2D type. More...
 
std::string to_string (const Size2D &type)
 Formatted output of the Size2D type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const ConvolutionMethod &conv_method)
 Formatted output of the ConvolutionMethod type. More...
 
std::string to_string (const ConvolutionMethod &conv_method)
 Formatted output of the ConvolutionMethod type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const GPUTarget &gpu_target)
 Formatted output of the GPUTarget type. More...
 
std::string to_string (const GPUTarget &gpu_target)
 Formatted output of the GPUTarget type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const DetectionWindow &detection_window)
 Formatted output of the DetectionWindow type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const DetectionOutputLayerCodeType &detection_code)
 Formatted output of the DetectionOutputLayerCodeType type. More...
 
std::string to_string (const DetectionOutputLayerCodeType &detection_code)
 Formatted output of the DetectionOutputLayerCodeType type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const DetectionOutputLayerInfo &detection_info)
 Formatted output of the DetectionOutputLayerInfo type. More...
 
std::string to_string (const DetectionOutputLayerInfo &detection_info)
 Formatted output of the DetectionOutputLayerInfo type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const DetectionPostProcessLayerInfo &detection_info)
 Formatted output of the DetectionPostProcessLayerInfo type. More...
 
std::string to_string (const DetectionPostProcessLayerInfo &detection_info)
 Formatted output of the DetectionPostProcessLayerInfo type. More...
 
std::string to_string (const DetectionWindow &detection_window)
 Formatted output of the DetectionWindow type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const PriorBoxLayerInfo &info)
 Formatted output of PriorBoxLayerInfo. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const WinogradInfo &info)
 Formatted output of the WinogradInfo type. More...
 
std::string to_string (const WinogradInfo &type)
 
std::string to_string (const CLTunerMode val)
 Convert a CLTunerMode value to a string. More...
 
std::string to_string (CLGEMMKernelType val)
 Converts a CLGEMMKernelType to string. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const CLTunerMode &val)
 [Print CLTunerMode type] More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const ConvolutionInfo &conv_info)
 Formatted output of the ConvolutionInfo type. More...
 
std::string to_string (const ConvolutionInfo &info)
 Converts a ConvolutionInfo to string. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const FullyConnectedLayerInfo &layer_info)
 Formatted output of the FullyConnectedLayerInfo type. More...
 
std::string to_string (const FullyConnectedLayerInfo &info)
 Converts a FullyConnectedLayerInfo to string. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const GEMMLowpOutputStageType &gemm_type)
 Formatted output of the GEMMLowpOutputStageType type. More...
 
std::string to_string (const GEMMLowpOutputStageType &gemm_type)
 Converts a GEMMLowpOutputStageType to string. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const GEMMLowpOutputStageInfo &gemm_info)
 Formatted output of the GEMMLowpOutputStageInfo type. More...
 
std::string to_string (const GEMMLowpOutputStageInfo &gemm_info)
 Converts a GEMMLowpOutputStageInfo to string. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const Conv2dInfo &conv_info)
 Formatted output of the Conv2dInfo type. More...
 
std::string to_string (const Conv2dInfo &conv_info)
 Converts a Conv2dInfo to string. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const PixelValue &pixel_value)
 Formatted output of the PixelValue type. More...
 
std::string to_string (const PixelValue &pixel_value)
 Converts a PixelValue to string. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const ScaleKernelInfo &scale_info)
 Formatted output of the ScaleKernelInfo type. More...
 
std::string to_string (const ScaleKernelInfo &scale_info)
 Converts a ScaleKernelInfo to string. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const FFTDirection &fft_dir)
 Formatted output of the FFTDirection type. More...
 
std::string to_string (const FFTDirection &fft_dir)
 Converts a FFT1DInfo to string. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const FFT1DInfo &fft1d_info)
 Formatted output of the FFT1DInfo type. More...
 
std::string to_string (const FFT1DInfo &fft1d_info)
 Converts a FFT1DInfo to string. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const FFT2DInfo &fft2d_info)
 Formatted output of the FFT2DInfo type. More...
 
std::string to_string (const FFT2DInfo &fft2d_info)
 Converts a FFT2DInfo to string. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const Coordinates2D &coord_2d)
 Formatted output of the Coordinates2D type. More...
 
std::string to_string (const Coordinates2D &coord_2d)
 Converts a Coordinates2D to string. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const FuseBatchNormalizationType &fuse_type)
 Formatted output of the FuseBatchNormalizationType type. More...
 
std::string to_string (const FuseBatchNormalizationType &fuse_type)
 Converts a FuseBatchNormalizationType to string. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const SoftmaxKernelInfo &info)
 Formatted output of the SoftmaxKernelInfo type. More...
 
std::string to_string (const SoftmaxKernelInfo &info)
 Converts a SoftmaxKernelInfo to string. More...
 
template<typename T >
::std::ostream & operator<< (::std::ostream &os, const LSTMParams< T > &lstm_params)
 Formatted output of the ScaleKernelInfo type. More...
 
template<typename T >
std::string to_string (const LSTMParams< T > &lstm_params)
 Converts a LSTMParams to string. More...
 
std::string to_string (const uint8_t num)
 Converts a LSTMParams to string. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const NMSType &nms_type)
 Available non maxima suppression types. More...
 
std::string to_string (const NMSType nms_type)
 Converts a NMSType to string. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const BoxNMSLimitInfo &info)
 Formatted output of the BoxNMSLimitInfo type. More...
 
std::string to_string (const BoxNMSLimitInfo &info)
 Converts a BoxNMSLimitInfo to string. More...
 
std::string to_string (const DimensionRoundingType &rounding_type)
 Converts a DimensionRoundingType to string. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const Conv3dInfo &conv3d_info)
 Formatted output of the Conv3dInfo type. More...
 
std::string to_string (const Conv3dInfo &conv3d_info)
 Formatted output of the Conv3dInfo type. More...
 
std::string to_string (const WeightFormat wf)
 Formatted output of the arm_compute::WeightFormat type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const arm_compute::WeightFormat &wf)
 Formatted output of the arm_compute::WeightFormat type. More...
 
std::string to_string (const std::tuple< TensorShape, TensorShape, arm_compute::WeightFormat > values)
 Formatted output of the std::tuple<TensorShape, TensorShape, arm_compute::WeightFormat> tuple. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const Padding2D &padding2d)
 Formatted output of the Padding2D type. More...
 
std::string to_string (const Padding2D &padding2d)
 Converts a Padding2D to string. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const experimental::dynamic_fusion::Pool2dAttributes &pool2d_attr)
 Formatted output of the arm_compute::experimental::dynamic_fusion::Pool2dAttributes type. More...
 
std::string to_string (const experimental::dynamic_fusion::Pool2dAttributes &pool2d_attr)
 Formatted output of the arm_compute::experimental::dynamic_fusion::Pool2dAttributes type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const experimental::dynamic_fusion::GpuPool2dSettings &settings)
 Formatted output of the arm_compute::experimental::dynamic_fusion::GpuPool2dSettings type. More...
 
std::string to_string (const experimental::dynamic_fusion::GpuPool2dSettings &settings)
 Formatted output of the arm_compute::experimental::dynamic_fusion::GpuPool2dSettings type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const experimental::dynamic_fusion::Conv2dAttributes &conv2d_attr)
 Formatted output of the arm_compute::experimental::dynamic_fusion::Conv2dAttributes type. More...
 
std::string to_string (const experimental::dynamic_fusion::Conv2dAttributes &conv2d_attr)
 Formatted output of the arm_compute::experimental::dynamic_fusion::Conv2dAttributes type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const experimental::dynamic_fusion::CastAttributes &cast_attr)
 Formatted output of the arm_compute::experimental::dynamic_fusion::CastAttributes type. More...
 
std::string to_string (const experimental::dynamic_fusion::CastAttributes &cast_attr)
 Formatted output of the arm_compute::experimental::dynamic_fusion::CastAttributes type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const experimental::dynamic_fusion::DepthwiseConv2dAttributes &dw_conv2d_attr)
 Formatted output of the arm_compute::experimental::dynamic_fusion::DepthwiseConv2dAttributes type. More...
 
std::string to_string (const experimental::dynamic_fusion::DepthwiseConv2dAttributes &dw_conv2d_attr)
 Formatted output of the arm_compute::experimental::dynamic_fusion::DepthwiseConv2dAttributes type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const experimental::dynamic_fusion::ClampAttributes &clamp_attr)
 Formatted output of the arm_compute::experimental::dynamic_fusion::ClampAttributes type. More...
 
std::string to_string (const experimental::dynamic_fusion::ClampAttributes &clamp_attr)
 Formatted output of the arm_compute::experimental::dynamic_fusion::ClampAttributes type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const experimental::dynamic_fusion::ResizeAttributes &resize_attr)
 Formatted output of the arm_compute::experimental::dynamic_fusion::ResizeAttributes type. More...
 
std::string to_string (const experimental::dynamic_fusion::ResizeAttributes &resize_attr)
 Formatted output of the arm_compute::experimental::dynamic_fusion::ResizeAttributes type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const experimental::dynamic_fusion::SoftmaxAttributes &softmax_attr)
 Formatted output of the arm_compute::experimental::dynamic_fusion::SoftmaxAttributes type. More...
 
std::string to_string (const experimental::dynamic_fusion::SoftmaxAttributes &softmax_attr)
 Formatted output of the arm_compute::experimental::dynamic_fusion::SoftmaxAttributes type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const arm_compute::MatMulInfo &matmul_info)
 Formatted output of the arm_compute::MatMulInfo type. More...
 
std::string to_string (const arm_compute::MatMulInfo &matmul_info)
 Formatted output of the arm_compute::MatMulInfo type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const arm_compute::MatMulKernelInfo &matmul_info)
 Formatted output of the arm_compute::MatMulKernelInfo type. More...
 
std::string to_string (const arm_compute::MatMulKernelInfo &matmul_info)
 Formatted output of the arm_compute::MatMulKernelInfo type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const arm_compute::CpuMatMulSettings &settings)
 Formatted output of the arm_compute::CpuMatMulSettings type. More...
 
std::string to_string (const arm_compute::CpuMatMulSettings &settings)
 Formatted output of the arm_compute::CpuMatMulSettings type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const ScatterFunction &function)
 Formatted output of the scatter function type. More...
 
std::string to_string (const arm_compute::ScatterFunction &func)
 Formatted output of the arm_compute::ScatterFunction type. More...
 
inline ::std::ostream & operator<< (::std::ostream &os, const arm_compute::ScatterInfo &info)
 Formatted output of the arm_compute::ScatterInfo type. More...
 
std::string to_string (const arm_compute::ScatterInfo &info)
 Formatted output of the arm_compute::ScatterInfo type. More...
 

Variables

constexpr size_t MAX_DIMS = 6
 Constant value used to indicate maximum dimensions of a Window, TensorShape and Coordinates. More...
 
const std::array< float32x4_t, 8 > log_tab
 Logarithm polynomial coefficients. More...
 
constexpr float te_sin_coeff2 = 0.166666666666f
 Sin polynomial coefficients. More...
 
constexpr float te_sin_coeff3 = 0.05f
 
constexpr float te_sin_coeff4 = 0.023809523810f
 
constexpr float te_sin_coeff5 = 0.013888888889f
 
const std::array< ErfLutEntry< float >, 513 > erf_f32_lut
 The lookup table for FP32 erf(x) calculation. More...
 

Detailed Description

Copyright (c) 2017-2024 Arm Limited.

Synced with tests/validation/dynamic_fusion/gpu/cl/DirectConv2d.cpp Please check there for any differences in the coverage.

A DotMLGO file parser (LL(k) parser)

[CLReshapeLayer snippet]

[ClReshapeKernel Kernel]

[NEReshapeLayerKernel Kernel]

This file contains all available output stages for GEMMLowp.

This file contains all available output stages for GEMMLowp on OpenCL.

The following symbols have been moved to: half PermutationVector Format DataType DataLayout DataLayoutDimension PadStrideInfo WeightFormat Channel DimensionRoundingType.

CoreTypes.h groups together essential small types that are used across functions.

Copyright (c) 2017-2021, 2024 Arm Limited.

Copyright (c) 2018-2022 Arm Limited.

Copyright (c) 2019-2023 Arm Limited.

Copyright (c) 2017-2021 Arm Limited.

Copyright (c) 2021-2024 Arm Limited.

Copyright (c) 2023 Arm Limited.

Copyright (c) 2021-2022 Arm Limited.

Copyright (c) 2021 Arm Limited.

Copyright (c) 2017-2021, 2023-2024 Arm Limited.

SPDX-License-Identifier: MIT

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

The following symbols have been moved to: ActivationFunction ActivationLayerInfo The following symbols have been moved to: ConvolutionInfo The following symbols have been moved to: FullyConnectedLayerInfo The following symbols have been moved to: GEMMLowpOutputStageType GEMMLowpOutputStageInfo GEMMInfo The following symbols have been moved to: MatMulInfo

In gemmlowp, the "output stage" is the process that takes a final int32 accumulator value (the output of CLGEMMLowpMatrixMultiplyCore), and processes it to obtain the final QASYMM8/QASYMM8_SIGNED value.

More information about the GEMMLowp output stage can be found at https://github.com/google/gemmlowp/blob/master/doc/output.md

In gemmlowp, the "output stage" is the process that takes a final int32 accumulator value (the output of NEGEMMLowpMatrixMultiplyCore), and processes it to obtain the final ASYMM8 value.

More information about the GEMMLowp output stage can be found at https://github.com/google/gemmlowp/blob/master/doc/output.md

The grammar of DotMLGO is defined as the following ENBF:

delim = "," | "\n"; // Note that delimiters are omitted from the definition below

mlgo = header, heuristics-table, {heuristic-tree};

header = "<header>", gemm-version, ip-type, "</header>"; gemm-version = "gemm-version", "[", int, int, int, "]"; ip-type = "ip-type", ("gpu" | "cpu");

heiristics-table = "<heuristics-table>", {heuristics-table-entry}, "</heuristics-table>"; heuristics-table-entry = entry-id, ip-name, num-cores, data-type, gpu-priority, gpu-behavior, heuristic-type, free-vars; entry-id = int; ip-name = char-sequence; num-cores = int; data-type = "f32" | "f16" | "qasymm8"; gpu-priority = "best-performance" | "best-memory-usage"; gpu-behavior = "static" | "dynamic"; heuristic-type = "gemm-type" | "gemm-config-native" | "gemm-config-reshaped-only-rhs" | "gemm-config-reshaped"; free-vars = "[", {char-sequence}, "]";

heuristic-tree = "<heuristic", entry-id, ">", {tree-node}, "</heuristic>"; tree-node = branch-node | leaf-node; branch-node = "b", entry-id, lhs-type, lhs-value, conditional-op, rhs-type, rhs-value, true-node, false-node; lhs-type = comparator-type; lhs-value = comparator-value; rhs-type = comparator-type; rhs-value = comparator-value; comparator-type = "var" | "num" | "enum"; comparator-value = char-sequence | float; conditional-op = "<" | "<=" | "==" | ">=" | ">"; true-node = entry-id; false-node = entry-id; leaf-node = "l", entry-id, heuristic-type, leaf-value; leaf-value = gemm-type | gemm-config-native | gemm-config-reshaped-only-rhs | gemm-config-reshaped gemm-type = "native" | "reshaped-only-rhs" | "reshaped"; gemm-config-native = "[", int, int, int, "]"; gemm-config-reshaped-only-rhs = "[", int, int, int, int, bool, bool, bool, "]"; gemm-config-reshaped = "[", int, int, int, int, int, bool, bool, bool, bool, "]";

Typedef Documentation

◆ BBox

using BBox = std::array<float, 4>

Definition at line 776 of file Types.h.

◆ BiStrides

Bidirectional strides.

Definition at line 81 of file Types.h.

◆ CLEqual

Basic function to run equal comparison.

Definition at line 131 of file CLComparison.h.

◆ CLFloatArray

using CLFloatArray = CLArray<cl_float>

OpenCL Array of floats.

Definition at line 117 of file CLArray.h.

◆ CLGreater

Basic function to run greater comparison.

Definition at line 135 of file CLComparison.h.

◆ CLGreaterEqual

Basic function to run greater-equal comparison.

Definition at line 137 of file CLComparison.h.

◆ CLImage

using CLImage = CLTensor

OpenCL Image.

Definition at line 104 of file CLTensor.h.

◆ CLInt16Array

using CLInt16Array = CLArray<cl_short>

OpenCL Array of int16s.

Definition at line 113 of file CLArray.h.

◆ CLInt32Array

using CLInt32Array = CLArray<cl_int>

OpenCL Array of int32s.

Definition at line 115 of file CLArray.h.

◆ CLLess

Basic function to run less comparison.

Definition at line 139 of file CLComparison.h.

◆ CLLessEqual

Basic function to run less-equal comparison.

Definition at line 141 of file CLComparison.h.

◆ CLLogSoftmaxLayer

Definition at line 110 of file CLSoftmaxLayer.h.

◆ CLNotEqual

Basic function to run not equal comparison.

Definition at line 133 of file CLComparison.h.

◆ CLSoftmaxLayer

Definition at line 109 of file CLSoftmaxLayer.h.

◆ CLUInt16Array

using CLUInt16Array = CLArray<cl_ushort>

OpenCL Array of uint16s.

Definition at line 109 of file CLArray.h.

◆ CLUInt32Array

using CLUInt32Array = CLArray<cl_uint>

OpenCL Array of uint32s.

Definition at line 111 of file CLArray.h.

◆ CLUInt8Array

using CLUInt8Array = CLArray<cl_uchar>

OpenCL Array of uint8s.

Definition at line 107 of file CLArray.h.

◆ CropInfo

Class for holding information related to cropping.

Definition at line 2017 of file Types.h.

◆ float32_t

typedef float float32_t

Definition at line 33 of file CpuTypes.h.

◆ FloatArray

using FloatArray = Array<float>

Array of floats.

Definition at line 72 of file Array.h.

◆ GroupMappings

using GroupMappings = std::map<size_t, MemoryMappings>

A map of the groups and memory mappings.

Definition at line 48 of file Types.h.

◆ half

using half = half_float::half

16-bit floating point type

Definition at line 36 of file CoreTypes.h.

◆ ICLFloatArray

using ICLFloatArray = ICLArray<cl_float>

Interface for OpenCL Array of floats.

Definition at line 126 of file ICLArray.h.

◆ ICLImage

Definition at line 114 of file ICLTensor.h.

◆ ICLInt16Array

using ICLInt16Array = ICLArray<cl_short>

Interface for OpenCL Array of int16s.

Definition at line 122 of file ICLArray.h.

◆ ICLInt32Array

using ICLInt32Array = ICLArray<cl_int>

Interface for OpenCL Array of int32s.

Definition at line 124 of file ICLArray.h.

◆ ICLUInt16Array

using ICLUInt16Array = ICLArray<cl_ushort>

Interface for OpenCL Array of uint16s.

Definition at line 118 of file ICLArray.h.

◆ ICLUInt32Array

using ICLUInt32Array = ICLArray<cl_uint>

Interface for OpenCL Array of uint32s.

Definition at line 120 of file ICLArray.h.

◆ ICLUInt8Array

using ICLUInt8Array = ICLArray<cl_uchar>

Interface for OpenCL Array of uint8s.

Definition at line 116 of file ICLArray.h.

◆ IFloatArray

using IFloatArray = IArray<float>

Interface for Array of floats.

Definition at line 143 of file IArray.h.

◆ IImage

using IImage = ITensor

Definition at line 100 of file ITensor.h.

◆ IInt16Array

using IInt16Array = IArray<int16_t>

Interface for Array of int16s.

Definition at line 139 of file IArray.h.

◆ IInt32Array

using IInt32Array = IArray<int32_t>

Interface for Array of int32s.

Definition at line 141 of file IArray.h.

◆ Image

using Image = Tensor

Image.

Definition at line 69 of file Tensor.h.

◆ INEKernel

Common interface for all kernels implemented in Neon.

Definition at line 39 of file INEOperator.h.

◆ Int16Array

using Int16Array = Array<int16_t>

Array of int16s.

Definition at line 68 of file Array.h.

◆ Int32Array

using Int32Array = Array<int32_t>

Array of int32s.

Definition at line 70 of file Array.h.

◆ IUInt16Array

using IUInt16Array = IArray<uint16_t>

Interface for Array of uint16s.

Definition at line 135 of file IArray.h.

◆ IUInt32Array

using IUInt32Array = IArray<uint32_t>

Interface for Array of uint32s.

Definition at line 137 of file IArray.h.

◆ IUInt8Array

using IUInt8Array = IArray<uint8_t>

Interface for Array of uint8s.

Definition at line 133 of file IArray.h.

◆ LabelBBox

using LabelBBox = std::map<int, std::vector<BBox> >

Definition at line 778 of file Types.h.

◆ lock_guard

using lock_guard = std::lock_guard<Mutex>

Wrapper of lock_guard data-object.

Definition at line 37 of file Mutex.h.

◆ MemoryMappings

using MemoryMappings = std::map<IMemory *, size_t>

A map of (handle, index/offset), where handle is the memory handle of the object to provide the memory for and index/offset is the buffer/offset from the pool that should be used.

Note
All objects are pre-pinned to specific buffers to avoid any relevant overheads

Definition at line 45 of file Types.h.

◆ MemoryRequirements

◆ Multiples

using Multiples = std::vector<uint32_t>

Information to produce a tiled version of a Tensor.

Definition at line 405 of file Types.h.

◆ Mutex

using Mutex = std::mutex

Wrapper of Mutex data-object.

Definition at line 33 of file Mutex.h.

◆ NEAbsLayer

◆ NEEqual

Basic function to run equal comparison.

Definition at line 468 of file NEElementwiseOperations.h.

◆ NEExpLayer

◆ NEGreater

Basic function to run greater comparison.

Definition at line 472 of file NEElementwiseOperations.h.

◆ NEGreaterEqual

Basic function to run greater-equal comparison.

Definition at line 474 of file NEElementwiseOperations.h.

◆ NELess

Basic function to run less comparison.

Definition at line 476 of file NEElementwiseOperations.h.

◆ NELessEqual

Basic function to run less-equal comparison.

Definition at line 478 of file NEElementwiseOperations.h.

◆ NELogLayer

◆ NELogSoftmaxLayer

Definition at line 98 of file NESoftmaxLayer.h.

◆ NENegLayer

◆ NENotEqual

Basic function to run not equal comparison.

Definition at line 470 of file NEElementwiseOperations.h.

◆ NERoundLayer

◆ NERsqrtLayer

◆ NEScheduler

CPU Scheduler.

Definition at line 32 of file NEScheduler.h.

◆ NESinLayer

◆ NESoftmaxLayer

Definition at line 97 of file NESoftmaxLayer.h.

◆ OperatorType

Definition at line 40 of file CLGEMM.cpp.

◆ PaddingInfo

using PaddingInfo = std::pair<uint32_t, uint32_t>

Padding information as a pair of unsigned int start/end.

Definition at line 399 of file Types.h.

◆ PaddingList

using PaddingList = std::vector<PaddingInfo>

List of padding information.

Definition at line 402 of file Types.h.

◆ PaddingSize

Container for 2D padding size.

Definition at line 346 of file Types.h.

◆ PermutationVector

Permutation vector.

Definition at line 38 of file CoreTypes.h.

◆ qasymm16_t

using qasymm16_t = uint16_t

16 bit quantized asymmetric scalar value

Definition at line 39 of file QuantizationInfo.h.

◆ qasymm8_signed_t

using qasymm8_signed_t = int8_t

8 bit signed quantized asymmetric scalar value

Definition at line 36 of file QuantizationInfo.h.

◆ qasymm8_t

using qasymm8_t = uint8_t

8 bit quantized asymmetric scalar value

Definition at line 37 of file QuantizationInfo.h.

◆ qasymm8x16_signed_t

using qasymm8x16_signed_t = int8x16_t

8 bit quantized signed asymmetric vector with 16 elements

Definition at line 44 of file NEAsymm.h.

◆ qasymm8x16_t

using qasymm8x16_t = uint8x16_t

8 bit quantized asymmetric vector with 16 elements

Definition at line 38 of file NEAsymm.h.

◆ qasymm8x8_signed_t

using qasymm8x8_signed_t = int8x8_t

8 bit quantized signed asymmetric vector with 8 elements

Definition at line 40 of file NEAsymm.h.

◆ qasymm8x8_t

using qasymm8x8_t = uint8x8_t

8 bit quantized asymmetric vector with 8 elements

Definition at line 34 of file NEAsymm.h.

◆ qasymm8x8x2_signed_t

using qasymm8x8x2_signed_t = int8x8x2_t

8 bit quantized signed asymmetric vector with 16 elements

Definition at line 41 of file NEAsymm.h.

◆ qasymm8x8x2_t

using qasymm8x8x2_t = uint8x8x2_t

8 bit quantized asymmetric vector with 16 elements

Definition at line 35 of file NEAsymm.h.

◆ qasymm8x8x3_signed_t

using qasymm8x8x3_signed_t = int8x8x3_t

8 bit quantized signed asymmetric vector with 24 elements

Definition at line 42 of file NEAsymm.h.

◆ qasymm8x8x3_t

using qasymm8x8x3_t = uint8x8x3_t

8 bit quantized asymmetric vector with 24 elements

Definition at line 36 of file NEAsymm.h.

◆ qasymm8x8x4_signed_t

using qasymm8x8x4_signed_t = int8x8x4_t

8 bit quantized signed asymmetric vector with 32 elements

Definition at line 43 of file NEAsymm.h.

◆ qasymm8x8x4_t

using qasymm8x8x4_t = uint8x8x4_t

8 bit quantized asymmetric vector with 32 elements

Definition at line 37 of file NEAsymm.h.

◆ qsymm16_t

typedef int16_t qsymm16_t

16 bit quantized symmetric scalar value

Definition at line 38 of file QuantizationInfo.h.

◆ qsymm16x8_t

using qsymm16x8_t = int16x8_t

16 bit quantized symmetric vector with 8 elements

Definition at line 38 of file NESymm.h.

◆ qsymm16x8x2_t

using qsymm16x8x2_t = int16x8x2_t

16 bit quantized symmetric vector with 16 elements

Definition at line 39 of file NESymm.h.

◆ qsymm8_t

using qsymm8_t = int8_t

8 bit quantized symmetric scalar value

Definition at line 35 of file NESymm.h.

◆ UInt16Array

using UInt16Array = Array<uint16_t>

Array of uint16s.

Definition at line 64 of file Array.h.

◆ UInt32Array

using UInt32Array = Array<uint32_t>

Array of uint32s.

Definition at line 66 of file Array.h.

◆ UInt8Array

using UInt8Array = Array<uint8_t>

Array of uint8s.

Definition at line 62 of file Array.h.

◆ unique_lock

using unique_lock = std::unique_lock<Mutex>

Wrapper of lock_guard data-object.

Definition at line 41 of file Mutex.h.

◆ WorkspaceData

Definition at line 52 of file MemoryHelpers.h.

Enumeration Type Documentation

◆ ActivationFunction

enum ActivationFunction
strong

Available activation functions.

Enumerator
LOGISTIC 

Logistic ( \( f(x) = \frac{1}{1 + e^{-x}} \) )

TANH 

Hyperbolic tangent ( \( f(x) = a \cdot tanh(b \cdot x) \) )

RELU 

Rectifier ( \( f(x) = max(0,x) \) )

BOUNDED_RELU 

Upper Bounded Rectifier ( \( f(x) = min(a, max(0,x)) \) )

LU_BOUNDED_RELU 

Lower and Upper Bounded Rectifier ( \( f(x) = min(a, max(b,x)) \) )

LEAKY_RELU 

Leaky Rectifier ( \( f(x) = \begin{cases} \alpha x & \quad \text{if } x \text{ < 0}\\ x & \quad \text{if } x \geq \text{ 0 } \end{cases} \) )

SOFT_RELU 

Soft Rectifier ( \( f(x)= log(1+e^x) \) )

ELU 

Exponential Linear Unit ( \( f(x) = \begin{cases} \alpha (exp(x) - 1) & \quad \text{if } x \text{ < 0}\\ x & \quad \text{if } x \geq \text{ 0 } \end{cases} \) )

ABS 

Absolute ( \( f(x)= |x| \) )

SQUARE 

Square ( \( f(x)= x^2 \) )

SQRT 

Square root ( \( f(x) = \sqrt{x} \) )

LINEAR 

Linear ( \( f(x)= ax + b \) )

IDENTITY 

Identity ( \( f(x)= x \) )

HARD_SWISH 

Hard-swish ( \( f(x) = (x \text{ReLU6}(x+3))/6 = x \min(\max(0,x+3),6)/6 \) )

SWISH 

Swish ( \( f(x) = \frac{x}{1 + e^{-ax}} = x \text{logistic}(ax) \) )

GELU 

GELU ( \( f(x) = x * 1/2 * 1 + erf(x / \sqrt{2}) \) )

Definition at line 41 of file ActivationLayerInfo.h.

42 {
43  LOGISTIC, /**< Logistic ( \f$ f(x) = \frac{1}{1 + e^{-x}} \f$ ) */
44  TANH, /**< Hyperbolic tangent ( \f$ f(x) = a \cdot tanh(b \cdot x) \f$ ) */
45  RELU, /**< Rectifier ( \f$ f(x) = max(0,x) \f$ ) */
46  BOUNDED_RELU, /**< Upper Bounded Rectifier ( \f$ f(x) = min(a, max(0,x)) \f$ ) */
47  LU_BOUNDED_RELU, /**< Lower and Upper Bounded Rectifier ( \f$ f(x) = min(a, max(b,x)) \f$ ) */
48  LEAKY_RELU, /**< Leaky Rectifier ( \f$ f(x) = \begin{cases} \alpha x & \quad \text{if } x \text{ < 0}\\ x & \quad \text{if } x \geq \text{ 0 } \end{cases} \f$ ) */
49  SOFT_RELU, /**< Soft Rectifier ( \f$ f(x)= log(1+e^x) \f$ ) */
50  ELU, /**< Exponential Linear Unit ( \f$ f(x) = \begin{cases} \alpha (exp(x) - 1) & \quad \text{if } x \text{ < 0}\\ x & \quad \text{if } x \geq \text{ 0 } \end{cases} \f$ ) */
51  ABS, /**< Absolute ( \f$ f(x)= |x| \f$ ) */
52  SQUARE, /**< Square ( \f$ f(x)= x^2 \f$ )*/
53  SQRT, /**< Square root ( \f$ f(x) = \sqrt{x} \f$ )*/
54  LINEAR, /**< Linear ( \f$ f(x)= ax + b \f$ ) */
55  IDENTITY, /**< Identity ( \f$ f(x)= x \f$ ) */
56  HARD_SWISH, /**< Hard-swish ( \f$ f(x) = (x \text{ReLU6}(x+3))/6 = x \min(\max(0,x+3),6)/6 \f$ ) */
57  SWISH, /**< Swish ( \f$ f(x) = \frac{x}{1 + e^{-ax}} = x \text{logistic}(ax) \f$ ) */
58  GELU /**< GELU ( \f$ f(x) = x * 1/2 * 1 + erf(x / \sqrt{2}) \f$ ) */
59 };

◆ ArithmeticOperation

enum ArithmeticOperation
strong

Available element-wise operations.

Enumerator
ADD 

(x + y)

SUB 

(x - y)

DIV 

(x / y)

MIN 

Min(x, y)

MAX 

Max(x, y)

SQUARED_DIFF 

(x - y)^2

POWER 

x ^ y

PRELU 

y*x if x < 0, x otherwise

Definition at line 421 of file Types.h.

422 {
423  ADD, /**< (x + y) */
424  SUB, /**< (x - y) */
425  DIV, /**< (x / y) */
426  MIN, /**< Min(x, y) */
427  MAX, /**< Max(x, y) */
428  SQUARED_DIFF, /**< (x - y)^2 */
429  POWER, /**< x ^ y */
430  PRELU, /**< y*x if x < 0, x otherwise */
431 };

◆ BilinearInterpolation

enum BilinearInterpolation
strong

Bilinear Interpolation method used by LKTracker.

Enumerator
BILINEAR_OLD_NEW 

Old-new method.

BILINEAR_SCHARR 

Scharr method.

Definition at line 368 of file Types.h.

369 {
370  BILINEAR_OLD_NEW, /**< Old-new method */
371  BILINEAR_SCHARR /**< Scharr method */
372 };

◆ BitwiseOperation

enum BitwiseOperation
strong

Available bitwise operations.

Enumerator
AND 

Bitwise AND operation.

NOT 

Bitwise NOT operation.

OR 

Bitwise OR operation

XOR 

Bitwise XOR operation

Definition at line 447 of file Types.h.

448 {
449  AND, /**< Bitwise AND operation */
450  NOT, /**< Bitwise NOT operation */
451  OR, /**< Bitwise OR operation */
452  XOR, /**< Bitwise XOR operation */
453 };

◆ BorderMode

enum BorderMode
strong

Methods available to handle borders.

Enumerator
UNDEFINED 

Borders are left undefined.

CONSTANT 

Pixels outside the image are assumed to have a constant value.

REPLICATE 

Pixels outside the image are assumed to have the same value as the closest image pixel.

Definition at line 231 of file Types.h.

232 {
233  UNDEFINED, /**< Borders are left undefined */
234  CONSTANT, /**< Pixels outside the image are assumed to have a constant value */
235  REPLICATE /**< Pixels outside the image are assumed to have the same value as the closest image pixel */
236 };

◆ Channel

enum Channel
strong

Available channels.

Enumerator
UNKNOWN 
C0 

Unknown channel format.

First channel (used by formats with unknown channel types).

C1 

Second channel (used by formats with unknown channel types).

C2 

Third channel (used by formats with unknown channel types).

C3 

Fourth channel (used by formats with unknown channel types).

Red channel.

Green channel.

Blue channel.

Alpha channel.

Luma channel.

Cb/U channel.

Cr/V/Value channel.

Definition at line 41 of file CoreTypes.h.

42 {
43  UNKNOWN, /** Unknown channel format */
44  C0, /**< First channel (used by formats with unknown channel types). */
45  C1, /**< Second channel (used by formats with unknown channel types). */
46  C2, /**< Third channel (used by formats with unknown channel types). */
47  C3, /**< Fourth channel (used by formats with unknown channel types). */
48  R, /**< Red channel. */
49  G, /**< Green channel. */
50  B, /**< Blue channel. */
51  A, /**< Alpha channel. */
52  Y, /**< Luma channel. */
53  U, /**< Cb/U channel. */
54  V /**< Cr/V/Value channel. */
55 };

◆ CLBackendType

enum CLBackendType
strong

List the possible OpenCL backends.

Enumerator
Native 

OpenCL native backend.

Clvk 

CLVK backend.

Definition at line 55 of file CLTypes.h.

56 {
57  Native, /**< OpenCL native backend */
58  Clvk, /**< CLVK backend */
59 };

◆ CLGEMMKernelType

enum CLGEMMKernelType
strong

OpenCL GEMM kernel types.

Enumerator
NATIVE 

Native GEMM kernel with configurable block size.

RESHAPED 

Reshaped GEMM kernel where both lhs and rhs matrices are reshaped.

Configurable reshape and block size

RESHAPED_ONLY_RHS 

Reshaped GEMM kernel where only the rhs matrix is reshaped.

Configurable reshape and block size

RESHAPED_ONLY_RHS_MMUL 

Reshaped GEMM kernel where only the rhs matrix is reshaped.

Using MMUL with configurable block size.

Definition at line 31 of file CLTypes.h.

32 {
33  /** Native GEMM kernel with configurable block size.*/
34  NATIVE,
35  /** Reshaped GEMM kernel where both lhs and rhs matrices are reshaped. Configurable reshape and block size */
36  RESHAPED,
37  /** Reshaped GEMM kernel where only the rhs matrix is reshaped. Configurable reshape and block size */
39  /** Reshaped GEMM kernel where only the rhs matrix is reshaped. Using MMUL with configurable block size. */
41 };

◆ CLImage2DType

enum CLImage2DType
strong

OpenCL Image2D types.

Enumerator
ReadOnly 
WriteOnly 

Definition at line 41 of file CLUtils.h.

42 {
43  ReadOnly,
44  WriteOnly
45 };

◆ CLKernelType

Enumerator
UNKNOWN 

Unknown CL kernel type.

UNKNOWN 
DEPTHWISE 

Depthwise CL kernel type.

DIRECT 

Direct Convolution CL kernel type.

ELEMENTWISE 

Elementwise CL kernel type.

GEMM 

GEMM CL kernel type.

POOL 

Pool CL kernel type.

WINOGRAD 

Winograd CL kernel type.

Definition at line 78 of file CLTypes.h.

79 {
80  UNKNOWN, /**< Unknown CL kernel type */
81  DEPTHWISE, /**< Depthwise CL kernel type */
82  DIRECT, /**< Direct Convolution CL kernel type */
83  ELEMENTWISE, /**< Elementwise CL kernel type */
84  GEMM, /**< GEMM CL kernel type */
85  POOL, /**< Pool CL kernel type */
86  WINOGRAD /**< Winograd CL kernel type */
87 };

◆ CLTunerMode

enum CLTunerMode
strong

< OpenCL tuner modes

Enumerator
EXHAUSTIVE 

Searches all possible LWS configurations while tuning.

NORMAL 

Searches a subset of LWS configurations while tuning.

RAPID 

Searches a minimal subset of LWS configurations while tuning.

Definition at line 35 of file CLTunerTypes.h.

36 {
37  EXHAUSTIVE, /**< Searches all possible LWS configurations while tuning */
38  NORMAL, /**< Searches a subset of LWS configurations while tuning */
39  RAPID /**< Searches a minimal subset of LWS configurations while tuning */
40 };

◆ CLVersion

enum CLVersion
strong

Available OpenCL Version.

Enumerator
CL10 
CL11 
CL12 
CL20 
CL30 
UNKNOWN 

Definition at line 39 of file CLTypes.h.

40 {
41  CL10, /* the OpenCL 1.0 */
42  CL11, /* the OpenCL 1.1 */
43  CL12, /* the OpenCL 1.2 */
44  CL20, /* the OpenCL 2.x */
45  CL30, /* the OpenCL 3.x */
46  UNKNOWN /* unkown version */
47 };

◆ ComparisonOperation

enum ComparisonOperation
strong

Supported comparison operations.

Enumerator
Equal 

Equal comparison ( \( x == y \) )

NotEqual 

NotEqual comparison ( \( x != y \) )

Greater 

Greater comparison ( \( x > y \) )

GreaterEqual 

Greater equal comparison ( \( x >= y \) )

Less 

Less comparison ( \( x < y \) )

LessEqual 

Less equal comparison ( \( x <= y \) )

Definition at line 132 of file Types.h.

133 {
134  Equal, /**< Equal comparison ( \f$ x == y \f$ ) */
135  NotEqual, /**< NotEqual comparison ( \f$ x != y \f$ ) */
136  Greater, /**< Greater comparison ( \f$ x > y \f$ ) */
137  GreaterEqual, /**< Greater equal comparison ( \f$ x >= y \f$ ) */
138  Less, /**< Less comparison ( \f$ x < y \f$ ) */
139  LessEqual /**< Less equal comparison ( \f$ x <= y \f$ ) */
140 };

◆ ConvertPolicy

enum ConvertPolicy
strong

Policy to handle integer overflow.

Note
: This is ignored by floating point operations where the overflow behavior adheres to the IEEE-754 standard which states that in case of overflow ±infinity is returned for the round-to-nearest modes (and follows the rounding rules for the directed rounding modes) by default.
Enumerator
WRAP 

Wrap around.

SATURATE 

Saturate.

Definition at line 353 of file Types.h.

354 {
355  WRAP, /**< Wrap around */
356  SATURATE /**< Saturate */
357 };

◆ ConvolutionMethod

enum ConvolutionMethod
strong

Available ConvolutionMethod.

Enumerator
GEMM 

Convolution using GEMM.

GEMM_CONV2D 

Direct 2D GEMM convolution.

DIRECT 

Direct convolution.

INDIRECT 

Indirect convolution.

WINOGRAD 

Convolution using Winograd.

FFT 

Convolution using FFT.

Definition at line 91 of file Types.h.

92 {
93  GEMM, /**< Convolution using GEMM */
94  GEMM_CONV2D, /**< Direct 2D GEMM convolution */
95  DIRECT, /**< Direct convolution */
96  INDIRECT, /**< Indirect convolution */
97  WINOGRAD, /**< Convolution using Winograd */
98  FFT /**< Convolution using FFT */
99 };

◆ CPUModel

enum CPUModel
strong

CPU models types.

Note
We only need to detect CPUs we have microarchitecture-specific code for.
Architecture features are detected via HWCAPs.
Enumerator
GENERIC 
GENERIC_FP16 
GENERIC_FP16_DOT 
A53 
A55r0 
A55r1 
A35 
A73 
A76 
A510 
X1 
V1 
A64FX 
N1 

Definition at line 59 of file CPPTypes.h.

60 {
61 #define X(model) model,
63 #undef X
64 };

◆ DataLayout

enum DataLayout
strong

[DataLayout enum definition]

Supported tensor data layouts

Enumerator
UNKNOWN 

Unknown data layout.

NCHW 

Num samples, channels, height, width.

NHWC 

Num samples, height, width, channels.

NCDHW 

Num samples, channels, depth, height, width.

NDHWC 

Num samples, depth, height, width, channels.

Definition at line 110 of file CoreTypes.h.

111 {
112  UNKNOWN, /**< Unknown data layout */
113  NCHW, /**< Num samples, channels, height, width */
114  NHWC, /**< Num samples, height, width, channels */
115  NCDHW, /**< Num samples, channels, depth, height, width */
116  NDHWC /**< Num samples, depth, height, width, channels */
117 };

◆ DataLayoutDimension

enum DataLayoutDimension
strong

[DataLayout enum definition]

Supported tensor data layout dimensions

Enumerator
CHANNEL 

channel

HEIGHT 

height

WIDTH 

width

DEPTH 

depth

BATCHES 

batches

Definition at line 121 of file CoreTypes.h.

122 {
123  CHANNEL, /**< channel */
124  HEIGHT, /**< height */
125  WIDTH, /**< width */
126  DEPTH, /**< depth */
127  BATCHES /**< batches */
128 };

◆ DataType

enum DataType
strong

Available data types.

Enumerator
UNKNOWN 

Unknown data type.

U8 

unsigned 8-bit number

S8 

signed 8-bit number

QSYMM8 

quantized, symmetric fixed-point 8-bit number

QASYMM8 

quantized, asymmetric fixed-point 8-bit number unsigned

QASYMM8_SIGNED 

quantized, asymmetric fixed-point 8-bit number signed

QSYMM8_PER_CHANNEL 

quantized, symmetric per channel fixed-point 8-bit number

U16 

unsigned 16-bit number

S16 

signed 16-bit number

QSYMM16 

quantized, symmetric fixed-point 16-bit number

QASYMM16 

quantized, asymmetric fixed-point 16-bit number

U32 

unsigned 32-bit number

S32 

signed 32-bit number

U64 

unsigned 64-bit number

S64 

signed 64-bit number

BFLOAT16 

16-bit brain floating-point number

F16 

16-bit floating-point number

F32 

32-bit floating-point number

F64 

64-bit floating-point number

SIZET 

size_t

Definition at line 83 of file CoreTypes.h.

84 {
85  UNKNOWN, /**< Unknown data type */
86  U8, /**< unsigned 8-bit number */
87  S8, /**< signed 8-bit number */
88  QSYMM8, /**< quantized, symmetric fixed-point 8-bit number */
89  QASYMM8, /**< quantized, asymmetric fixed-point 8-bit number unsigned */
90  QASYMM8_SIGNED, /**< quantized, asymmetric fixed-point 8-bit number signed */
91  QSYMM8_PER_CHANNEL, /**< quantized, symmetric per channel fixed-point 8-bit number */
92  U16, /**< unsigned 16-bit number */
93  S16, /**< signed 16-bit number */
94  QSYMM16, /**< quantized, symmetric fixed-point 16-bit number */
95  QASYMM16, /**< quantized, asymmetric fixed-point 16-bit number */
96  U32, /**< unsigned 32-bit number */
97  S32, /**< signed 32-bit number */
98  U64, /**< unsigned 64-bit number */
99  S64, /**< signed 64-bit number */
100  BFLOAT16, /**< 16-bit brain floating-point number */
101  F16, /**< 16-bit floating-point number */
102  F32, /**< 32-bit floating-point number */
103  F64, /**< 64-bit floating-point number */
104  SIZET /**< size_t */
105 };

◆ DeconvolutionMethod

enum DeconvolutionMethod
strong

Available DeconvolutionMethod.

Enumerator
GEMM 

Deconvolution using GEMM.

DIRECT 

Direct deconvolution.

UPSCALE_CONV2D 

Deconvolution with Upscaling.

Definition at line 109 of file Types.h.

110 {
111  GEMM, /**< Deconvolution using GEMM */
112  DIRECT, /**< Direct deconvolution */
113  UPSCALE_CONV2D /**< Deconvolution with Upscaling */
114 };

◆ DepthwiseConvolutionFunction

Available DepthwiseConvolutionFunction.

Enumerator
OPTIMIZED 

Optimized Depthwise Convolution.

GENERIC 

Generic Depthwise Convolution.

Definition at line 102 of file Types.h.

103 {
104  OPTIMIZED, /**< Optimized Depthwise Convolution */
105  GENERIC, /**< Generic Depthwise Convolution */
106 };

◆ DetectionOutputLayerCodeType

Available Detection Output code types.

Enumerator
CORNER 

Use box corners.

CENTER_SIZE 

Use box centers and size.

CORNER_SIZE 

Use box centers and size.

TF_CENTER 

Use box centers and size but flip x and y co-ordinates.

Definition at line 781 of file Types.h.

782 {
783  CORNER, /**< Use box corners */
784  CENTER_SIZE, /**< Use box centers and size */
785  CORNER_SIZE, /**< Use box centers and size */
786  TF_CENTER /**< Use box centers and size but flip x and y co-ordinates */
787 };

◆ DeviceType

enum DeviceType
strong

Device types.

Enumerator
NEON 
CL 

Definition at line 33 of file IDevice.h.

34 {
35  NEON,
36  CL,
37 };

◆ DimensionRoundingType

enum DimensionRoundingType
strong

Dimension rounding type when down-scaling on CNNs.

Note
Used in pooling and convolution layer
Enumerator
FLOOR 

Floor rounding.

CEIL 

Ceil rounding.

Definition at line 133 of file CoreTypes.h.

134 {
135  FLOOR, /**< Floor rounding */
136  CEIL /**< Ceil rounding */
137 };

◆ ElementWiseUnary

enum ElementWiseUnary
strong

Available element wise unary operations.

Enumerator
RSQRT 

Reverse square root.

EXP 

Exponential.

NEG 

Negate.

LOG 

Natural Logarithm.

ABS 

Absolute value.

SIN 

Sine.

ROUND 

Round.

LOGICAL_NOT 

Logical Not.

Definition at line 434 of file Types.h.

435 {
436  RSQRT, /**< Reverse square root */
437  EXP, /**< Exponential */
438  NEG, /**< Negate */
439  LOG, /**< Natural Logarithm */
440  ABS, /**< Absolute value */
441  SIN, /**< Sine */
442  ROUND, /**< Round */
443  LOGICAL_NOT, /**< Logical Not */
444 };

◆ ErrorCode

enum ErrorCode
strong

Available error codes.

Enumerator
OK 

No error.

RUNTIME_ERROR 

Generic runtime error.

UNSUPPORTED_EXTENSION_USE 

Unsupported extension used.

Definition at line 44 of file Error.h.

45 {
46  OK, /**< No error */
47  RUNTIME_ERROR, /**< Generic runtime error */
48  UNSUPPORTED_EXTENSION_USE /**< Unsupported extension used*/
49 };

◆ ExecutionMode

enum ExecutionMode
strong
Enumerator
FastRerun 
FastStart 

Definition at line 51 of file Types.h.

◆ FFTDirection

enum FFTDirection
strong

FFT direction to use.

Enumerator
Forward 
Inverse 

Definition at line 35 of file FunctionDescriptors.h.

36 {
37  Forward,
38  Inverse
39 };

◆ Format

enum Format
strong

Image colour formats.

Enumerator
UNKNOWN 

Unknown image format.

U8 

1 channel, 1 U8 per channel

S16 

1 channel, 1 S16 per channel

U16 

1 channel, 1 U16 per channel

S32 

1 channel, 1 S32 per channel

U32 

1 channel, 1 U32 per channel

S64 

1 channel, 1 S64 per channel

U64 

1 channel, 1 U64 per channel

BFLOAT16 

16-bit brain floating-point number

F16 

1 channel, 1 F16 per channel

F32 

1 channel, 1 F32 per channel

UV88 

2 channel, 1 U8 per channel

RGB888 

3 channels, 1 U8 per channel

RGBA8888 

4 channels, 1 U8 per channel

YUV444 

A 3 plane of 8 bit 4:4:4 sampled Y, U, V planes.

YUYV422 

A single plane of 32-bit macro pixel of Y0, U0, Y1, V0 bytes.

NV12 

A 2 plane YUV format of Luma (Y) and interleaved UV data at 4:2:0 sampling.

NV21 

A 2 plane YUV format of Luma (Y) and interleaved VU data at 4:2:0 sampling.

IYUV 

A 3 plane of 8-bit 4:2:0 sampled Y, U, V planes.

UYVY422 

A single plane of 32-bit macro pixel of U0, Y0, V0, Y1 byte.

Definition at line 58 of file CoreTypes.h.

59 {
60  UNKNOWN, /**< Unknown image format */
61  U8, /**< 1 channel, 1 U8 per channel */
62  S16, /**< 1 channel, 1 S16 per channel */
63  U16, /**< 1 channel, 1 U16 per channel */
64  S32, /**< 1 channel, 1 S32 per channel */
65  U32, /**< 1 channel, 1 U32 per channel */
66  S64, /**< 1 channel, 1 S64 per channel */
67  U64, /**< 1 channel, 1 U64 per channel */
68  BFLOAT16, /**< 16-bit brain floating-point number */
69  F16, /**< 1 channel, 1 F16 per channel */
70  F32, /**< 1 channel, 1 F32 per channel */
71  UV88, /**< 2 channel, 1 U8 per channel */
72  RGB888, /**< 3 channels, 1 U8 per channel */
73  RGBA8888, /**< 4 channels, 1 U8 per channel */
74  YUV444, /**< A 3 plane of 8 bit 4:4:4 sampled Y, U, V planes */
75  YUYV422, /**< A single plane of 32-bit macro pixel of Y0, U0, Y1, V0 bytes */
76  NV12, /**< A 2 plane YUV format of Luma (Y) and interleaved UV data at 4:2:0 sampling */
77  NV21, /**< A 2 plane YUV format of Luma (Y) and interleaved VU data at 4:2:0 sampling */
78  IYUV, /**< A 3 plane of 8-bit 4:2:0 sampled Y, U, V planes */
79  UYVY422 /**< A single plane of 32-bit macro pixel of U0, Y0, V0, Y1 byte */
80 };

◆ FuseBatchNormalizationType

Available FuseBatchNormalizationType.

Enumerator
CONVOLUTION 

For Convolution weights.

DEPTHWISECONVOLUTION 

For Depthwise Convolution weights.

Definition at line 117 of file Types.h.

118 {
119  CONVOLUTION, /**< For Convolution weights */
120  DEPTHWISECONVOLUTION /**< For Depthwise Convolution weights*/
121 };

◆ GEMMLowpOutputStageType

GEMMLowp output stage type.

Enumerator
NONE 

No quantization.

QUANTIZE_DOWN 

Quantize using an integer multiplication.

QUANTIZE_DOWN_FIXEDPOINT 

Quantize using a fixed point multiplication.

QUANTIZE_DOWN_FLOAT 

Quantize using a floating point multiplication.

Definition at line 36 of file GEMMInfo.h.

37 {
38  NONE, /**< No quantization */
39  QUANTIZE_DOWN, /**< Quantize using an integer multiplication */
40  QUANTIZE_DOWN_FIXEDPOINT, /**< Quantize using a fixed point multiplication */
41  QUANTIZE_DOWN_FLOAT /**< Quantize using a floating point multiplication */
42 };

◆ GPUTarget

enum GPUTarget
strong

Available GPU Targets.

Enumerator
UNKNOWN 
GPU_ARCH_MASK 
GPU_GENERATION_MASK 
MIDGARD 
BIFROST 
VALHALL 
FIFTHGEN 
T600 
T700 
T800 
G71 
G72 
G51 
G51BIG 
G51LIT 
G31 
G76 
G52 
G52LIT 
G77 
G57 
G78 
G68 
G78AE 
G710 
G610 
G510 
G310 
G715 
G615 
G720 
G620 

Definition at line 34 of file GPUTarget.h.

35 {
36  UNKNOWN = 0x101,
37  GPU_ARCH_MASK = 0xF00,
38  GPU_GENERATION_MASK = 0x0F0,
39  MIDGARD = 0x100,
40  BIFROST = 0x200,
41  VALHALL = 0x300,
42  FIFTHGEN = 0X400,
43  T600 = 0x110,
44  T700 = 0x120,
45  T800 = 0x130,
46  G71 = 0x210,
47  G72 = 0x220,
48  G51 = 0x221,
49  G51BIG = 0x222,
50  G51LIT = 0x223,
51  G31 = 0x224,
52  G76 = 0x230,
53  G52 = 0x231,
54  G52LIT = 0x232,
55  G77 = 0x310,
56  G57 = 0x311,
57  G78 = 0x320,
58  G68 = 0x321,
59  G78AE = 0x330,
60  G710 = 0x340,
61  G610 = 0x341,
62  G510 = 0x342,
63  G310 = 0x343,
64  G715 = 0x350,
65  G615 = 0x351,
66  G720 = 0x410,
67  G620 = 0X411
68 };

◆ ImportMemoryType

enum ImportMemoryType
strong
Enumerator
HostPtr 

Definition at line 57 of file Types.h.

◆ InterpolationPolicy

enum InterpolationPolicy
strong

Interpolation method.

Enumerator
NEAREST_NEIGHBOR 

Output values are defined to match the source pixel whose center is nearest to the sample position.

BILINEAR 

Output values are defined by bilinear interpolation between the pixels.

AREA 

Output values are determined by averaging the source pixels whose areas fall under the area of the destination pixel, projected onto the source image.

Definition at line 360 of file Types.h.

361 {
362  NEAREST_NEIGHBOR, /**< Output values are defined to match the source pixel whose center is nearest to the sample position */
363  BILINEAR, /**< Output values are defined by bilinear interpolation between the pixels */
364  AREA, /**< Output values are determined by averaging the source pixels whose areas fall under the area of the destination pixel, projected onto the source image */
365 };

◆ LogicalOperation

enum LogicalOperation
strong

List of supported logical operations.

Enumerator
Unknown 

Unknown.

And 

Logical And &&.

Or 

Logical Or ||.

Not 

Logical Not !

Definition at line 30 of file KernelTypes.h.

31 {
32  Unknown, /**< Unknown */
33  And, /**< Logical And && */
34  Or, /**< Logical Or || */
35  Not, /**< Logical Not ! */
36 };

◆ MappingType

enum MappingType
strong

Mapping type.

Enumerator
BLOBS 

Mappings are in blob granularity.

OFFSETS 

Mappings are in offset granularity in the same blob.

Definition at line 34 of file Types.h.

35 {
36  BLOBS, /**< Mappings are in blob granularity */
37  OFFSETS /**< Mappings are in offset granularity in the same blob */
38 };

◆ NMSType

enum NMSType
strong

Available non maxima suppression types.

Enumerator
LINEAR 

Linear NMS.

GAUSSIAN 

Gaussian NMS.

ORIGINAL 

Original NMS.

Definition at line 488 of file Types.h.

489 {
490  LINEAR, /**< Linear NMS */
491  GAUSSIAN, /**< Gaussian NMS */
492  ORIGINAL /**< Original NMS */
493 };

◆ NormType

enum NormType
strong

The normalization type used for the normalization layer.

Enumerator
IN_MAP_1D 

Normalization applied within the same map in 1D region.

IN_MAP_2D 

Normalization applied within the same map in 2D region.

CROSS_MAP 

Normalization applied cross maps.

Definition at line 456 of file Types.h.

457 {
458  IN_MAP_1D, /**< Normalization applied within the same map in 1D region */
459  IN_MAP_2D, /**< Normalization applied within the same map in 2D region */
460  CROSS_MAP /**< Normalization applied cross maps */
461 };

◆ PaddingMode

enum PaddingMode
strong

Padding mode to use for PadLayer.

Enumerator
CONSTANT 
REFLECT 
SYMMETRIC 

Definition at line 124 of file Types.h.

125 {
126  CONSTANT,
127  REFLECT,
128  SYMMETRIC
129 };

◆ PoolingType

enum PoolingType
strong

Available pooling types.

Enumerator
MAX 

Max Pooling.

AVG 

Average Pooling.

L2 

L2 Pooling.

Definition at line 480 of file Types.h.

481 {
482  MAX, /**< Max Pooling */
483  AVG, /**< Average Pooling */
484  L2 /**< L2 Pooling */
485 };

◆ ReductionOperation

enum ReductionOperation
strong

Available reduction operations.

Enumerator
ARG_IDX_MAX 

Index of the max value.

ARG_IDX_MIN 

Index of the min value.

MEAN_SUM 

Mean of sum.

PROD 

Product.

SUM_SQUARE 

Sum of squares.

SUM 

Sum.

MIN 

Min.

MAX 

Max.

Definition at line 408 of file Types.h.

409 {
410  ARG_IDX_MAX, /**< Index of the max value */
411  ARG_IDX_MIN, /**< Index of the min value */
412  MEAN_SUM, /**< Mean of sum */
413  PROD, /**< Product */
414  SUM_SQUARE, /**< Sum of squares */
415  SUM, /**< Sum */
416  MIN, /**< Min */
417  MAX, /**< Max */
418 };

◆ RoundingPolicy

enum RoundingPolicy
strong

Rounding method.

Enumerator
TO_ZERO 

Truncates the least significant values that are lost in operations.

TO_NEAREST_UP 

Rounds to nearest value; half rounds away from zero.

TO_NEAREST_EVEN 

Rounds to nearest value; half rounds to nearest even.

Definition at line 30 of file Rounding.h.

31 {
32  TO_ZERO, /**< Truncates the least significant values that are lost in operations. */
33  TO_NEAREST_UP, /**< Rounds to nearest value; half rounds away from zero */
34  TO_NEAREST_EVEN, /**< Rounds to nearest value; half rounds to nearest even */
35 };

◆ SamplingPolicy

enum SamplingPolicy
strong

Available Sampling Policies.

Enumerator
CENTER 

Samples are taken at pixel center.

TOP_LEFT 

Samples are taken at pixel top left corner.

Definition at line 84 of file Types.h.

85 {
86  CENTER, /**< Samples are taken at pixel center */
87  TOP_LEFT /**< Samples are taken at pixel top left corner */
88 };

◆ ScatterFunction

enum ScatterFunction
strong

Scatter Function.

Enumerator
Update 
Add 
Sub 
Max 
Min 

Definition at line 33 of file ScatterInfo.h.

34 {
35  Update = 0,
36  Add = 1,
37  Sub = 2,
38  Max = 3,
39  Min = 4
40 };

◆ StatusCode

enum StatusCode
strong
Enumerator
Success 
RuntimeError 
OutOfMemory 
Unimplemented 
UnsupportedTarget 
InvalidTarget 
InvalidArgument 
UnsupportedConfig 
InvalidObjectState 

Definition at line 32 of file Types.h.

◆ Target

enum Target
strong
Enumerator
Cpu 
GpuOcl 

Definition at line 45 of file Types.h.

46 {
49 };

◆ TensorType

enum TensorType : int32_t

Memory type.

Enumerator
ACL_UNKNOWN 
ACL_SRC_DST 
ACL_SRC 
ACL_SRC_0 
ACL_SRC_1 
ACL_SRC_2 
ACL_SRC_3 
ACL_SRC_4 
ACL_SRC_5 
ACL_SRC_6 
ACL_SRC_END 
ACL_DST 
ACL_DST_0 
ACL_DST_1 
ACL_DST_2 
ACL_DST_END 
ACL_INT 
ACL_INT_0 
ACL_INT_1 
ACL_INT_2 
ACL_INT_3 
ACL_INT_4 
ACL_SRC_VEC 
ACL_DST_VEC 
ACL_INT_VEC 
ACL_BIAS 
ACL_VEC_ROW_SUM 
ACL_VEC_COL_SUM 
ACL_SHIFTS 
ACL_MULTIPLIERS 

Definition at line 38 of file Types.h.

38  : int32_t
39 {
40  ACL_UNKNOWN = -1,
41  ACL_SRC_DST = 0,
42 
43  // Src
44  ACL_SRC = 0,
45  ACL_SRC_0 = 0,
46  ACL_SRC_1 = 1,
47  ACL_SRC_2 = 2,
48  ACL_SRC_3 = 3,
49  ACL_SRC_4 = 4,
50  ACL_SRC_5 = 5,
51  ACL_SRC_6 = 6,
52  ACL_SRC_END = 6,
53 
54  // Dst
55  ACL_DST = 30,
56  ACL_DST_0 = 30,
57  ACL_DST_1 = 31,
58  ACL_DST_2 = 32,
59  ACL_DST_END = 32,
60 
61  // Aux
62  ACL_INT = 50,
63  ACL_INT_0 = 50,
64  ACL_INT_1 = 51,
65  ACL_INT_2 = 52,
66  ACL_INT_3 = 53,
67  ACL_INT_4 = 54,
68  ACL_SRC_VEC = 256,
69  ACL_DST_VEC = 512,
70  ACL_INT_VEC = 1024,
71 
72  // Aliasing Types
73  // Conv etc
75 
76  // Gemm
81 };

◆ WeightFormat

enum WeightFormat
strong

Memory layouts for the weights tensor.

  • UNSPECIFIED is used to select kernels that do not run in variable weights mode.
  • ANY is used to query the kernel database to retrieve any of the kernels that runs in variable weights mode. Once a kernel is found, the specific format expected by the kernel can be retrieved by the user for reordering the weights tensor accordingly.

The other values OHWIo{interleave_by}i{block_by} describe the memory layout of a 4D tensor with layout OHWI that has been transformed into a 4D tensor with dimensions O'HWI' where:

O' = first multiple of {interleave_by} s.t. O<=O' I' = first multiple of {block_by} s.t. I<=I'

The total size of the dst tensor is O' x H x W x I'

The access function of the tensor with layout OHWIo{interleave_by}i{block_by} and size O'HWI' is a 6-parameter access function, where the 6 parameters are computed as follows:

x5 = floor(o/{interleave_by}) RANGE [0, O'/{interleave_by} -1] SIZE: O'/{interleave_by}

x4 = h RANGE [0, H-1] SIZE: H x3 = w RANGE [0, W-1] SIZE: W x2 = floor(i/{block_by}) RANGE [0, I'/{block_by} -1] SIZE: I'/{block_by} x1 = o%{interleave_by} RANGE [0, {interleave_by} -1] SIZE: {interleave_by} x0 = i%{block_by} RANGE [0, {block_by} -1] SIZE: {block_by} TOTAL SIZE: O' * H * W * I'

4D 6D


value(o, h, w, i) = x5 * H * W * I' * {interleave_by}

  • x4 * W * I' * {interleave_by}
  • x3 * I' * {interleave_by}
  • x2 * {interleave_by} * {block_by}
  • x1 * {block_by}
  • x0

Notice that in arm_gemm the 4D tensor of dimension O'HWI' created for the OHWIo{interleave_by}i{block_by} format is in reality seen as a 2D tensor, where the number of rows is O'/{interleave_by} and the number of columns is {interleave_by} * H * W * I'.

The postfix *_bf16 is for the memory layout needed for the fast-mode kernels, in which the weights are passed in bfloat16 format.

Enumerator
UNSPECIFIED 
ANY 
OHWI 
OHWIo2 
OHWIo4 
OHWIo8 
OHWIo16 
OHWIo32 
OHWIo64 
OHWIo128 
OHWIo4i2 
OHWIo4i2_bf16 
OHWIo8i2 
OHWIo8i2_bf16 
OHWIo16i2 
OHWIo16i2_bf16 
OHWIo32i2 
OHWIo32i2_bf16 
OHWIo64i2 
OHWIo64i2_bf16 
OHWIo4i4 
OHWIo4i4_bf16 
OHWIo8i4 
OHWIo8i4_bf16 
OHWIo16i4 
OHWIo16i4_bf16 
OHWIo32i4 
OHWIo32i4_bf16 
OHWIo64i4 
OHWIo64i4_bf16 
OHWIo2i8 
OHWIo4i8 
OHWIo8i8 
OHWIo16i8 
OHWIo32i8 
OHWIo64i8 

Definition at line 311 of file CoreTypes.h.

312 {
313  UNSPECIFIED = 0x1,
314  ANY = 0x2,
315  OHWI = 0x100100,
316  OHWIo2 = 0x100200,
317  OHWIo4 = 0x100400,
318  OHWIo8 = 0x100800,
319  OHWIo16 = 0x101000,
320  OHWIo32 = 0x102000,
321  OHWIo64 = 0x104000,
322  OHWIo128 = 0x108000,
323  OHWIo4i2 = 0x200400,
324  OHWIo4i2_bf16 = 0x200410,
325  OHWIo8i2 = 0x200800,
326  OHWIo8i2_bf16 = 0x200810,
327  OHWIo16i2 = 0x201000,
328  OHWIo16i2_bf16 = 0x201010,
329  OHWIo32i2 = 0x202000,
330  OHWIo32i2_bf16 = 0x202010,
331  OHWIo64i2 = 0x204000,
332  OHWIo64i2_bf16 = 0x204010,
333  OHWIo4i4 = 0x400400,
334  OHWIo4i4_bf16 = 0x400410,
335  OHWIo8i4 = 0x400800,
336  OHWIo8i4_bf16 = 0x400810,
337  OHWIo16i4 = 0x401000,
338  OHWIo16i4_bf16 = 0x401010,
339  OHWIo32i4 = 0x402000,
340  OHWIo32i4_bf16 = 0x402010,
341  OHWIo64i4 = 0x404000,
342  OHWIo64i4_bf16 = 0x404010,
343  OHWIo2i8 = 0x800200,
344  OHWIo4i8 = 0x800400,
345  OHWIo8i8 = 0x800800,
346  OHWIo16i8 = 0x801000,
347  OHWIo32i8 = 0x802000,
348  OHWIo64i8 = 0x804000
349 };

Function Documentation

◆ adjust_down()

int arm_compute::adjust_down ( int  required,
int  available,
int  step 
)
inline

Decrease required in steps of step until it's less than available.

Parameters
[in]requiredNumber of required bytes.
[in]availableNumber of available bytes.
[in]stepStep size used to decrease required bytes.
Returns
Largest value smaller than available that is a multiple of step

Definition at line 47 of file IAccessWindow.h.

48 {
50 
51  return required - step * ((required - available + step - 1) / step);
52 }

References ARM_COMPUTE_ERROR_ON, GemmTuner::required, and arm_compute::cpu::step.

Referenced by AccessWindowTranspose::update_window_if_needed(), and AccessWindowRectangle::update_window_if_needed().

◆ adjust_odd_shape()

TensorShape arm_compute::adjust_odd_shape ( const TensorShape shape,
Format  format 
)
inline

Adjust tensor shape size if width or height are odd for a given multi-planar format.

No modification is done for other formats.

Note
Adding here a few links discussing the issue of odd size and sharing the same solution: Android Source WebM libYUV YUVPlayer *
Parameters
[in,out]shapeTensor shape of 2D size
[in]formatFormat of the tensor
Returns
The adjusted tensor shape.

Definition at line 338 of file Validate.h.

339 {
340  TensorShape output{shape};
341 
342  // Force width to be even for formats which require subsampling of the U and V channels
344  {
345  output.set(0, (output.x() + 1) & ~1U);
346  }
347 
348  // Force height to be even for formats which require subsampling of the U and V channels
350  {
351  output.set(1, (output.y() + 1) & ~1U);
352  }
353 
354  return output;
355 }

References update_supported_ops::format, has_format_horizontal_subsampling(), has_format_vertical_subsampling(), arm_compute::test::validation::shape, and arm_compute::utils::cast::U.

◆ adjust_up()

int arm_compute::adjust_up ( int  required,
int  available,
int  step 
)
inline

Increase required in steps of step until it's greater than available.

Parameters
[in]requiredNumber of required bytes.
[in]availableNumber of available bytes.
[in]stepStep size used to increase required bytes.
Returns
Largest value smaller than available that is a multiple of step

Definition at line 63 of file IAccessWindow.h.

64 {
66 
67  return required + step * ((available - required + step - 1) / step);
68 }

References ARM_COMPUTE_ERROR_ON, GemmTuner::required, and arm_compute::cpu::step.

Referenced by AccessWindowTranspose::update_window_if_needed(), and AccessWindowRectangle::update_window_if_needed().

◆ adjust_vec_size()

unsigned int arm_compute::adjust_vec_size ( unsigned int  vec_size,
size_t  dim0 
)
inline

Returns the adjusted vector size in case it is less than the input's first dimension, getting rounded down to its closest valid vector size.

Parameters
[in]vec_sizevector size to be adjusted
[in]dim0size of the first dimension
Returns
the number of element processed along the X axis per thread

Definition at line 38 of file AdjustVecSize.h.

39 {
40  ARM_COMPUTE_ERROR_ON(vec_size > 16);
41 
42  if ((vec_size >= dim0) && (dim0 == 3))
43  {
44  return dim0;
45  }
46 
47  while (vec_size > dim0)
48  {
49  vec_size >>= 1;
50  }
51 
52  return vec_size;
53 }

References ARM_COMPUTE_ERROR_ON.

Referenced by ClTransposedConvolutionKernel::configure(), ClFloorKernel::configure(), ClTransposeKernel::configure(), ClCopyKernel::configure(), ClElementWiseUnaryKernel::configure(), ClMatMulLowpNativeMMULKernel::configure(), ClWidthConcatenate2TensorsKernel::configure(), ClPool2dKernel::configure(), ClPool3dKernel::configure(), ClHeightConcatenateKernel::configure(), ClScaleKernel::configure(), ClWidthConcatenateKernel::configure(), ClWidthConcatenate4TensorsKernel::configure(), ClActivationKernel::configure(), ClMatMulNativeKernel::configure(), ClBatchConcatenateKernel::configure(), ClDepthConcatenateKernel::configure(), ClMatMulLowpNativeKernel::configure(), CLBitwiseKernel::configure(), ClGemmLowpQuantizeDownInt32ScaleByFixedPointKernel::configure(), CLChannelShuffleLayerKernel::configure(), ClIndirectConv2dKernel::configure(), CLSelectKernel::configure(), ClGemmLowpQuantizeDownInt32ScaleKernel::configure(), ClGemmLowpQuantizeDownInt32ScaleByFloatKernel::configure(), CLNormalizationLayerKernel::configure(), ClSoftmaxKernel::configure(), CLComparisonKernel::configure(), ClCastKernel::configure(), ClGemmLowpOffsetContributionKernel::configure(), ClGemmLowpOffsetContributionOutputStageKernel::configure(), CLMeanStdDevNormalizationKernel::configure(), CLNormalizePlanarYUVLayerKernel::configure(), CLReductionOperationKernel::configure(), CLRangeKernel::configure(), ClDirectConv2dKernel::configure(), ClDirectConv3dKernel::configure(), CLL2NormalizeLayerKernel::configure(), ClMatMulNativeMMULKernel::configure(), CLPadLayerKernel::configure(), ClMulKernel::configure(), CLArgMinMaxLayerKernel::configure(), CLDepthwiseConvolutionLayerNativeKernel::configure(), CLBatchNormalizationLayerKernel::configure(), ClGemmLowpMatrixBReductionKernel::configure(), GpuCkwCast::get_window(), GpuCkwElementwiseBinary::get_window(), GpuCkwActivation::get_window(), GpuCkwResize::get_window(), GpuCkwPool2d::get_window(), GpuCkwDirectConv2d::get_window(), GpuCkwMatMul::get_window(), arm_compute::opencl::kernels::validate_and_configure_window_for_mmul_kernels(), GpuCkwDirectConv2d::write_component_code(), and GpuCkwMatMul::write_component_code().

◆ arm_matrix_multiply_supported()

bool arm_matrix_multiply_supported ( const cl::Device &  device)

Helper function to check whether the cl_arm_matrix_multiply extension is supported.

Parameters
[in]deviceA CL device
Returns
True if the extension is supported

Definition at line 499 of file CLHelpers.cpp.

500 {
501  return device_supports_extension(device, "cl_arm_matrix_multiply");
502 }

References device_supports_extension().

Referenced by ClMatMulLowpNativeMMULKernel::validate(), and ClMatMulNativeMMULKernel::validate().

◆ arm_non_uniform_workgroup_supported()

bool arm_non_uniform_workgroup_supported ( const cl::Device &  device)

Helper function to check whether the arm_non_uniform_work_group_size extension is supported.

Parameters
[in]deviceA CL device
Returns
True if the extension is supported

Definition at line 232 of file CLHelpers.cpp.

233 {
234  return device_supports_extension(device, "cl_arm_non_uniform_work_group_size");
235 }

References device_supports_extension().

◆ auto_init_if_empty() [1/2]

bool arm_compute::auto_init_if_empty ( ITensorInfo info,
const TensorShape shape,
int  num_channels,
DataType  data_type,
QuantizationInfo  quantization_info = QuantizationInfo() 
)
inline

Auto initialize the tensor info (shape, number of channels and data type) if the current assignment is empty.

Parameters
[in,out]infoTensor info used to check and assign.
[in]shapeNew shape.
[in]num_channelsNew number of channels.
[in]data_typeNew data type
[in]quantization_info(Optional) New quantization info
Returns
True if the tensor info has been initialized

Definition at line 43 of file AutoConfiguration.h.

48 {
49  if (info.tensor_shape().total_size() == 0)
50  {
51  info.set_data_type(data_type);
52  info.set_num_channels(num_channels);
53  info.set_tensor_shape(shape);
54  info.set_quantization_info(quantization_info);
55  return true;
56  }
57 
58  return false;
59 }

References arm_compute::test::validation::data_type, arm_compute::test::validation::info, and arm_compute::test::validation::shape.

Referenced by CpuDequantizeKernel::configure(), CpuTransposeKernel::configure(), ClTransposedConvolutionKernel::configure(), ClTransposeKernel::configure(), ClDequantizeKernel::configure(), ClFloorKernel::configure(), CpuPermuteKernel::configure(), CpuFloorKernel::configure(), ClCopyKernel::configure(), ClMatMulLowpNativeMMULKernel::configure(), ClPool2dKernel::configure(), ClPool3dKernel::configure(), CPPDetectionOutputLayer::configure(), ClPermuteKernel::configure(), ClActivationKernel::configure(), CpuConvertFullyConnectedWeightsKernel::configure(), ClMatMulNativeKernel::configure(), CpuSoftmaxKernel::configure(), CpuConcatenate::configure(), CLStridedSliceKernel::configure(), ClConvertFullyConnectedWeightsKernel::configure(), CpuActivationKernel::configure(), ClMatMulLowpNativeKernel::configure(), CpuGemmLowpMatrixAReductionKernel::configure(), NETileKernel::configure(), NEDepthToSpaceLayerKernel::configure(), ClConcatenate::configure(), NEChannelShuffleLayerKernel::configure(), NEReverseKernel::configure(), CpuDirectConv2dOutputStageKernel::configure(), CpuMaxUnpoolingLayerKernel::configure(), NEComputeAllAnchorsKernel::configure(), NEReorgLayerKernel::configure(), CPPTopKVKernel::configure(), NESpaceToDepthLayerKernel::configure(), CpuDirectConv2dKernel::configure(), CpuElementwiseUnaryKernel::configure(), CLInstanceNormalizationLayerKernel::configure(), ClGemmMatrixMultiplyNativeKernel::configure(), CLBitwiseKernel::configure(), CLMaxUnpoolingLayerKernel::configure(), ClWinogradFilterTransformKernel::configure(), ClWinogradInputTransformKernel::configure(), CpuPool3dKernel::configure(), NEQLSTMLayerNormalizationKernel::configure(), ClGemmLowpQuantizeDownInt32ScaleByFixedPointKernel::configure(), CPPPermuteKernel::configure(), ClGemmMatrixMultiplyReshapedOnlyRhsMMULKernel::configure(), ClIndirectConv2dAddressPrecalculationKernel::configure(), CLSelectKernel::configure(), CpuGemmInterleave4x4Kernel::configure(), NENormalizationLayerKernel::configure(), ClIndirectConv2dKernel::configure(), ClWinogradOutputTransformKernel::configure(), CLComputeAllAnchorsKernel::configure(), ClGemmLowpQuantizeDownInt32ScaleByFloatKernel::configure(), ClGemmLowpQuantizeDownInt32ScaleKernel::configure(), NEFlattenLayer::configure(), NEPadLayerKernel::configure(), NERangeKernel::configure(), CLFFTScaleKernel::configure(), CLSpaceToDepthLayerKernel::configure(), CLDepthToSpaceLayerKernel::configure(), NEBoundingBoxTransformKernel::configure(), CPPDetectionPostProcessLayer::configure(), NEFFTRadixStageKernel::configure(), NEROIPoolingLayerKernel::configure(), CLTileKernel::configure(), CPPNonMaximumSuppressionKernel::configure(), CpuGemmLowpQuantizeDownInt32ScaleKernel::configure(), NEReductionOperationKernel::configure(), NEStackLayerKernel::configure(), CpuDirectConv3dKernel::configure(), CLReorgLayerKernel::configure(), NEFuseBatchNormalizationKernel::configure(), NESelectKernel::configure(), ClGemmLowpOffsetContributionOutputStageKernel::configure(), CpuCol2ImKernel::configure(), CpuDepthwiseConv2dNativeKernel::configure(), CLMeanStdDevNormalizationKernel::configure(), CpuGemmLowpQuantizeDownInt32ToInt16ScaleByFixedPointKernel::configure(), CpuDepthwiseConv2dAssemblyWrapperKernel::configure(), CpuPool2dAssemblyWrapperKernel::configure(), NEROIAlignLayerKernel::configure(), CLNormalizePlanarYUVLayerKernel::configure(), CpuGemmMatrixMultiplyKernel::configure(), NEGatherKernel::configure(), CLReductionOperationKernel::configure(), CLReverseKernel::configure(), NEBatchToSpaceLayerKernel::configure(), CpuGemmLowpQuantizeDownInt32ToInt8ScaleByFixedPointKernel::configure(), CpuGemmLowpQuantizeDownInt32ToUint8ScaleByFixedPointKernel::configure(), NEReduceMean::configure(), ClDirectConv2dKernel::configure(), NEBatchNormalizationLayerKernel::configure(), NESpaceToBatchLayerKernel::configure(), CLL2NormalizeLayerKernel::configure(), CLPadLayerKernel::configure(), CpuWeightsReshapeKernel::configure(), ClMatMulNativeMMULKernel::configure(), CLArgMinMaxLayerKernel::configure(), CLFlattenLayer::configure(), ClMulKernel::configure(), CLReduceMean::configure(), CLBoundingBoxTransformKernel::configure(), CLDepthwiseConvolutionLayerNativeKernel::configure(), ClGemmMatrixMultiplyReshapedOnlyRhsKernel::configure(), ClWeightsReshapeKernel::configure(), CLROIPoolingLayerKernel::configure(), NEReductionOperation::configure(), CLROIAlignLayerKernel::configure(), CpuGemmTranspose1xWKernel::configure(), ClGemmLowpMatrixAReductionKernel::configure(), CpuIm2ColKernel::configure(), NEPadLayer::configure(), ClGemmMatrixMultiplyReshapedKernel::configure(), CpuGemmLowpOffsetContributionOutputStageKernel::configure(), CLFuseBatchNormalizationKernel::configure(), CLBatchNormalizationLayerKernel::configure(), CLArgMinMaxLayer::configure(), CLReductionOperation::configure(), CLBatchToSpaceLayerKernel::configure(), NEFFTConvolutionLayer::configure(), CLSpaceToBatchLayerKernel::configure(), NEGenerateProposalsLayer::configure(), NELSTMLayerQuantized::configure(), CLCropResize::configure(), CLComputeMeanVariance::configure(), ClComplexMulKernel::configure(), ClGemmLowpMatrixBReductionKernel::configure(), NEDeconvolutionLayer::configure(), CpuGemmLowpMatrixBReductionKernel::configure(), CLFFTConvolutionLayer::configure(), CLGenerateProposalsLayer::configure(), CLDirectDeconvolutionLayer::configure(), CLLSTMLayerQuantized::configure(), CpuComplexMulKernel::configure(), GpuOutput::create_op(), GpuSigmoid::create_op(), GpuTanh::create_op(), GpuClamp::create_op(), GpuSoftmax::create_op(), GpuReshape::create_op(), GpuCast::create_op(), GpuOutput::is_supported_op(), GpuSoftmax::is_supported_op(), CpuMatMul::validate(), ClGemmLowpMatrixMultiplyCore::validate(), CpuGemm::validate(), ClGemmConv2d::validate(), CpuGemmLowpMatrixMultiplyCore::validate(), GpuOutput::validate_op(), GpuTanh::validate_op(), GpuSigmoid::validate_op(), GpuReshape::validate_op(), GpuCast::validate_op(), GpuClamp::validate_op(), and GpuSoftmax::validate_op().

◆ auto_init_if_empty() [2/2]

bool arm_compute::auto_init_if_empty ( ITensorInfo info_sink,
const ITensorInfo info_source 
)
inline

Auto initialize the tensor info using another tensor info.

(COMPMID-6012) This method should remain in sync with the fields of ITensorInfo that have setters.

Parameters
info_sinkTensor info used to check and assign
info_sourceTensor info used to assign
Returns
True if the tensor info has been initialized

Definition at line 72 of file AutoConfiguration.h.

73 {
74  if (info_sink.tensor_shape().total_size() == 0)
75  {
76  info_sink.set_data_type(info_source.data_type());
77  info_sink.set_num_channels(info_source.num_channels());
78  info_sink.set_tensor_shape(info_source.tensor_shape());
79  info_sink.set_quantization_info(info_source.quantization_info());
80  info_sink.set_data_layout(info_source.data_layout());
81  info_sink.set_are_values_constant(info_source.are_values_constant());
82  return true;
83  }
84 
85  return false;
86 }

References ITensorInfo::are_values_constant(), ITensorInfo::data_layout(), ITensorInfo::data_type(), ITensorInfo::num_channels(), ITensorInfo::quantization_info(), ITensorInfo::set_are_values_constant(), ITensorInfo::set_data_layout(), ITensorInfo::set_data_type(), ITensorInfo::set_num_channels(), ITensorInfo::set_quantization_info(), ITensorInfo::set_tensor_shape(), ITensorInfo::tensor_shape(), and TensorShape::total_size().

◆ block_by()

int arm_compute::block_by ( const WeightFormat  wf)
inline

Definition at line 1656 of file Types.h.

1657 {
1658  return (static_cast<int>(wf) >> 20) & 0xF;
1659 }

Referenced by CpuGemmConv2d::configure(), CpuGemm::validate(), and CpuGemmConv2d::validate().

◆ build_information()

std::string arm_compute::build_information ( )

Returns the arm_compute library build information.

Contains the version number and the build options used to build the library

Returns
The arm_compute library build information

Referenced by main().

◆ calculate_max_enlarged_window()

Window arm_compute::calculate_max_enlarged_window ( const ValidRegion valid_region,
const Steps steps,
BorderSize  border_size 
)

Definition at line 147 of file WindowHelpers.cpp.

148 {
149  const Coordinates &anchor = valid_region.anchor;
150  const TensorShape &shape = valid_region.shape;
151 
152  Window window;
153 
154  window.set(0, Window::Dimension(
155  // move the anchor to the start from the border
156  anchor[0] - border_size.left,
157  // move the anchor to include the right end border
158  // Make sure the window width is a multiple of the step size
159  anchor[0] - border_size.left +
160  ceil_to_multiple(shape[0] + border_size.left + border_size.right, steps[0]),
161  steps[0]));
162 
163  size_t n = 1;
164 
165  if (anchor.num_dimensions() > 1)
166  {
167  window.set(1, Window::Dimension(
168  // Include the border above the image
169  anchor[1] - border_size.top,
170  // Include the border below the image
171  anchor[1] - border_size.top +
172  ceil_to_multiple(shape[1] + border_size.top + border_size.bottom, steps[1]),
173  steps[1]));
174 
175  ++n;
176  }
177 
178  if (anchor.num_dimensions() > 2)
179  {
180  window.set(2, Window::Dimension(0, std::max<size_t>(1, shape[n]), steps[2]));
181 
182  ++n;
183  }
184 
185  for (; n < anchor.num_dimensions(); ++n)
186  {
187  window.set(n, Window::Dimension(anchor[n], std::max<size_t>(1, shape[n])));
188  }
189 
190  for (; n < Coordinates::num_max_dimensions; ++n)
191  {
192  window.set(n, Window::Dimension(0, 1));
193  }
194 
195  return window;
196 }

References ValidRegion::anchor, BorderSize::bottom, ceil_to_multiple(), BorderSize::left, Dimensions< T >::num_dimensions(), Dimensions< int >::num_max_dimensions, BorderSize::right, Window::set(), arm_compute::test::validation::shape, ValidRegion::shape, BorderSize::top, and arm_compute::test::validation::valid_region.

◆ calculate_max_window() [1/2]

Window arm_compute::calculate_max_window ( const TensorShape shape,
const Steps steps,
bool  skip_border,
BorderSize  border_size 
)

Definition at line 90 of file WindowHelpers.cpp.

91 {
92  if (!skip_border)
93  {
94  border_size = BorderSize(0);
95  }
96 
97  Window window;
98 
99  window.set(0, Window::Dimension(
100  // Skip the border left of the image
101  border_size.left,
102  // Skip the border right of the image
103  // Make sure the window width is a multiple of the step size
104  border_size.left +
105  ceil_to_multiple(std::max(0, static_cast<int>(shape[0]) - static_cast<int>(border_size.left) -
106  static_cast<int>(border_size.right)),
107  steps[0]),
108  steps[0]));
109 
110  size_t n = 1;
111 
112  if (shape.num_dimensions() > 1)
113  {
114  window.set(1, Window::Dimension(
115  // Skip the border above the image
116  border_size.top,
117  // Skip the border below the image
118  border_size.top + ceil_to_multiple(std::max(0, static_cast<int>(shape[1]) -
119  static_cast<int>(border_size.top) -
120  static_cast<int>(border_size.bottom)),
121  steps[1]),
122  steps[1]));
123 
124  ++n;
125  }
126 
127  if (shape.num_dimensions() > 2)
128  {
129  window.set(2, Window::Dimension(0, std::max<size_t>(1, shape[2]), steps[2]));
130 
131  ++n;
132  }
133 
134  for (; n < shape.num_dimensions(); ++n)
135  {
136  window.set(n, Window::Dimension(0, std::max<size_t>(1, shape[n])));
137  }
138 
139  for (; n < Coordinates::num_max_dimensions; ++n)
140  {
141  window.set(n, Window::Dimension(0, 1));
142  }
143 
144  return window;
145 }

References BorderSize::bottom, ceil_to_multiple(), BorderSize::left, Dimensions< int >::num_max_dimensions, BorderSize::right, Window::set(), arm_compute::test::validation::shape, and BorderSize::top.

◆ calculate_max_window() [2/2]

Window arm_compute::calculate_max_window ( const ValidRegion valid_region,
const Steps steps,
bool  skip_border,
BorderSize  border_size 
)

Definition at line 29 of file WindowHelpers.cpp.

30 {
31  if (!skip_border)
32  {
33  border_size = BorderSize(0);
34  }
35 
36  const Coordinates &anchor = valid_region.anchor;
37  const TensorShape &shape = valid_region.shape;
38 
39  Window window;
40 
41  window.set(0, Window::Dimension(
42  // Skip the border left of the image
43  anchor[0] + border_size.left,
44  // Skip the border right of the image
45  // Make sure the window width is a multiple of the step size
46  anchor[0] + border_size.left +
47  ceil_to_multiple(std::max(0, static_cast<int>(shape[0]) - static_cast<int>(border_size.left) -
48  static_cast<int>(border_size.right)),
49  steps[0]),
50  steps[0]));
51 
52  size_t n = 1;
53 
54  if (anchor.num_dimensions() > 1)
55  {
56  window.set(1,
57  Window::Dimension(
58  // Skip the border above the image
59  anchor[1] + border_size.top,
60  // Skip the border below the image
61  anchor[1] + border_size.top +
62  ceil_to_multiple(std::max(0, static_cast<int>(shape[1]) - static_cast<int>(border_size.top) -
63  static_cast<int>(border_size.bottom)),
64  steps[1]),
65  steps[1]));
66 
67  ++n;
68  }
69 
70  if (anchor.num_dimensions() > 2)
71  {
72  window.set(2, Window::Dimension(anchor[2], std::max<size_t>(1, shape[2]), steps[2]));
73 
74  ++n;
75  }
76 
77  for (; n < anchor.num_dimensions(); ++n)
78  {
79  window.set(n, Window::Dimension(anchor[n], std::max<size_t>(1, shape[n])));
80  }
81 
82  for (; n < Coordinates::num_max_dimensions; ++n)
83  {
84  window.set(n, Window::Dimension(0, 1));
85  }
86 
87  return window;
88 }

References ValidRegion::anchor, BorderSize::bottom, ceil_to_multiple(), BorderSize::left, Dimensions< T >::num_dimensions(), Dimensions< int >::num_max_dimensions, BorderSize::right, Window::set(), arm_compute::test::validation::shape, ValidRegion::shape, BorderSize::top, and arm_compute::test::validation::valid_region.

Referenced by CpuDequantizeKernel::configure(), CpuReshapeKernel::configure(), CpuTransposeKernel::configure(), ClTransposedConvolutionKernel::configure(), CpuFillKernel::configure(), ClReshapeKernel::configure(), ClTransposeKernel::configure(), ClDequantizeKernel::configure(), ClFloorKernel::configure(), CpuConcatenateBatchKernel::configure(), CpuFloorKernel::configure(), CpuPermuteKernel::configure(), ClCopyKernel::configure(), ClFillKernel::configure(), ClElementWiseUnaryKernel::configure(), CpuConcatenateWidthKernel::configure(), NELogicalKernel::configure(), CpuConcatenateHeightKernel::configure(), ClWidthConcatenate2TensorsKernel::configure(), ClPool2dKernel::configure(), ClPool3dKernel::configure(), ClHeightConcatenateKernel::configure(), ClQuantizeKernel::configure(), ClScaleKernel::configure(), ClWidthConcatenateKernel::configure(), ClPermuteKernel::configure(), ClWidthConcatenate4TensorsKernel::configure(), ClActivationKernel::configure(), ClMatMulNativeKernel::configure(), CpuConvertFullyConnectedWeightsKernel::configure(), ClCropKernel::configure(), CLStridedSliceKernel::configure(), CpuSoftmaxKernel::configure(), ClBatchConcatenateKernel::configure(), ClDepthConcatenateKernel::configure(), CpuConcatenateDepthKernel::configure(), ClMatMulLowpNativeKernel::configure(), CpuPool2dKernel::configure(), ClConvertFullyConnectedWeightsKernel::configure(), CpuGemmLowpMatrixAReductionKernel::configure(), ICLSimpleKernel::configure(), NETileKernel::configure(), NEChannelShuffleLayerKernel::configure(), CpuDirectConv2dOutputStageKernel::configure(), NEDepthToSpaceLayerKernel::configure(), NEPriorBoxLayerKernel::configure(), NEReverseKernel::configure(), CpuGemmLowpMatrixMultiplyKernel::configure(), CpuMaxUnpoolingLayerKernel::configure(), NEComputeAllAnchorsKernel::configure(), NEReorgLayerKernel::configure(), NESpaceToDepthLayerKernel::configure(), CPPUpsampleKernel::configure(), NEBitwiseNotKernel::configure(), CLBitwiseKernel::configure(), CLInstanceNormalizationLayerKernel::configure(), CLMaxUnpoolingLayerKernel::configure(), CPPPermuteKernel::configure(), ClGemmLowpQuantizeDownInt32ScaleByFixedPointKernel::configure(), ClIndirectConv2dAddressPrecalculationKernel::configure(), NEBatchToSpaceLayerKernel::configure(), NEBitwiseAndKernel::configure(), NEBitwiseOrKernel::configure(), NEBitwiseXorKernel::configure(), CpuPool3dKernel::configure(), NESpaceToBatchLayerKernel::configure(), ClIndirectConv2dKernel::configure(), CpuGemmInterleave4x4Kernel::configure(), CLSelectKernel::configure(), NENormalizationLayerKernel::configure(), ClGemmLowpQuantizeDownInt32ScaleByFloatKernel::configure(), ClGemmLowpQuantizeDownInt32ScaleKernel::configure(), CLComputeAllAnchorsKernel::configure(), CLDeconvolutionLayerUpsampleKernel::configure(), CLDepthToSpaceLayerKernel::configure(), CLFFTScaleKernel::configure(), CpuGemmMatrixAdditionKernel::configure(), NEPadLayerKernel::configure(), NERangeKernel::configure(), ClSoftmaxKernel::configure(), CLSpaceToDepthLayerKernel::configure(), CPPBoxWithNonMaximaSuppressionLimitKernel::configure(), CPPNonMaximumSuppressionKernel::configure(), NEBoundingBoxTransformKernel::configure(), CLSpaceToBatchLayerKernel::configure(), CLTileKernel::configure(), CpuAddMulAddKernel::configure(), CpuDirectConv3dKernel::configure(), CpuGemmLowpQuantizeDownInt32ScaleKernel::configure(), NEReductionOperationKernel::configure(), ClCastKernel::configure(), NESelectKernel::configure(), CLMeanStdDevNormalizationKernel::configure(), ClGemmLowpOffsetContributionOutputStageKernel::configure(), CpuDepthwiseConv2dNativeKernel::configure(), CpuCol2ImKernel::configure(), CLBatchToSpaceLayerKernel::configure(), CLReorgLayerKernel::configure(), NEFuseBatchNormalizationKernel::configure(), ClGemmLowpOffsetContributionKernel::configure(), CpuCastKernel::configure(), CpuGemmLowpOffsetContributionKernel::configure(), CpuGemmLowpQuantizeDownInt32ToInt16ScaleByFixedPointKernel::configure(), CLNormalizePlanarYUVLayerKernel::configure(), CpuDepthwiseConv2dAssemblyWrapperKernel::configure(), CpuPool2dAssemblyWrapperKernel::configure(), CLRangeKernel::configure(), NEGatherKernel::configure(), CLReductionOperationKernel::configure(), CpuGemmMatrixMultiplyKernel::configure(), CLReverseKernel::configure(), CpuScaleKernel::configure(), CpuGemmLowpQuantizeDownInt32ToUint8ScaleByFixedPointKernel::configure(), CpuGemmLowpQuantizeDownInt32ToInt8ScaleByFixedPointKernel::configure(), ClDirectConv2dKernel::configure(), NEBatchNormalizationLayerKernel::configure(), ClDirectConv3dKernel::configure(), CLL2NormalizeLayerKernel::configure(), CpuWeightsReshapeKernel::configure(), CLPadLayerKernel::configure(), ClMulKernel::configure(), CLArgMinMaxLayerKernel::configure(), CLBoundingBoxTransformKernel::configure(), CLDepthwiseConvolutionLayerNativeKernel::configure(), ClWeightsReshapeKernel::configure(), CLROIPoolingLayerKernel::configure(), ClGemmLowpMatrixAReductionKernel::configure(), CpuGemmTranspose1xWKernel::configure(), CLROIAlignLayerKernel::configure(), CpuIm2ColKernel::configure(), CpuGemmLowpOffsetContributionOutputStageKernel::configure(), CLFuseBatchNormalizationKernel::configure(), CLBatchNormalizationLayerKernel::configure(), CLCropResize::configure(), CLComputeMeanVariance::configure(), ClComplexMulKernel::configure(), ClGemmLowpMatrixBReductionKernel::configure(), CpuComplexMulKernel::configure(), NECropKernel::configure_output_shape(), arm_compute::cpu::kernels::convolve_nchw(), arm_compute::cpu::kernels::convolve_nhwc(), arm_compute::cpu::directconv3d_float_neon_ndhwc(), arm_compute::cpu::directconv3d_quantized_neon_ndhwc(), GpuCkwElementwiseBinary::get_window(), GpuCkwActivation::get_window(), GpuCkwCast::get_window(), GpuCkwResize::get_window(), GpuCkwPool2d::get_window(), GpuCkwDepthwiseConv2d::get_window(), GpuCkwDirectConv2d::get_window(), GpuCkwMatMul::get_window(), CpuReshapeKernel::prepare(), NEStackLayerKernel::prepare(), arm_compute::cpu::kernels::validate_and_configure_window(), and arm_compute::opencl::kernels::validate_and_configure_window_for_mmul_kernels().

◆ calculate_max_window_horizontal()

Window arm_compute::calculate_max_window_horizontal ( const ValidRegion valid_region,
const Steps steps,
bool  skip_border,
BorderSize  border_size 
)

Definition at line 198 of file WindowHelpers.cpp.

202 {
203  if (skip_border)
204  {
205  border_size.top = 0;
206  border_size.bottom = 0;
207  }
208  else
209  {
210  border_size.left = 0;
211  border_size.right = 0;
212  }
213 
214  const Coordinates &anchor = valid_region.anchor;
215  const TensorShape &shape = valid_region.shape;
216 
217  Window window;
218 
219  window.set(0, Window::Dimension(
220  // Skip the border left of the image
221  anchor[0] + border_size.left,
222  // Skip the border right of the image
223  // Make sure the window width is a multiple of the step size
224  anchor[0] + border_size.left +
225  ceil_to_multiple(std::max(0, static_cast<int>(shape[0]) - static_cast<int>(border_size.left) -
226  static_cast<int>(border_size.right)),
227  steps[0]),
228  steps[0]));
229 
230  size_t n = 1;
231 
232  if (anchor.num_dimensions() > 1)
233  {
234  window.set(1, Window::Dimension(
235  // Skip the border above the image
236  anchor[1] - border_size.top,
237  // Skip the border below the image
238  anchor[1] + shape[1] + border_size.bottom, 1));
239 
240  ++n;
241  }
242 
243  for (; n < anchor.num_dimensions(); ++n)
244  {
245  window.set(n, Window::Dimension(anchor[n], std::max<size_t>(1, shape[n])));
246  }
247 
248  for (; n < Coordinates::num_max_dimensions; ++n)
249  {
250  window.set(n, Window::Dimension(0, 1));
251  }
252 
253  return window;
254 }

References ValidRegion::anchor, BorderSize::bottom, ceil_to_multiple(), BorderSize::left, Dimensions< T >::num_dimensions(), Dimensions< int >::num_max_dimensions, BorderSize::right, Window::set(), arm_compute::test::validation::shape, ValidRegion::shape, BorderSize::top, and arm_compute::test::validation::valid_region.

Referenced by CpuGemmLowpMatrixBReductionKernel::configure().

◆ calculate_same_pad()

PadStrideInfo calculate_same_pad ( TensorShape  input_shape,
TensorShape  weights_shape,
PadStrideInfo  conv_info,
DataLayout  data_layout = DataLayout::NCHW,
const Size2D dilation = Size2D(1u, 1u),
const DimensionRoundingType rounding_type = DimensionRoundingType::FLOOR 
)

Calculate padding requirements in case of SAME padding.

Parameters
[in]input_shapeInput shape
[in]weights_shapeWeights shape
[in]conv_infoConvolution information (containing strides)
[in]data_layout(Optional) Data layout of the input and weights tensor
[in]dilation(Optional) Dilation factor used in the convolution.
[in]rounding_type(Optional) Dimension rounding type when down-scaling.
Returns
PadStrideInfo for SAME padding

Definition at line 218 of file Utils.cpp.

224 {
225  const auto &strides = conv_info.stride();
226  ARM_COMPUTE_ERROR_ON_MSG((strides.first < 1 || strides.second < 1),
227  "Stride values should be greater than or equal to 1.");
228 
229  const unsigned int width_idx = get_data_layout_dimension_index(data_layout, DataLayoutDimension::WIDTH);
230  const unsigned int height_idx = get_data_layout_dimension_index(data_layout, DataLayoutDimension::HEIGHT);
231  const unsigned int in_width = input_shape[width_idx];
232  const unsigned int in_height = input_shape[height_idx];
233  const unsigned int kernel_width = weights_shape[width_idx];
234  const unsigned int kernel_height = weights_shape[height_idx];
235 
236  // Calculate output dimensions
237  const auto is_ceil = static_cast<unsigned int>(rounding_type == DimensionRoundingType::CEIL);
238  const unsigned int out_width = ((in_width - is_ceil) + strides.first - 1) / strides.first + is_ceil;
239  const unsigned int out_height = ((in_height - is_ceil) + strides.second - 1) / strides.second + is_ceil;
240 
241  // Calculate effective weights sizes
242  const int real_weight_width = (kernel_width - 1) * dilation.x() + 1;
243  const int real_weight_height = (kernel_height - 1) * dilation.y() + 1;
244 
245  // Calculate total pad
246  const int pad_width = std::max(0, static_cast<int>((out_width - 1) * strides.first + real_weight_width - in_width));
247  const int pad_height =
248  std::max(0, static_cast<int>((out_height - 1) * strides.second + real_weight_height - in_height));
249 
250  // Calculate individual paddings
251  const unsigned int pad_left = pad_width / 2;
252  const unsigned int pad_top = pad_height / 2;
253  const unsigned int pad_right = pad_width - pad_left;
254  const unsigned int pad_bottom = pad_height - pad_top;
255 
256  PadStrideInfo same_info(strides.first, strides.second, pad_left, pad_right, pad_top, pad_bottom, rounding_type);
257 
258  // Check for correctness of predicted output shape against the one calculated using the generated info
259  const auto out_dims = scaled_dimensions(in_width, in_height, kernel_width, kernel_height, same_info, dilation);
260  ARM_COMPUTE_ERROR_ON(out_dims.first != out_width || out_dims.second != out_height);
261  ARM_COMPUTE_UNUSED(out_dims);
262 
263  return same_info;
264 }

References ARM_COMPUTE_ERROR_ON, ARM_COMPUTE_ERROR_ON_MSG, ARM_COMPUTE_UNUSED, CEIL, arm_compute::test::validation::conv_info, arm_compute::cpu::data_layout, get_data_layout_dimension_index(), HEIGHT, arm_compute::cpu::height_idx, arm_compute::test::validation::input_shape, scaled_dimensions(), WIDTH, arm_compute::cpu::width_idx, Size2D::x(), and Size2D::y().

Referenced by arm_compute::utils::calculate_convolution_padding().

◆ calculate_squashed_or_max_window() [1/2]

std::pair<Window, size_t> arm_compute::calculate_squashed_or_max_window ( const ITensorInfo src)

Definition at line 307 of file WindowHelpers.cpp.

308 {
309  const auto &shape = src.tensor_shape();
310  const auto &strides = src.strides_in_bytes();
311  const auto num_dimensions = src.num_dimensions();
312 
313  Window win;
314  size_t split_dimension = Window::DimY;
315  size_t dim = 0;
316  size_t squashed_bytes = src.element_size();
317 
318  // Try to squash the low dimensions together.
319  for (; dim < num_dimensions; ++dim)
320  {
321  if (strides[dim] != squashed_bytes)
322  {
323  break;
324  }
325  squashed_bytes *= shape[dim];
326  }
327  if (dim == num_dimensions)
328  {
329  const auto squashed_elements = squashed_bytes / src.element_size();
330  split_dimension = Window::DimX;
331  // The input tensor can be interpreted as 1D array.
332  win.set(0, Window::Dimension(0, squashed_elements, 1));
333  for (dim = 1; dim < Coordinates::num_max_dimensions; ++dim)
334  {
335  win.set(dim, Window::Dimension(0, 1, 1));
336  }
337  }
338  else
339  {
340  // Generate the max window.
341  for (dim = 0; dim < Coordinates::num_max_dimensions; ++dim)
342  {
343  win.set(dim, Window::Dimension(0, shape[dim], 1));
344  }
345  }
346  return std::make_pair(win, split_dimension);
347 }

References Window::DimX, Window::DimY, Dimensions< int >::num_max_dimensions, Window::set(), arm_compute::test::validation::shape, and arm_compute::test::validation::src.

◆ calculate_squashed_or_max_window() [2/2]

std::pair<Window, size_t> arm_compute::calculate_squashed_or_max_window ( const ITensorInfo src0,
const ITensorInfo src1 
)

Definition at line 256 of file WindowHelpers.cpp.

257 {
258  const auto &shape0 = src0.tensor_shape();
259  const auto &shape1 = src1.tensor_shape();
260  const auto &strides0 = src0.strides_in_bytes();
261  const auto &strides1 = src1.strides_in_bytes();
262  const auto num_dimensions = std::max(src0.num_dimensions(), src1.num_dimensions());
263 
264  Window win;
265  size_t split_dimension = Window::DimY;
266  size_t dim = 0;
267 
268  size_t squashed_bytes = src0.element_size();
269 
270  // Try to squash the low dimensions together.
271  for (; dim < num_dimensions; ++dim)
272  {
273  if (shape0[dim] != shape1[dim] || strides0[dim] != squashed_bytes || strides1[dim] != squashed_bytes)
274  {
275  break;
276  }
277 
278  squashed_bytes *= shape0[dim];
279  }
280 
281  if (dim == num_dimensions)
282  {
283  auto squashed_elements = squashed_bytes / src0.element_size();
284 
285  split_dimension = Window::DimX;
286 
287  // The input tensors can be interpreted as 1D array.
288  win.set(0, Window::Dimension(0, squashed_elements, 1));
289 
290  for (dim = 1; dim < Coordinates::num_max_dimensions; ++dim)
291  {
292  win.set(dim, Window::Dimension(0, 1, 1));
293  }
294  }
295  else
296  {
297  // Generates the max window.
298  for (dim = 0; dim < Coordinates::num_max_dimensions; ++dim)
299  {
300  win.set(dim, Window::Dimension(0, std::max(shape0[dim], shape1[dim]), 1));
301  }
302  }
303 
304  return std::make_pair(win, split_dimension);
305 }

References Window::DimX, Window::DimY, ITensorInfo::element_size(), ITensorInfo::num_dimensions(), Dimensions< int >::num_max_dimensions, Window::set(), ITensorInfo::strides_in_bytes(), and ITensorInfo::tensor_shape().

Referenced by CpuQuantizeKernel::configure(), CpuActivationKernel::configure(), CpuSubKernel::configure(), CpuAddKernel::configure(), CpuMulKernel::configure(), and CpuReshapeKernel::prepare().

◆ calculate_subsampled_shape()

TensorShape arm_compute::calculate_subsampled_shape ( const TensorShape shape,
Format  format,
Channel  channel = Channel::UNKNOWN 
)
inline

Calculate subsampled shape for a given format and channel.

Parameters
[in]shapeShape of the tensor to calculate the extracted channel.
[in]formatFormat of the tensor.
[in]channelChannel to create tensor shape to be extracted.
Returns
The subsampled tensor shape.

Definition at line 400 of file Validate.h.

401 {
402  TensorShape output{shape};
403 
404  // Subsample shape only for U or V channel
405  if (Channel::U == channel || Channel::V == channel || Channel::UNKNOWN == channel)
406  {
407  // Subsample width for the tensor shape when channel is U or V
409  {
410  output.set(0, output.x() / 2U);
411  }
412 
413  // Subsample height for the tensor shape when channel is U or V
415  {
416  output.set(1, output.y() / 2U);
417  }
418  }
419 
420  return output;
421 }

References update_supported_ops::format, has_format_horizontal_subsampling(), has_format_vertical_subsampling(), arm_compute::test::validation::shape, U, arm_compute::utils::cast::U, UNKNOWN, and V.

Referenced by error_on_tensors_not_subsampled().

◆ calculate_valid_region_scale()

ValidRegion calculate_valid_region_scale ( const ITensorInfo src_info,
const TensorShape dst_shape,
InterpolationPolicy  interpolate_policy,
SamplingPolicy  sampling_policy,
bool  border_undefined 
)

Helper function to calculate the Valid Region for Scale.

Parameters
[in]src_infoInput tensor info used to check.
[in]dst_shapeShape of the output.
[in]interpolate_policyInterpolation policy.
[in]sampling_policySampling policy.
[in]border_undefinedTrue if the border is undefined.
Returns
The corresponding valid region

Definition at line 28 of file Helpers.cpp.

33 {
35  const int idx_width = get_data_layout_dimension_index(data_layout, DataLayoutDimension::WIDTH);
36  const int idx_height = get_data_layout_dimension_index(data_layout, DataLayoutDimension::HEIGHT);
37 
38  const float scale_x = static_cast<float>(dst_shape[idx_width]) / src_info.tensor_shape()[idx_width];
39  const float scale_y = static_cast<float>(dst_shape[idx_height]) / src_info.tensor_shape()[idx_height];
40  const float sampling_point = (sampling_policy == SamplingPolicy::CENTER) ? 0.5f : 0.0f;
41 
42  // Get input's valid region start and end points
43  const int valid_start_in_x = src_info.valid_region().anchor[idx_width];
44  const int valid_start_in_y = src_info.valid_region().anchor[idx_height];
45  const int valid_end_in_x = src_info.valid_region().anchor[idx_width] + src_info.valid_region().shape[idx_width];
46  const int valid_end_in_y = src_info.valid_region().anchor[idx_height] + src_info.valid_region().shape[idx_height];
47 
48  // Initialize output's valid region start and end points
49  auto valid_start_out_x = static_cast<int>(valid_start_in_x * scale_x);
50  auto valid_start_out_y = static_cast<int>(valid_start_in_y * scale_y);
51  auto valid_end_out_x = std::min<int>(std::ceil(valid_end_in_x * scale_x), dst_shape[idx_width]);
52  auto valid_end_out_y = std::min<int>(std::ceil(valid_end_in_y * scale_y), dst_shape[idx_height]);
53 
54  // Handle valid points in case of the bi-linear interpolation
55  if (border_undefined)
56  {
57  switch (interpolate_policy)
58  {
59  case InterpolationPolicy::NEAREST_NEIGHBOR:
60  {
61  // (start_out + sampling_point) >= (start_in * scale)
62  // start_out = ceil((start_in * scale) - sampling_point)
63  valid_start_out_x = std::ceil(valid_start_in_x * scale_x - sampling_point);
64  valid_start_out_y = std::ceil(valid_start_in_y * scale_y - sampling_point);
65 
66  // (end_out - 1 + sampling_point) < (end_in * scale)
67  // end_out = ceil((end_in * scale) - sampling_point); // <-- ceil(x - 1) strictly less
68  valid_end_out_x = std::ceil(valid_end_in_x * scale_x - sampling_point);
69  valid_end_out_y = std::ceil(valid_end_in_y * scale_y - sampling_point);
70  break;
71  }
72  case InterpolationPolicy::BILINEAR:
73  {
74  // (start_out + sampling_point) >= ((start_in + sampling_point) * scale)
75  // start_out = ceil(((start_in + sampling_point) * scale) - sampling_point)
76  valid_start_out_x = std::ceil((valid_start_in_x + sampling_point) * scale_x - sampling_point);
77  valid_start_out_y = std::ceil((valid_start_in_y + sampling_point) * scale_y - sampling_point);
78 
79  // (end_out - 1 + sampling_point) <= ((end_in - 1 + sampling_point) * scale)
80  // end_out = floor(((end_in - 1 + sampling_point) * scale) - sampling_point + 1)
81  valid_end_out_x = std::floor((valid_end_in_x - 1.f + sampling_point) * scale_x - sampling_point + 1.f);
82  valid_end_out_y = std::floor((valid_end_in_y - 1.f + sampling_point) * scale_y - sampling_point + 1.f);
83  break;
84  }
85  case InterpolationPolicy::AREA:
86  break;
87  default:
88  {
89  ARM_COMPUTE_ERROR("Invalid InterpolationPolicy");
90  break;
91  }
92  }
93  }
94 
95  // Setup output valid region
96  ValidRegion valid_region{Coordinates(), dst_shape, dst_shape.num_dimensions()};
97 
98  valid_region.anchor.set(idx_width, std::max(0, valid_start_out_x));
99  valid_region.anchor.set(idx_height, std::max(0, valid_start_out_y));
100 
101  valid_region.shape.set(idx_width, std::min<size_t>(valid_end_out_x - valid_start_out_x, dst_shape[idx_width]));
102  valid_region.shape.set(idx_height, std::min<size_t>(valid_end_out_y - valid_start_out_y, dst_shape[idx_height]));
103 
104  return valid_region;
105 }

References ValidRegion::anchor, AREA, ARM_COMPUTE_ERROR, BILINEAR, CENTER, arm_compute::cpu::data_layout, TensorInfo::data_layout(), arm_compute::test::validation::dst_shape, get_data_layout_dimension_index(), HEIGHT, arm_compute::test::validation::idx_height, arm_compute::test::validation::idx_width, NEAREST_NEIGHBOR, Dimensions< T >::num_dimensions(), arm_compute::test::validation::sampling_policy, arm_compute::test::validation::scale_x, arm_compute::test::validation::scale_y, Dimensions< T >::set(), TensorShape::set(), ValidRegion::shape, arm_compute::test::validation::src_info, TensorInfo::tensor_shape(), arm_compute::test::validation::valid_region, TensorInfo::valid_region(), and WIDTH.

Referenced by arm_compute::test::validation::FIXTURE_DATA_TEST_CASE().

◆ ceil_to_multiple()

◆ channel_idx_from_format()

int arm_compute::channel_idx_from_format ( Format  format,
Channel  channel 
)
inline

Return the channel index of a given channel given an input format.

Parameters
[in]formatInput format
[in]channelInput channel
Returns
The channel index of the specific channel of the specific format

Definition at line 143 of file FormatUtils.h.

144 {
145  switch (format)
146  {
147  case Format::RGB888:
148  {
149  switch (channel)
150  {
151  case Channel::R:
152  return 0;
153  case Channel::G:
154  return 1;
155  case Channel::B:
156  return 2;
157  default:
158  ARM_COMPUTE_ERROR("Not supported channel");
159  return 0;
160  }
161  }
162  case Format::RGBA8888:
163  {
164  switch (channel)
165  {
166  case Channel::R:
167  return 0;
168  case Channel::G:
169  return 1;
170  case Channel::B:
171  return 2;
172  case Channel::A:
173  return 3;
174  default:
175  ARM_COMPUTE_ERROR("Not supported channel");
176  return 0;
177  }
178  }
179  case Format::YUYV422:
180  {
181  switch (channel)
182  {
183  case Channel::Y:
184  return 0;
185  case Channel::U:
186  return 1;
187  case Channel::V:
188  return 3;
189  default:
190  ARM_COMPUTE_ERROR("Not supported channel");
191  return 0;
192  }
193  }
194  case Format::UYVY422:
195  {
196  switch (channel)
197  {
198  case Channel::Y:
199  return 1;
200  case Channel::U:
201  return 0;
202  case Channel::V:
203  return 2;
204  default:
205  ARM_COMPUTE_ERROR("Not supported channel");
206  return 0;
207  }
208  }
209  case Format::NV12:
210  {
211  switch (channel)
212  {
213  case Channel::Y:
214  return 0;
215  case Channel::U:
216  return 0;
217  case Channel::V:
218  return 1;
219  default:
220  ARM_COMPUTE_ERROR("Not supported channel");
221  return 0;
222  }
223  }
224  case Format::NV21:
225  {
226  switch (channel)
227  {
228  case Channel::Y:
229  return 0;
230  case Channel::U:
231  return 1;
232  case Channel::V:
233  return 0;
234  default:
235  ARM_COMPUTE_ERROR("Not supported channel");
236  return 0;
237  }
238  }
239  case Format::YUV444:
240  case Format::IYUV:
241  {
242  switch (channel)
243  {
244  case Channel::Y:
245  return 0;
246  case Channel::U:
247  return 0;
248  case Channel::V:
249  return 0;
250  default:
251  ARM_COMPUTE_ERROR("Not supported channel");
252  return 0;
253  }
254  }
255  default:
256  ARM_COMPUTE_ERROR("Not supported format");
257  return 0;
258  }
259 }

References A, ARM_COMPUTE_ERROR, B, update_supported_ops::format, G, IYUV, NV12, NV21, R, RGB888, RGBA8888, U, UYVY422, V, Y, YUV444, and YUYV422.

◆ check_value_range()

bool arm_compute::check_value_range ( val,
DataType  dt,
QuantizationInfo  qinfo = QuantizationInfo() 
)

Returns true if the value can be represented by the given data type.

Parameters
[in]valvalue to be checked
[in]dtdata type that is checked
[in]qinfo(Optional) quantization info if the data type is QASYMM8
Returns
true if the data type can hold the value.

Definition at line 439 of file DataTypeUtils.h.

440 {
441  switch (dt)
442  {
443  case DataType::U8:
444  {
445  const auto val_u8 = static_cast<uint8_t>(val);
446  return ((val_u8 == val) && val >= std::numeric_limits<uint8_t>::lowest() &&
447  val <= std::numeric_limits<uint8_t>::max());
448  }
449  case DataType::QASYMM8:
450  {
451  double min = static_cast<double>(dequantize_qasymm8(0, qinfo));
452  double max = static_cast<double>(dequantize_qasymm8(std::numeric_limits<uint8_t>::max(), qinfo));
453  return ((double)val >= min && (double)val <= max);
454  }
455  case DataType::S8:
456  {
457  const auto val_s8 = static_cast<int8_t>(val);
458  return ((val_s8 == val) && val >= std::numeric_limits<int8_t>::lowest() &&
459  val <= std::numeric_limits<int8_t>::max());
460  }
461  case DataType::U16:
462  {
463  const auto val_u16 = static_cast<uint16_t>(val);
464  return ((val_u16 == val) && val >= std::numeric_limits<uint16_t>::lowest() &&
465  val <= std::numeric_limits<uint16_t>::max());
466  }
467  case DataType::S16:
468  {
469  const auto val_s16 = static_cast<int16_t>(val);
470  return ((val_s16 == val) && val >= std::numeric_limits<int16_t>::lowest() &&
471  val <= std::numeric_limits<int16_t>::max());
472  }
473  case DataType::U32:
474  {
475  const auto val_d64 = static_cast<double>(val);
476  const auto val_u32 = static_cast<uint32_t>(val);
477  return ((val_u32 == val_d64) && val_d64 >= std::numeric_limits<uint32_t>::lowest() &&
478  val_d64 <= std::numeric_limits<uint32_t>::max());
479  }
480  case DataType::S32:
481  {
482  const auto val_d64 = static_cast<double>(val);
483  const auto val_s32 = static_cast<int32_t>(val);
484  return ((val_s32 == val_d64) && val_d64 >= std::numeric_limits<int32_t>::lowest() &&
485  val_d64 <= std::numeric_limits<int32_t>::max());
486  }
487  case DataType::BFLOAT16:
488  return (val >= bfloat16::lowest() && val <= bfloat16::max());
489  case DataType::F16:
490  return (val >= std::numeric_limits<half>::lowest() && val <= std::numeric_limits<half>::max());
491  case DataType::F32:
492  return (val >= std::numeric_limits<float>::lowest() && val <= std::numeric_limits<float>::max());
493  default:
494  ARM_COMPUTE_ERROR("Data type not supported");
495  return false;
496  }
497 }

References ARM_COMPUTE_ERROR, BFLOAT16, dequantize_qasymm8(), dt, F16, F32, bfloat16::lowest(), arm_compute::support::cpp11::lowest(), bfloat16::max(), QASYMM8, arm_compute::test::validation::qinfo, S16, S32, S8, U16, U32, and U8.

◆ cl_winograd_convolution_layer_supported()

bool cl_winograd_convolution_layer_supported ( const Size2D output_tile,
const Size2D kernel_size,
DataLayout  data_layout 
)

This function checks if the Winograd configuration (defined through the output tile, kernel size and the data layout) is supported on OpenCL.

Parameters
[in]output_tileOutput tile for the Winograd filtering algorithm
[in]kernel_sizeKernel size for the Winograd filtering algorithm
[in]data_layoutData layout of the input tensor
Returns
True if the configuration is supported

Definition at line 292 of file CLHelpers.cpp.

295 {
297 
298  using WinogradConfiguration = std::pair<std::pair<int, int>, std::pair<int, int>>;
299 
300  std::vector<WinogradConfiguration> winograd_configs_nchw = {
301  WinogradConfiguration(std::pair<int, int>(1, 2), std::pair<int, int>(1, 3)),
302  WinogradConfiguration(std::pair<int, int>(1, 4), std::pair<int, int>(1, 3)),
303  WinogradConfiguration(std::pair<int, int>(2, 1), std::pair<int, int>(3, 1)),
304  WinogradConfiguration(std::pair<int, int>(4, 1), std::pair<int, int>(3, 1)),
305  WinogradConfiguration(std::pair<int, int>(2, 2), std::pair<int, int>(3, 3)),
306  WinogradConfiguration(std::pair<int, int>(4, 4), std::pair<int, int>(3, 3)),
307  WinogradConfiguration(std::pair<int, int>(4, 4), std::pair<int, int>(5, 5)),
308  WinogradConfiguration(std::pair<int, int>(4, 1), std::pair<int, int>(5, 1)),
309  WinogradConfiguration(std::pair<int, int>(1, 4), std::pair<int, int>(1, 5))};
310 
311  std::vector<WinogradConfiguration> winograd_configs_nhwc = {
312  WinogradConfiguration(std::pair<int, int>(2, 2), std::pair<int, int>(3, 3)),
313  WinogradConfiguration(std::pair<int, int>(1, 4), std::pair<int, int>(1, 3)),
314  WinogradConfiguration(std::pair<int, int>(4, 1), std::pair<int, int>(3, 1)),
315  WinogradConfiguration(std::pair<int, int>(4, 4), std::pair<int, int>(3, 3)),
316  WinogradConfiguration(std::pair<int, int>(4, 4), std::pair<int, int>(5, 5)),
317  WinogradConfiguration(std::pair<int, int>(4, 1), std::pair<int, int>(5, 1)),
318  WinogradConfiguration(std::pair<int, int>(1, 4), std::pair<int, int>(1, 5)),
319  WinogradConfiguration(std::pair<int, int>(1, 2), std::pair<int, int>(1, 7)),
320  WinogradConfiguration(std::pair<int, int>(2, 1), std::pair<int, int>(7, 1)),
321  WinogradConfiguration(std::pair<int, int>(2, 2), std::pair<int, int>(7, 7)),
322  };
323 
324  auto p = std::make_pair(std::pair<int, int>(output_tile.width, output_tile.height),
325  std::pair<int, int>(kernel_size.width, kernel_size.height));
326 
327  // Return true if supported
328  if (data_layout == DataLayout::NCHW)
329  {
330  return (std::find(winograd_configs_nchw.begin(), winograd_configs_nchw.end(), p) !=
331  winograd_configs_nchw.end());
332  }
333  else
334  {
335  return (std::find(winograd_configs_nhwc.begin(), winograd_configs_nhwc.end(), p) !=
336  winograd_configs_nhwc.end());
337  }
338 }

References ARM_COMPUTE_ERROR_ON, arm_compute::cpu::data_layout, Size2D::height, NCHW, UNKNOWN, and Size2D::width.

◆ colorconvert_iyuv_to_nv12()

void arm_compute::colorconvert_iyuv_to_nv12 ( const void *__restrict  input,
void *__restrict  output,
const Window win 
)

Convert IYUV to NV12.

Parameters
[in]inputInput IYUV data buffer.
[out]outputOutput NV12 buffer.
[in]winWindow for iterating the buffers.

Definition at line 717 of file NEColorConvertHelper.inl.

718 {
719  ARM_COMPUTE_ERROR_ON(nullptr == input);
720  ARM_COMPUTE_ERROR_ON(nullptr == output);
721  win.validate();
722 
723  const auto input_ptr = static_cast<const IMultiImage *__restrict>(input);
724  const auto output_ptr = static_cast<IMultiImage *__restrict>(output);
725 
726  // UV's width and height are subsampled
727  Window win_uv(win);
728  win_uv.set(Window::DimX, Window::Dimension(win_uv.x().start() / 2, win_uv.x().end() / 2, win_uv.x().step() / 2));
729  win_uv.set(Window::DimY, Window::Dimension(win_uv.y().start() / 2, win_uv.y().end() / 2, 1));
730  win_uv.validate();
731 
732  Iterator in_y(input_ptr->plane(0), win);
733  Iterator in_u(input_ptr->plane(1), win_uv);
734  Iterator in_v(input_ptr->plane(2), win_uv);
735  Iterator out_y(output_ptr->plane(0), win);
736  Iterator out_uv(output_ptr->plane(1), win_uv);
737 
739  win,
740  [&](const Coordinates &)
741  {
742  const auto ta_y_top = vld2q_u8(in_y.ptr());
743  const auto ta_y_bottom = vld2q_u8(in_y.ptr() + input_ptr->plane(0)->info()->strides_in_bytes().y());
744  uint8x16x2_t ta_uv;
745  ta_uv.val[0] = vld1q_u8(in_u.ptr());
746  ta_uv.val[1] = vld1q_u8(in_v.ptr());
747  //ta_y.val[0] = Y0 Y2 Y4 Y6 ...
748  //ta_y.val[1] = Y1 Y3 Y5 Y7 ...
749  //ta_uv.val[0] = U0 U2 U4 U6 ...
750  //ta_uv.val[1] = V0 V2 V4 V6 ...
751 
752  vst2q_u8(out_y.ptr(), ta_y_top);
753  vst2q_u8(out_y.ptr() + output_ptr->plane(0)->info()->strides_in_bytes().y(), ta_y_bottom);
754  vst2q_u8(out_uv.ptr(), ta_uv);
755  },
756  in_y, in_u, in_v, out_y, out_uv);
757 }

References ARM_COMPUTE_ERROR_ON, Window::DimX, Window::DimY, Window::Dimension::end(), execute_window_loop(), arm_compute::test::validation::input, Iterator::ptr(), Window::set(), Window::Dimension::start(), Window::Dimension::step(), Window::validate(), Window::x(), and Window::y().

◆ colorconvert_iyuv_to_rgb()

void arm_compute::colorconvert_iyuv_to_rgb ( const void *__restrict  input,
void *__restrict  output,
const Window win 
)

Convert IYUV to RGB.

Parameters
[in]inputInput IYUV data buffer.
[out]outputOutput RGB buffer.
[in]winWindow for iterating the buffers.

Definition at line 562 of file NEColorConvertHelper.inl.

563 {
564  ARM_COMPUTE_ERROR_ON(nullptr == input);
565  ARM_COMPUTE_ERROR_ON(nullptr == output);
566  win.validate();
567 
568  const auto input_ptr = static_cast<const IMultiImage *__restrict>(input);
569  const auto output_ptr = static_cast<IImage *__restrict>(output);
570 
571  constexpr auto element_size = alpha ? 32 : 24;
572  const auto out_stride = output_ptr->info()->strides_in_bytes().y();
573 
574  // UV's width and height are subsampled
575  Window win_uv(win);
576  win_uv.set(Window::DimX, Window::Dimension(win_uv.x().start() / 2, win_uv.x().end() / 2, win_uv.x().step() / 2));
577  win_uv.set(Window::DimY, Window::Dimension(win_uv.y().start() / 2, win_uv.y().end() / 2, 1));
578  win_uv.validate();
579 
580  Iterator in_y(input_ptr->plane(0), win);
581  Iterator in_u(input_ptr->plane(1), win_uv);
582  Iterator in_v(input_ptr->plane(2), win_uv);
583  Iterator out(output_ptr, win);
584 
586  win,
587  [&](const Coordinates &)
588  {
589  const auto *y_top_ptr = in_y.ptr();
590  const auto *y_bottom_ptr = in_y.ptr() + input_ptr->plane(0)->info()->strides_in_bytes().y();
591  const auto *u_ptr = in_u.ptr();
592  const auto *v_ptr = in_v.ptr();
593 
594  // Work-around issue in gcc 9(>=) where vld2q might cause issues with register allocation
595 #if defined(__arch64__)
596  const auto ta0_y_top = vld1q_u8(y_top_ptr);
597  const auto ta1_y_top = vld1q_u8(y_top_ptr + 16);
598  const auto ta0_y_bottom = vld1q_u8(y_bottom_ptr);
599  const auto ta1_y_bottom = vld1q_u8(y_bottom_ptr + 16);
600  const auto ta_u = vld1q_u8(u_ptr);
601  const auto ta_v = vld1q_u8(v_ptr);
602 
603  // Convert the uint8x16x4_t to float32x4x4_t
604  float32x4x4_t yvec_top = arm_compute::convert_uint8x16_to_float32x4x4(vuzp1q_u8(ta0_y_top, ta1_y_top));
605  float32x4x4_t yyvec_top = arm_compute::convert_uint8x16_to_float32x4x4(vuzp2q_u8(ta0_y_top, ta1_y_top));
606  float32x4x4_t yvec_bottom =
607  arm_compute::convert_uint8x16_to_float32x4x4(vuzp1q_u8(ta0_y_bottom, ta1_y_bottom));
608  float32x4x4_t yyvec_bottom =
609  arm_compute::convert_uint8x16_to_float32x4x4(vuzp2q_u8(ta0_y_bottom, ta1_y_bottom));
610  float32x4x4_t uvec = arm_compute::convert_uint8x16_to_float32x4x4(ta_u);
611  float32x4x4_t vvec = arm_compute::convert_uint8x16_to_float32x4x4(ta_v);
612 #else /* defined(__arch64__) */
613  const auto ta_y_top = vld2q_u8(y_top_ptr);
614  const auto ta_y_bottom = vld2q_u8(y_bottom_ptr);
615  const auto ta_u = vld1q_u8(u_ptr);
616  const auto ta_v = vld1q_u8(v_ptr);
617  //ta_y.val[0] = Y0 Y2 Y4 Y6 ...
618  //ta_y.val[1] = Y1 Y3 Y5 Y7 ...
619  //ta_u.val[0] = U0 U2 U4 U6 ...
620  //ta_v.val[0] = V0 V2 V4 V6 ...
621 
622  // Convert the uint8x16x4_t to float32x4x4_t
623  float32x4x4_t yvec_top = arm_compute::convert_uint8x16_to_float32x4x4(ta_y_top.val[0]);
624  float32x4x4_t yyvec_top = arm_compute::convert_uint8x16_to_float32x4x4(ta_y_top.val[1]);
625  float32x4x4_t yvec_bottom = arm_compute::convert_uint8x16_to_float32x4x4(ta_y_bottom.val[0]);
626  float32x4x4_t yyvec_bottom = arm_compute::convert_uint8x16_to_float32x4x4(ta_y_bottom.val[1]);
627  float32x4x4_t uvec = arm_compute::convert_uint8x16_to_float32x4x4(ta_u);
628  float32x4x4_t vvec = arm_compute::convert_uint8x16_to_float32x4x4(ta_v);
629 #endif /* defined(__arch64__) */
630 
631  yuyv_to_rgb_calculation(yvec_top.val[0], uvec.val[0], yyvec_top.val[0], vvec.val[0],
632  out.ptr() + 0 * element_size, alpha);
633  yuyv_to_rgb_calculation(yvec_top.val[1], uvec.val[1], yyvec_top.val[1], vvec.val[1],
634  out.ptr() + 1 * element_size, alpha);
635  yuyv_to_rgb_calculation(yvec_top.val[2], uvec.val[2], yyvec_top.val[2], vvec.val[2],
636  out.ptr() + 2 * element_size, alpha);
637  yuyv_to_rgb_calculation(yvec_top.val[3], uvec.val[3], yyvec_top.val[3], vvec.val[3],
638  out.ptr() + 3 * element_size, alpha);
639 
640  yuyv_to_rgb_calculation(yvec_bottom.val[0], uvec.val[0], yyvec_bottom.val[0], vvec.val[0],
641  out.ptr() + out_stride + 0 * element_size, alpha);
642  yuyv_to_rgb_calculation(yvec_bottom.val[1], uvec.val[1], yyvec_bottom.val[1], vvec.val[1],
643  out.ptr() + out_stride + 1 * element_size, alpha);
644  yuyv_to_rgb_calculation(yvec_bottom.val[2], uvec.val[2], yyvec_bottom.val[2], vvec.val[2],
645  out.ptr() + out_stride + 2 * element_size, alpha);
646  yuyv_to_rgb_calculation(yvec_bottom.val[3], uvec.val[3], yyvec_bottom.val[3], vvec.val[3],
647  out.ptr() + out_stride + 3 * element_size, alpha);
648  },
649  in_y, in_u, in_v, out);
650 }

References ARM_COMPUTE_ERROR_ON, convert_uint8x16_to_float32x4x4(), Window::DimX, Window::DimY, Window::Dimension::end(), execute_window_loop(), ITensor::info(), arm_compute::test::validation::input, Iterator::ptr(), Window::set(), Window::Dimension::start(), Window::Dimension::step(), ITensorInfo::strides_in_bytes(), Window::validate(), Window::x(), Dimensions< T >::y(), Window::y(), and arm_compute::test::colorconvert_helper::detail::yuyv_to_rgb_calculation().

◆ colorconvert_iyuv_to_yuv4()

void arm_compute::colorconvert_iyuv_to_yuv4 ( const void *__restrict  input,
void *__restrict  output,
const Window win 
)

Convert IYUV to YUV4.

Parameters
[in]inputInput IYUV data buffer.
[out]outputOutput YUV4 buffer.
[in]winWindow for iterating the buffers.

Definition at line 940 of file NEColorConvertHelper.inl.

941 {
942  ARM_COMPUTE_ERROR_ON(nullptr == input);
943  ARM_COMPUTE_ERROR_ON(nullptr == output);
944  win.validate();
945 
946  const auto input_ptr = static_cast<const IMultiImage *__restrict>(input);
947  const auto output_ptr = static_cast<IMultiImage *__restrict>(output);
948 
949  // UV's width and height are subsampled
950  Window win_uv(win);
951  win_uv.set(Window::DimX, Window::Dimension(win_uv.x().start() / 2, win_uv.x().end() / 2, win_uv.x().step() / 2));
952  win_uv.set(Window::DimY, Window::Dimension(win_uv.y().start() / 2, win_uv.y().end() / 2, 1));
953  win_uv.validate();
954 
955  Iterator in_y(input_ptr->plane(0), win);
956  Iterator in_u(input_ptr->plane(1), win_uv);
957  Iterator in_v(input_ptr->plane(2), win_uv);
958  Iterator out_y(output_ptr->plane(0), win);
959  Iterator out_u(output_ptr->plane(1), win);
960  Iterator out_v(output_ptr->plane(2), win);
961 
963  win,
964  [&](const Coordinates &)
965  {
966  const auto ta_y_top = vld2q_u8(in_y.ptr());
967  const auto ta_y_bottom = vld2q_u8(in_y.ptr() + input_ptr->plane(0)->info()->strides_in_bytes().y());
968  const auto ta_u = vld1q_u8(in_u.ptr());
969  const auto ta_v = vld1q_u8(in_v.ptr());
970  //ta_y.val[0] = Y0 Y2 Y4 Y6 ...
971  //ta_y.val[1] = Y1 Y3 Y5 Y7 ...
972  //ta_u = U0 U2 U4 U6 ...
973  //ta_v = V0 V2 V4 V6 ...
974 
975  vst2q_u8(out_y.ptr(), ta_y_top);
976  vst2q_u8(out_y.ptr() + output_ptr->plane(0)->info()->strides_in_bytes().y(), ta_y_bottom);
977 
978  uint8x16x2_t uvec;
979  uvec.val[0] = ta_u;
980  uvec.val[1] = ta_u;
981  vst2q_u8(out_u.ptr(), uvec);
982  vst2q_u8(out_u.ptr() + output_ptr->plane(1)->info()->strides_in_bytes().y(), uvec);
983 
984  uint8x16x2_t vvec;
985  vvec.val[0] = ta_v;
986  vvec.val[1] = ta_v;
987  vst2q_u8(out_v.ptr(), vvec);
988  vst2q_u8(out_v.ptr() + output_ptr->plane(2)->info()->strides_in_bytes().y(), vvec);
989  },
990  in_y, in_u, in_v, out_y, out_u, out_v);
991 }

References ARM_COMPUTE_ERROR_ON, Window::DimX, Window::DimY, Window::Dimension::end(), execute_window_loop(), arm_compute::test::validation::input, Iterator::ptr(), Window::set(), Window::Dimension::start(), Window::Dimension::step(), Window::validate(), Window::x(), and Window::y().

◆ colorconvert_nv12_to_iyuv()

void arm_compute::colorconvert_nv12_to_iyuv ( const void *__restrict  input,
void *__restrict  output,
const Window win 
)

Convert NV12 to IYUV.

Parameters
[in]inputInput NV12 data buffer.
[out]outputOutput IYUV buffer.
[in]winWindow for iterating the buffers.

Definition at line 767 of file NEColorConvertHelper.inl.

768 {
769  ARM_COMPUTE_ERROR_ON(nullptr == input);
770  ARM_COMPUTE_ERROR_ON(nullptr == output);
771  win.validate();
772 
773  const auto input_ptr = static_cast<const IMultiImage *__restrict>(input);
774  const auto output_ptr = static_cast<IMultiImage *__restrict>(output);
775 
776  constexpr auto shift = uv ? 0 : 1;
777 
778  // UV's width and height are subsampled
779  Window win_uv(win);
780  win_uv.set(Window::DimX, Window::Dimension(win_uv.x().start() / 2, win_uv.x().end() / 2, win_uv.x().step() / 2));
781  win_uv.set(Window::DimY, Window::Dimension(win_uv.y().start() / 2, win_uv.y().end() / 2, 1));
782  win_uv.validate();
783 
784  Iterator in_y(input_ptr->plane(0), win);
785  Iterator in_uv(input_ptr->plane(1), win_uv);
786  Iterator out_y(output_ptr->plane(0), win);
787  Iterator out_u(output_ptr->plane(1), win_uv);
788  Iterator out_v(output_ptr->plane(2), win_uv);
789 
791  win,
792  [&](const Coordinates &)
793  {
794  const auto ta_y_top = vld2q_u8(in_y.ptr());
795  const auto ta_y_bottom = vld2q_u8(in_y.ptr() + input_ptr->plane(0)->info()->strides_in_bytes().y());
796  const auto ta_uv = vld2q_u8(in_uv.ptr());
797  //ta_y.val[0] = Y0 Y2 Y4 Y6 ...
798  //ta_y.val[1] = Y1 Y3 Y5 Y7 ...
799  //ta_uv.val[0] = U0 U2 U4 U6 ...
800  //ta_uv.val[1] = V0 V2 V4 V6 ...
801 
802  vst2q_u8(out_y.ptr(), ta_y_top);
803  vst2q_u8(out_y.ptr() + output_ptr->plane(0)->info()->strides_in_bytes().y(), ta_y_bottom);
804  vst1q_u8(out_u.ptr(), ta_uv.val[0 + shift]);
805  vst1q_u8(out_v.ptr(), ta_uv.val[1 - shift]);
806  },
807  in_y, in_uv, out_y, out_u, out_v);
808 }

References ARM_COMPUTE_ERROR_ON, Window::DimX, Window::DimY, Window::Dimension::end(), execute_window_loop(), arm_compute::test::validation::input, Iterator::ptr(), Window::set(), Window::Dimension::start(), Window::Dimension::step(), Window::validate(), Window::x(), and Window::y().

◆ colorconvert_nv12_to_rgb()

void arm_compute::colorconvert_nv12_to_rgb ( const void *__restrict  input,
void *__restrict  output,
const Window win 
)

Convert NV12 to RGB.

Parameters
[in]inputInput NV12 data buffer.
[out]outputOutput RGB buffer.
[in]winWindow for iterating the buffers.

Definition at line 490 of file NEColorConvertHelper.inl.

491 {
492  ARM_COMPUTE_ERROR_ON(nullptr == input);
493  ARM_COMPUTE_ERROR_ON(nullptr == output);
494  win.validate();
495 
496  const auto input_ptr = static_cast<const IMultiImage *__restrict>(input);
497  const auto output_ptr = static_cast<IImage *__restrict>(output);
498 
499  constexpr auto element_size = alpha ? 32 : 24;
500  const auto out_stride = output_ptr->info()->strides_in_bytes().y();
501  constexpr auto shift = uv ? 0 : 1;
502 
503  // UV's width and height are subsampled
504  Window win_uv(win);
505  win_uv.set(Window::DimX, Window::Dimension(win_uv.x().start() / 2, win_uv.x().end() / 2, win.x().step() / 2));
506  win_uv.set(Window::DimY, Window::Dimension(win_uv.y().start() / 2, win_uv.y().end() / 2, 1));
507  win_uv.validate();
508 
509  Iterator in_y(input_ptr->plane(0), win);
510  Iterator in_uv(input_ptr->plane(1), win_uv);
511  Iterator out(output_ptr, win);
512 
514  win,
515  [&](const Coordinates &)
516  {
517  const auto ta_y_top = vld2q_u8(in_y.ptr());
518  const auto ta_y_bottom = vld2q_u8(in_y.ptr() + input_ptr->plane(0)->info()->strides_in_bytes().y());
519  const auto ta_uv = vld2q_u8(in_uv.ptr());
520  //ta_y.val[0] = Y0 Y2 Y4 Y6 ...
521  //ta_y.val[1] = Y1 Y3 Y5 Y7 ...
522  //ta_uv.val[0] = U0 U2 U4 U6 ...
523  //ta_uv.val[1] = V0 V2 V4 V6 ...
524 
525  // Convert the uint8x16x4_t to float32x4x4_t
526  float32x4x4_t yvec_top = arm_compute::convert_uint8x16_to_float32x4x4(ta_y_top.val[0]);
527  float32x4x4_t yyvec_top = arm_compute::convert_uint8x16_to_float32x4x4(ta_y_top.val[1]);
528  float32x4x4_t yvec_bottom = arm_compute::convert_uint8x16_to_float32x4x4(ta_y_bottom.val[0]);
529  float32x4x4_t yyvec_bottom = arm_compute::convert_uint8x16_to_float32x4x4(ta_y_bottom.val[1]);
530  float32x4x4_t uvec = arm_compute::convert_uint8x16_to_float32x4x4(ta_uv.val[0 + shift]);
531  float32x4x4_t vvec = arm_compute::convert_uint8x16_to_float32x4x4(ta_uv.val[1 - shift]);
532 
533  yuyv_to_rgb_calculation(yvec_top.val[0], uvec.val[0], yyvec_top.val[0], vvec.val[0],
534  out.ptr() + 0 * element_size, alpha);
535  yuyv_to_rgb_calculation(yvec_top.val[1], uvec.val[1], yyvec_top.val[1], vvec.val[1],
536  out.ptr() + 1 * element_size, alpha);
537  yuyv_to_rgb_calculation(yvec_top.val[2], uvec.val[2], yyvec_top.val[2], vvec.val[2],
538  out.ptr() + 2 * element_size, alpha);
539  yuyv_to_rgb_calculation(yvec_top.val[3], uvec.val[3], yyvec_top.val[3], vvec.val[3],
540  out.ptr() + 3 * element_size, alpha);
541 
542  yuyv_to_rgb_calculation(yvec_bottom.val[0], uvec.val[0], yyvec_bottom.val[0], vvec.val[0],
543  out.ptr() + out_stride + 0 * element_size, alpha);
544  yuyv_to_rgb_calculation(yvec_bottom.val[1], uvec.val[1], yyvec_bottom.val[1], vvec.val[1],
545  out.ptr() + out_stride + 1 * element_size, alpha);
546  yuyv_to_rgb_calculation(yvec_bottom.val[2], uvec.val[2], yyvec_bottom.val[2], vvec.val[2],
547  out.ptr() + out_stride + 2 * element_size, alpha);
548  yuyv_to_rgb_calculation(yvec_bottom.val[3], uvec.val[3], yyvec_bottom.val[3], vvec.val[3],
549  out.ptr() + out_stride + 3 * element_size, alpha);
550  },
551  in_y, in_uv, out);
552 }

References ARM_COMPUTE_ERROR_ON, convert_uint8x16_to_float32x4x4(), Window::DimX, Window::DimY, Window::Dimension::end(), execute_window_loop(), ITensor::info(), arm_compute::test::validation::input, Iterator::ptr(), Window::set(), Window::Dimension::start(), Window::Dimension::step(), ITensorInfo::strides_in_bytes(), Window::validate(), Window::x(), Dimensions< T >::y(), Window::y(), and arm_compute::test::colorconvert_helper::detail::yuyv_to_rgb_calculation().

◆ colorconvert_nv12_to_yuv4()

void arm_compute::colorconvert_nv12_to_yuv4 ( const void *__restrict  input,
void *__restrict  output,
const Window win 
)

Convert NV12 to YUV4.

Parameters
[in]inputInput NV12 data buffer.
[out]outputOutput YUV4 buffer.
[in]winWindow for iterating the buffers.

Definition at line 880 of file NEColorConvertHelper.inl.

881 {
882  ARM_COMPUTE_ERROR_ON(nullptr == input);
883  ARM_COMPUTE_ERROR_ON(nullptr == output);
884  win.validate();
885 
886  const auto input_ptr = static_cast<const IMultiImage *__restrict>(input);
887  const auto output_ptr = static_cast<IMultiImage *__restrict>(output);
888 
889  constexpr auto shift = uv ? 0 : 1;
890 
891  // UV's width and height are subsampled
892  Window win_uv(win);
893  win_uv.set(Window::DimX, Window::Dimension(win_uv.x().start() / 2, win_uv.x().end() / 2, win_uv.x().step() / 2));
894  win_uv.set(Window::DimY, Window::Dimension(win_uv.y().start() / 2, win_uv.y().end() / 2, 1));
895  win_uv.validate();
896 
897  Iterator in_y(input_ptr->plane(0), win);
898  Iterator in_uv(input_ptr->plane(1), win_uv);
899  Iterator out_y(output_ptr->plane(0), win);
900  Iterator out_u(output_ptr->plane(1), win);
901  Iterator out_v(output_ptr->plane(2), win);
902 
904  win,
905  [&](const Coordinates &)
906  {
907  const auto ta_y_top = vld2q_u8(in_y.ptr());
908  const auto ta_y_bottom = vld2q_u8(in_y.ptr() + input_ptr->plane(0)->info()->strides_in_bytes().y());
909  const auto ta_uv = vld2q_u8(in_uv.ptr());
910  //ta_y.val[0] = Y0 Y2 Y4 Y6 ...
911  //ta_y.val[1] = Y1 Y3 Y5 Y7 ...
912  //ta_uv.val[0] = U0 U2 U4 U6 ...
913  //ta_uv.val[1] = V0 V2 V4 V6 ...
914 
915  vst2q_u8(out_y.ptr(), ta_y_top);
916  vst2q_u8(out_y.ptr() + output_ptr->plane(0)->info()->strides_in_bytes().y(), ta_y_bottom);
917 
918  uint8x16x2_t uvec;
919  uvec.val[0] = ta_uv.val[0 + shift];
920  uvec.val[1] = ta_uv.val[0 + shift];
921  vst2q_u8(out_u.ptr(), uvec);
922  vst2q_u8(out_u.ptr() + output_ptr->plane(1)->info()->strides_in_bytes().y(), uvec);
923 
924  uint8x16x2_t vvec;
925  vvec.val[0] = ta_uv.val[1 - shift];
926  vvec.val[1] = ta_uv.val[1 - shift];
927  vst2q_u8(out_v.ptr(), vvec);
928  vst2q_u8(out_v.ptr() + output_ptr->plane(2)->info()->strides_in_bytes().y(), vvec);
929  },
930  in_y, in_uv, out_y, out_u, out_v);
931 }

References ARM_COMPUTE_ERROR_ON, Window::DimX, Window::DimY, Window::Dimension::end(), execute_window_loop(), arm_compute::test::validation::input, Iterator::ptr(), Window::set(), Window::Dimension::start(), Window::Dimension::step(), Window::validate(), Window::x(), and Window::y().

◆ colorconvert_rgb_to_iyuv()

void arm_compute::colorconvert_rgb_to_iyuv ( const void *__restrict  input,
void *__restrict  output,
const Window win 
)

Convert RGB to IYUV.

Parameters
[in]inputInput RGB data buffer.
[out]outputOutput IYUV buffer.
[in]winWindow for iterating the buffers.

Definition at line 1045 of file NEColorConvertHelper.inl.

1046 {
1047  ARM_COMPUTE_ERROR_ON(nullptr == input);
1048  ARM_COMPUTE_ERROR_ON(nullptr == output);
1049  win.validate();
1050 
1051  const auto input_ptr = static_cast<const IImage *__restrict>(input);
1052  const auto output_ptr = static_cast<IMultiImage *__restrict>(output);
1053 
1054  // UV's width and height are subsampled
1055  Window win_uv(win);
1056  win_uv.set(Window::DimX, Window::Dimension(win_uv.x().start() / 2, win_uv.x().end() / 2, win_uv.x().step() / 2));
1057  win_uv.set(Window::DimY, Window::Dimension(win_uv.y().start() / 2, win_uv.y().end() / 2, 1));
1058  win_uv.validate();
1059 
1060  Iterator in(input_ptr, win);
1061  Iterator out_y(output_ptr->plane(0), win);
1062  Iterator out_u(output_ptr->plane(1), win_uv);
1063  Iterator out_v(output_ptr->plane(2), win_uv);
1064 
1066  win,
1067  [&](const Coordinates &)
1068  {
1069  const auto ta_rgb_top = load_rgb(in.ptr(), alpha);
1070  const auto ta_rgb_bottom = load_rgb(in.ptr() + input_ptr->info()->strides_in_bytes().y(), alpha);
1071  //ta_rgb.val[0] = R0 R1 R2 R3 ...
1072  //ta_rgb.val[1] = G0 G1 G2 G3 ...
1073  //ta_rgb.val[2] = B0 B1 B2 B3 ...
1074 
1075  store_rgb_to_iyuv(ta_rgb_top.val[0], ta_rgb_top.val[1], ta_rgb_top.val[2], ta_rgb_bottom.val[0],
1076  ta_rgb_bottom.val[1], ta_rgb_bottom.val[2], out_y.ptr(),
1077  out_y.ptr() + output_ptr->plane(0)->info()->strides_in_bytes().y(), out_u.ptr(),
1078  out_v.ptr());
1079  },
1080  in, out_y, out_u, out_v);
1081 }

References ARM_COMPUTE_ERROR_ON, Window::DimX, Window::DimY, Window::Dimension::end(), execute_window_loop(), arm_compute::test::validation::input, Iterator::ptr(), Window::set(), Window::Dimension::start(), Window::Dimension::step(), Window::validate(), Window::x(), and Window::y().

◆ colorconvert_rgb_to_nv12()

void arm_compute::colorconvert_rgb_to_nv12 ( const void *__restrict  input,
void *__restrict  output,
const Window win 
)

Convert RGB to NV12.

Parameters
[in]inputInput RGB data buffer.
[out]outputOutput NV12 buffer.
[in]winWindow for iterating the buffers.

Definition at line 1001 of file NEColorConvertHelper.inl.

1002 {
1003  ARM_COMPUTE_ERROR_ON(nullptr == input);
1004  ARM_COMPUTE_ERROR_ON(nullptr == output);
1005  win.validate();
1006 
1007  const auto input_ptr = static_cast<const IImage *__restrict>(input);
1008  const auto output_ptr = static_cast<IMultiImage *__restrict>(output);
1009 
1010  // UV's width and height are subsampled
1011  Window win_uv(win);
1012  win_uv.set(Window::DimX, Window::Dimension(win_uv.x().start() / 2, win_uv.x().end() / 2, win_uv.x().step() / 2));
1013  win_uv.set(Window::DimY, Window::Dimension(win_uv.y().start() / 2, win_uv.y().end() / 2, 1));
1014  win_uv.validate();
1015 
1016  Iterator in(input_ptr, win);
1017  Iterator out_y(output_ptr->plane(0), win);
1018  Iterator out_uv(output_ptr->plane(1), win_uv);
1019 
1021  win,
1022  [&](const Coordinates &)
1023  {
1024  const auto ta_rgb_top = load_rgb(in.ptr(), alpha);
1025  const auto ta_rgb_bottom = load_rgb(in.ptr() + input_ptr->info()->strides_in_bytes().y(), alpha);
1026  //ta_rgb.val[0] = R0 R1 R2 R3 ...
1027  //ta_rgb.val[1] = G0 G1 G2 G3 ...
1028  //ta_rgb.val[2] = B0 B1 B2 B3 ...
1029 
1030  store_rgb_to_nv12(ta_rgb_top.val[0], ta_rgb_top.val[1], ta_rgb_top.val[2], ta_rgb_bottom.val[0],
1031  ta_rgb_bottom.val[1], ta_rgb_bottom.val[2], out_y.ptr(),
1032  out_y.ptr() + output_ptr->plane(0)->info()->strides_in_bytes().y(), out_uv.ptr());
1033  },
1034  in, out_y, out_uv);
1035 }

References ARM_COMPUTE_ERROR_ON, Window::DimX, Window::DimY, Window::Dimension::end(), execute_window_loop(), arm_compute::test::validation::input, Iterator::ptr(), Window::set(), Window::Dimension::start(), Window::Dimension::step(), Window::validate(), Window::x(), and Window::y().

◆ colorconvert_rgb_to_rgbx()

void arm_compute::colorconvert_rgb_to_rgbx ( const void *__restrict  input,
void *__restrict  output,
const Window win 
)

Convert RGB to RGBX.

Parameters
[in]inputInput RGB data buffer.
[out]outputOutput RGBX buffer.
[in]winWindow for iterating the buffers.

Definition at line 344 of file NEColorConvertHelper.inl.

345 {
346  ARM_COMPUTE_ERROR_ON(nullptr == input);
347  ARM_COMPUTE_ERROR_ON(nullptr == output);
348 
349  const auto input_ptr = static_cast<const IImage *__restrict>(input);
350  const auto output_ptr = static_cast<IImage *__restrict>(output);
351 
352  Iterator in(input_ptr, win);
353  Iterator out(output_ptr, win);
354 
356  win,
357  [&](const Coordinates &)
358  {
359  const auto ta1 = vld3q_u8(in.ptr());
360  uint8x16x4_t ta2;
361  ta2.val[0] = ta1.val[0];
362  ta2.val[1] = ta1.val[1];
363  ta2.val[2] = ta1.val[2];
364  ta2.val[3] = vdupq_n_u8(255);
365  vst4q_u8(out.ptr(), ta2);
366  },
367  in, out);
368 }

References ARM_COMPUTE_ERROR_ON, execute_window_loop(), arm_compute::test::validation::input, and Iterator::ptr().

◆ colorconvert_rgb_to_u8()

void arm_compute::colorconvert_rgb_to_u8 ( const void *__restrict  input,
void *__restrict  output,
const Window win 
)

Convert RGB to U8.

Parameters
[in]inputInput RGB data buffer.
[out]outputOutput U8 buffer.
[in]winWindow for iterating the buffers.

Definition at line 377 of file NEColorConvertHelper.inl.

378 {
379  ARM_COMPUTE_ERROR_ON(nullptr == input);
380  ARM_COMPUTE_ERROR_ON(nullptr == output);
381 
382  const auto input_ptr = static_cast<const IImage *__restrict>(input);
383  const auto output_ptr = static_cast<IImage *__restrict>(output);
384 
385  Iterator in(input_ptr, win);
386  Iterator out(output_ptr, win);
387 
389  win,
390  [&](const Coordinates &)
391  {
392  const auto ta1 = vld3q_u8(in.ptr());
393  uint8x16_t ta2;
394  rgb_to_u8_conversion(ta1, ta2);
395  vst1q_u8(out.ptr(), ta2);
396  },
397  in, out);
398 }

References ARM_COMPUTE_ERROR_ON, execute_window_loop(), arm_compute::test::validation::input, and Iterator::ptr().

◆ colorconvert_rgb_to_yuv4()

void arm_compute::colorconvert_rgb_to_yuv4 ( const void *__restrict  input,
void *__restrict  output,
const Window win 
)

Convert RGB to YUV4.

Parameters
[in]inputInput RGB data buffer.
[out]outputOutput YUV4 buffer.
[in]winWindow for iterating the buffers.

Definition at line 1091 of file NEColorConvertHelper.inl.

1092 {
1093  ARM_COMPUTE_ERROR_ON(nullptr == input);
1094  ARM_COMPUTE_ERROR_ON(nullptr == output);
1095  win.validate();
1096 
1097  const auto input_ptr = static_cast<const IImage *__restrict>(input);
1098  const auto output_ptr = static_cast<IMultiImage *__restrict>(output);
1099 
1100  Iterator in(input_ptr, win);
1101  Iterator out_y(output_ptr->plane(0), win);
1102  Iterator out_u(output_ptr->plane(1), win);
1103  Iterator out_v(output_ptr->plane(2), win);
1104 
1106  win,
1107  [&](const Coordinates &)
1108  {
1109  const auto ta_rgb = load_rgb(in.ptr(), alpha);
1110  //ta_rgb.val[0] = R0 R1 R2 R3 ...
1111  //ta_rgb.val[1] = G0 G1 G2 G3 ...
1112  //ta_rgb.val[2] = B0 B1 B2 B3 ...
1113 
1114  store_rgb_to_yuv4(ta_rgb.val[0], ta_rgb.val[1], ta_rgb.val[2], out_y.ptr(), out_u.ptr(), out_v.ptr());
1115  },
1116  in, out_y, out_u, out_v);
1117 }

References ARM_COMPUTE_ERROR_ON, execute_window_loop(), arm_compute::test::validation::input, Iterator::ptr(), and Window::validate().

◆ colorconvert_rgbx_to_rgb()

void arm_compute::colorconvert_rgbx_to_rgb ( const void *  input,
void *  output,
const Window win 
)

Convert RGBX to RGB.

Parameters
[in]inputInput RGBX data buffer.
[out]outputOutput RGB buffer.
[in]winWindow for iterating the buffers.

Definition at line 407 of file NEColorConvertHelper.inl.

408 {
409  ARM_COMPUTE_ERROR_ON(nullptr == input);
410  ARM_COMPUTE_ERROR_ON(nullptr == output);
411 
412  const auto input_ptr = static_cast<const IImage *__restrict>(input);
413  const auto output_ptr = static_cast<IImage *__restrict>(output);
414 
415  Iterator in(input_ptr, win);
416  Iterator out(output_ptr, win);
417 
419  win,
420  [&](const Coordinates &)
421  {
422  const auto ta1 = vld4q_u8(in.ptr());
423  uint8x16x3_t ta2;
424  ta2.val[0] = ta1.val[0];
425  ta2.val[1] = ta1.val[1];
426  ta2.val[2] = ta1.val[2];
427  vst3q_u8(out.ptr(), ta2);
428  },
429  in, out);
430 }

References ARM_COMPUTE_ERROR_ON, execute_window_loop(), arm_compute::test::validation::input, and Iterator::ptr().

◆ colorconvert_yuyv_to_iyuv()

void arm_compute::colorconvert_yuyv_to_iyuv ( const void *__restrict  input,
void *__restrict  output,
const Window win 
)

Convert YUYV to IYUV.

Parameters
[in]inputInput YUYV data buffer.
[out]outputOutput IYUV buffer.
[in]winWindow for iterating the buffers.

Definition at line 818 of file NEColorConvertHelper.inl.

819 {
820  ARM_COMPUTE_ERROR_ON(nullptr == input);
821  ARM_COMPUTE_ERROR_ON(nullptr == output);
822  win.validate();
823 
824  const auto input_ptr = static_cast<const IImage *__restrict>(input);
825  const auto output_ptr = static_cast<IMultiImage *__restrict>(output);
826 
827  constexpr auto shift = yuyv ? 0 : 1;
828 
829  // Destination's UV's width and height are subsampled
830  Window win_uv(win);
831  win_uv.set(Window::DimX, Window::Dimension(win_uv.x().start() / 2, win_uv.x().end() / 2, win_uv.x().step() / 2));
832  win_uv.set(Window::DimY, Window::Dimension(win_uv.y().start() / 2, win_uv.y().end() / 2, 1));
833  win_uv.validate();
834 
835  Iterator in(input_ptr, win);
836  Iterator out_y(output_ptr->plane(0), win);
837  Iterator out_u(output_ptr->plane(1), win_uv);
838  Iterator out_v(output_ptr->plane(2), win_uv);
839 
841  win,
842  [&](const Coordinates &)
843  {
844  const auto ta_top = vld4q_u8(in.ptr());
845  const auto ta_bottom = vld4q_u8(in.ptr() + input_ptr->info()->strides_in_bytes().y());
846  //ta.val[0] = Y0 Y2 Y4 Y6 ...
847  //ta.val[1] = U0 U2 U4 U6 ...
848  //ta.val[2] = Y1 Y3 Y5 Y7 ...
849  //ta.val[3] = V0 V2 V4 V7 ...
850 
851  uint8x16x2_t yvec;
852  yvec.val[0] = ta_top.val[0 + shift];
853  yvec.val[1] = ta_top.val[2 + shift];
854  vst2q_u8(out_y.ptr(), yvec);
855 
856  uint8x16x2_t yyvec;
857  yyvec.val[0] = ta_bottom.val[0 + shift];
858  yyvec.val[1] = ta_bottom.val[2 + shift];
859  vst2q_u8(out_y.ptr() + output_ptr->plane(0)->info()->strides_in_bytes().y(), yyvec);
860 
861  uint8x16_t uvec;
862  uvec = vhaddq_u8(ta_top.val[1 - shift], ta_bottom.val[1 - shift]);
863  vst1q_u8(out_u.ptr(), uvec);
864 
865  uint8x16_t vvec;
866  vvec = vhaddq_u8(ta_top.val[3 - shift], ta_bottom.val[3 - shift]);
867  vst1q_u8(out_v.ptr(), vvec);
868  },
869  in, out_y, out_u, out_v);
870 }

References ARM_COMPUTE_ERROR_ON, Window::DimX, Window::DimY, Window::Dimension::end(), execute_window_loop(), arm_compute::test::validation::input, Iterator::ptr(), Window::set(), Window::Dimension::start(), Window::Dimension::step(), Window::validate(), Window::x(), and Window::y().

◆ colorconvert_yuyv_to_nv12()

void arm_compute::colorconvert_yuyv_to_nv12 ( const void *__restrict  input,
void *__restrict  output,
const Window win 
)

Convert YUYV to NV12.

Parameters
[in]inputInput YUYV data buffer.
[out]outputOutput NV12 buffer.
[in]winWindow for iterating the buffers.

Definition at line 660 of file NEColorConvertHelper.inl.

661 {
662  ARM_COMPUTE_ERROR_ON(nullptr == input);
663  ARM_COMPUTE_ERROR_ON(nullptr == output);
664  win.validate();
665 
666  const auto input_ptr = static_cast<const IImage *__restrict>(input);
667  const auto output_ptr = static_cast<IMultiImage *__restrict>(output);
668 
669  constexpr auto shift = yuyv ? 0 : 1;
670 
671  // NV12's UV's width and height are subsampled
672  Window win_uv(win);
673  win_uv.set(Window::DimX, Window::Dimension(win_uv.x().start() / 2, win_uv.x().end() / 2, win_uv.x().step() / 2));
674  win_uv.set(Window::DimY, Window::Dimension(win_uv.y().start() / 2, win_uv.y().end() / 2, 1));
675  win_uv.validate();
676 
677  Iterator in(input_ptr, win);
678  Iterator out_y(output_ptr->plane(0), win);
679  Iterator out_uv(output_ptr->plane(1), win_uv);
680 
682  win,
683  [&](const Coordinates &)
684  {
685  const auto ta_top = vld4q_u8(in.ptr());
686  const auto ta_bottom = vld4q_u8(in.ptr() + input_ptr->info()->strides_in_bytes().y());
687  //ta.val[0] = Y0 Y2 Y4 Y6 ...
688  //ta.val[1] = U0 U2 U4 U6 ...
689  //ta.val[2] = Y1 Y3 Y5 Y7 ...
690  //ta.val[3] = V0 V2 V4 V7 ...
691 
692  uint8x16x2_t yvec;
693  yvec.val[0] = ta_top.val[0 + shift];
694  yvec.val[1] = ta_top.val[2 + shift];
695  vst2q_u8(out_y.ptr(), yvec);
696 
697  uint8x16x2_t yyvec;
698  yyvec.val[0] = ta_bottom.val[0 + shift];
699  yyvec.val[1] = ta_bottom.val[2 + shift];
700  vst2q_u8(out_y.ptr() + output_ptr->plane(0)->info()->strides_in_bytes().y(), yyvec);
701 
702  uint8x16x2_t uvvec;
703  uvvec.val[0] = vhaddq_u8(ta_top.val[1 - shift], ta_bottom.val[1 - shift]);
704  uvvec.val[1] = vhaddq_u8(ta_top.val[3 - shift], ta_bottom.val[3 - shift]);
705  vst2q_u8(out_uv.ptr(), uvvec);
706  },
707  in, out_y, out_uv);
708 }

References ARM_COMPUTE_ERROR_ON, Window::DimX, Window::DimY, Window::Dimension::end(), execute_window_loop(), arm_compute::test::validation::input, Iterator::ptr(), Window::set(), Window::Dimension::start(), Window::Dimension::step(), Window::validate(), Window::x(), and Window::y().

◆ colorconvert_yuyv_to_rgb()

void arm_compute::colorconvert_yuyv_to_rgb ( const void *__restrict  input,
void *__restrict  output,
const Window win 
)

Convert YUYV to RGB.

Parameters
[in]inputInput YUYV data buffer.
[out]outputOutput RGB buffer.
[in]winWindow for iterating the buffers.

Definition at line 440 of file NEColorConvertHelper.inl.

441 {
442  ARM_COMPUTE_ERROR_ON(nullptr == input);
443  ARM_COMPUTE_ERROR_ON(nullptr == output);
444 
445  const auto input_ptr = static_cast<const IImage *__restrict>(input);
446  const auto output_ptr = static_cast<IImage *__restrict>(output);
447 
448  constexpr auto element_size = alpha ? 32 : 24;
449  constexpr auto shift = yuyv ? 0 : 1;
450 
451  Iterator in(input_ptr, win);
452  Iterator out(output_ptr, win);
453 
455  win,
456  [&](const Coordinates &)
457  {
458  const auto ta = vld4q_u8(in.ptr());
459  //ta.val[0] = Y0 Y2 Y4 Y6 ...
460  //ta.val[1] = U0 U2 U4 U6 ...
461  //ta.val[2] = Y1 Y3 Y5 Y7 ...
462  //ta.val[3] = V0 V2 V4 V7 ...
463 
464  // Convert the uint8x16x4_t to float32x4x4_t
465  const float32x4x4_t yvec = arm_compute::convert_uint8x16_to_float32x4x4(ta.val[0 + shift]);
466  const float32x4x4_t uvec = arm_compute::convert_uint8x16_to_float32x4x4(ta.val[1 - shift]);
467  const float32x4x4_t yyvec = arm_compute::convert_uint8x16_to_float32x4x4(ta.val[2 + shift]);
468  const float32x4x4_t vvec = arm_compute::convert_uint8x16_to_float32x4x4(ta.val[3 - shift]);
469 
470  yuyv_to_rgb_calculation(yvec.val[0], uvec.val[0], yyvec.val[0], vvec.val[0], out.ptr() + 0 * element_size,
471  alpha);
472  yuyv_to_rgb_calculation(yvec.val[1], uvec.val[1], yyvec.val[1], vvec.val[1], out.ptr() + 1 * element_size,
473  alpha);
474  yuyv_to_rgb_calculation(yvec.val[2], uvec.val[2], yyvec.val[2], vvec.val[2], out.ptr() + 2 * element_size,
475  alpha);
476  yuyv_to_rgb_calculation(yvec.val[3], uvec.val[3], yyvec.val[3], vvec.val[3], out.ptr() + 3 * element_size,
477  alpha);
478  },
479  in, out);
480 }

References ARM_COMPUTE_ERROR_ON, convert_uint8x16_to_float32x4x4(), execute_window_loop(), arm_compute::test::validation::input, Iterator::ptr(), and arm_compute::test::colorconvert_helper::detail::yuyv_to_rgb_calculation().

◆ command_buffer_mutable_dispatch_supported()

bool command_buffer_mutable_dispatch_supported ( const cl::Device &  device)

Check whether cl_khr_command_buffer_mutable_dispatch extension is supported by the specified CL device.

Parameters
[in]deviceThe CL device
Returns
True if the extension is supported by the CL device.

Definition at line 509 of file CLHelpers.cpp.

510 {
511  return device_supports_extension(device, "cl_khr_command_buffer_mutable_dispatch");
512 }

References device_supports_extension().

Referenced by CLCommandBuffer::create().

◆ command_buffer_supported()

bool command_buffer_supported ( const cl::Device &  device)

Check whether cl_khr_command_buffer extension is supported by the specified CL device.

Parameters
[in]deviceThe CL device
Returns
True if the extension is supported by the CL device.

Definition at line 504 of file CLHelpers.cpp.

505 {
506  return device_supports_extension(device, "cl_khr_command_buffer");
507 }

References device_supports_extension().

◆ compute_requantization_scale_offset()

UniformQuantizationInfo arm_compute::compute_requantization_scale_offset ( const UniformQuantizationInfo uqinfo_in,
const UniformQuantizationInfo uqinfo_out 
)
inline

Definition at line 621 of file QuantizationInfo.h.

623 {
624  float scale_to_apply = uqinfo_out.scale;
625  int32_t offset_to_apply = uqinfo_out.offset;
626 
627  scale_to_apply /= uqinfo_in.scale;
628  // In order to minimize flooring we convert the offset to a float,
629  // then compute the new offset in the float domain,
630  // finally we convert it back as int32_t
631  offset_to_apply -= static_cast<int32_t>(static_cast<float>(uqinfo_in.offset) * uqinfo_in.scale / uqinfo_out.scale);
632  return UniformQuantizationInfo(scale_to_apply, offset_to_apply);
633 }

References UniformQuantizationInfo::offset, and UniformQuantizationInfo::scale.

Referenced by CpuQuantizeKernel::configure(), and CLROIPoolingLayerKernel::configure().

◆ compute_strides() [1/2]

Strides arm_compute::compute_strides ( const ITensorInfo info)
inline

Create a strides object based on the tensor dimensions.

Parameters
[in]infoTensor info object used to compute the strides.
Returns
Strides object based on element size and tensor shape.

Definition at line 63 of file Utils.h.

64 {
65  return compute_strides(info, info.element_size());
66 }

References compute_strides(), and arm_compute::test::validation::info.

◆ compute_strides() [2/2]

Strides arm_compute::compute_strides ( const ITensorInfo info,
stride_x,
Ts &&...  fixed_strides 
)
inline

Create a strides object based on the provided strides and the tensor dimensions.

Parameters
[in]infoTensor info object providing the shape of the tensor for unspecified strides.
[in]stride_xStride to be used in X dimension (in bytes).
[in]fixed_stridesStrides to be used in higher dimensions starting at Y (in bytes).
Returns
Strides object based on the specified strides. Missing strides are calculated based on the tensor shape and the strides of lower dimensions.

Definition at line 41 of file Utils.h.

42 {
43  const TensorShape &shape = info.tensor_shape();
44 
45  // Create strides object
46  Strides strides(stride_x, fixed_strides...);
47 
48  for (size_t i = 1 + sizeof...(Ts); i < info.num_dimensions(); ++i)
49  {
50  strides.set(i, shape[i - 1] * strides[i - 1]);
51  }
52 
53  return strides;
54 }

References arm_compute::test::validation::info, Dimensions< T >::set(), and arm_compute::test::validation::shape.

Referenced by compute_strides(), and TensorInfo::set_tensor_shape().

◆ compute_winograd_convolution_tiles()

Size2D arm_compute::compute_winograd_convolution_tiles ( const Size2D in_dims,
const Size2D kernel_size,
const Size2D output_tile_size,
const PadStrideInfo conv_info 
)
inline

Calculate the number of output tiles required by Winograd Convolution layer.

This utility function can be used by the Winograd input transform to know the number of tiles on the x and y direction

Parameters
[in]in_dimsSpatial dimensions of the input tensor of convolution layer
[in]kernel_sizeKernel size
[in]output_tile_sizeSize of a single output tile
[in]conv_infoConvolution info (i.e. pad, stride,...)
Returns
the number of output tiles along the x and y directions of size "output_tile_size"

Definition at line 250 of file Helpers.h.

254 {
255  int num_tiles_x =
256  std::ceil((in_dims.width - (kernel_size.width - 1) + conv_info.pad_left() + conv_info.pad_right()) /
257  static_cast<float>(output_tile_size.width));
258  int num_tiles_y =
259  std::ceil((in_dims.height - (kernel_size.height - 1) + conv_info.pad_top() + conv_info.pad_bottom()) /
260  static_cast<float>(output_tile_size.height));
261 
262  // Clamp in case we provide paddings but we have 1D convolution
263  num_tiles_x = std::min(num_tiles_x, static_cast<int>(in_dims.width));
264  num_tiles_y = std::min(num_tiles_y, static_cast<int>(in_dims.height));
265 
266  return Size2D(num_tiles_x, num_tiles_y);
267 }

References arm_compute::test::validation::conv_info, Size2D::height, and Size2D::width.

Referenced by arm_compute::misc::shape_calculator::compute_winograd_input_transform_shape(), ClWinogradInputTransformKernel::configure(), ClWinogradOutputTransformKernel::configure(), arm_compute::test::validation::reference::winograd_input_transform(), and arm_compute::test::validation::reference::winograd_output_transform().

◆ convert_float32x4x3_to_uint8x8x3()

void convert_float32x4x3_to_uint8x8x3 ( const float32x4x3_t &  in1,
const float32x4x3_t &  in2,
uint8x8x3_t &  out 
)
inline

Converts from two float32x4x3_t to just one uint8x8x3_t.

Parameters
[in]in1First input vector of float to be converted
[in]in2Second input vector of float to be converted
[out]outConverted output vector uint8 to store the result

Definition at line 488 of file NEMath.inl.

489 {
490  out.val[0] = vqmovn_u16(vcombine_u16(vqmovn_u32(vcvtq_u32_f32(in1.val[0])), vqmovn_u32(vcvtq_u32_f32(in2.val[0]))));
491  out.val[1] = vqmovn_u16(vcombine_u16(vqmovn_u32(vcvtq_u32_f32(in1.val[1])), vqmovn_u32(vcvtq_u32_f32(in2.val[1]))));
492  out.val[2] = vqmovn_u16(vcombine_u16(vqmovn_u32(vcvtq_u32_f32(in1.val[2])), vqmovn_u32(vcvtq_u32_f32(in2.val[2]))));
493 }

◆ convert_float32x4x4_to_int8x16()

void convert_float32x4x4_to_int8x16 ( const float32x4x4_t &  in,
int8x16_t &  out 
)
inline

Converts from float32x4x4_t to just one int8x16_t.

Parameters
[in]inVector of float to be converted
[out]outConverted vector of uint8 to store the result

Definition at line 502 of file NEMath.inl.

503 {
504  const auto low = vcombine_s16(vqmovn_s32(vcvtq_s32_f32(in.val[0])), vqmovn_s32(vcvtq_s32_f32(in.val[1])));
505  const auto high = vcombine_s16(vqmovn_s32(vcvtq_s32_f32(in.val[2])), vqmovn_s32(vcvtq_s32_f32(in.val[3])));
506  out = vcombine_s8(vqmovn_s16(low), vqmovn_s16(high));
507 }

Referenced by convert_float_to_int< float32x4x4_t, int8x16_t >().

◆ convert_float32x4x4_to_uint8x16()

void convert_float32x4x4_to_uint8x16 ( const float32x4x4_t &  in,
uint8x16_t &  out 
)
inline

Converts from two float32x4x4_t to just one uint8x16_t.

Parameters
[in]inVector of float to be converted
[out]outConverted vector of uint8 to store the result

Definition at line 495 of file NEMath.inl.

496 {
497  const auto low = vcombine_u16(vqmovn_u32(vcvtq_u32_f32(in.val[0])), vqmovn_u32(vcvtq_u32_f32(in.val[1])));
498  const auto high = vcombine_u16(vqmovn_u32(vcvtq_u32_f32(in.val[2])), vqmovn_u32(vcvtq_u32_f32(in.val[3])));
499  out = vcombine_u8(vqmovn_u16(low), vqmovn_u16(high));
500 }

Referenced by convert_float_to_int< float32x4x4_t, uint8x16_t >().

◆ convert_float_to_int()

int_vec_type arm_compute::convert_float_to_int ( const float_vec_type &  in)

Converts from float vector to integer vector.

Parameters
[in]inFloat vector to converted
Returns
The converted integer vector

◆ convert_float_to_int< float32x4x4_t, int8x16_t >()

int8x16_t arm_compute::convert_float_to_int< float32x4x4_t, int8x16_t > ( const float32x4x4_t &  in)
inline

Definition at line 524 of file NEMath.inl.

525 {
526  int8x16_t out;
528  return out;
529 }

References convert_float32x4x4_to_int8x16().

◆ convert_float_to_int< float32x4x4_t, uint8x16_t >()

uint8x16_t arm_compute::convert_float_to_int< float32x4x4_t, uint8x16_t > ( const float32x4x4_t &  in)
inline

Definition at line 510 of file NEMath.inl.

511 {
512  uint8x16_t out;
514  return out;
515 }

References convert_float32x4x4_to_uint8x16().

◆ convert_int8x16_to_float32x4x4()

float32x4x4_t convert_int8x16_to_float32x4x4 ( const int8x16_t &  in)
inline

Converts from int8x16 to float32x4x4_t.

Parameters
[in]inVector of int8 to be converted
Returns
Converted vector of float

Definition at line 462 of file NEMath.inl.

463 {
464  float32x4x4_t out;
465 
466  const auto tmp1 = vmovl_s8(vget_low_s8(in));
467  out.val[0] = vcvtq_f32_s32(vmovl_s16(vget_low_s16(tmp1)));
468  out.val[1] = vcvtq_f32_s32(vmovl_s16(vget_high_s16(tmp1)));
469 
470  const auto tmp2 = vmovl_s8(vget_high_s8(in));
471  out.val[2] = vcvtq_f32_s32(vmovl_s16(vget_low_s16(tmp2)));
472  out.val[3] = vcvtq_f32_s32(vmovl_s16(vget_high_s16(tmp2)));
473  return out;
474 }

Referenced by convert_int_to_float< float32x4x4_t, int8x16_t >(), and convert_to_float32x4x4().

◆ convert_int_to_float()

float_vec_type arm_compute::convert_int_to_float ( const int_vec_type &  in)

Converts from integer vector to float vector.

Parameters
[in]inInteger vector to converted
Returns
The converted float vector

◆ convert_int_to_float< float32x4x4_t, int8x16_t >()

float32x4x4_t arm_compute::convert_int_to_float< float32x4x4_t, int8x16_t > ( const int8x16_t &  in)
inline

Definition at line 532 of file NEMath.inl.

533 {
535 }

References convert_int8x16_to_float32x4x4().

◆ convert_int_to_float< float32x4x4_t, uint8x16_t >()

float32x4x4_t arm_compute::convert_int_to_float< float32x4x4_t, uint8x16_t > ( const uint8x16_t &  in)
inline

Definition at line 518 of file NEMath.inl.

519 {
521 }

References convert_uint8x16_to_float32x4x4().

◆ convert_negative_axis()

Coordinates& arm_compute::convert_negative_axis ( Coordinates coords,
int  max_value 
)
inline

Convert negative coordinates to positive in the range [0, num_dims_input].

Parameters
[out]coordsArray of coordinates to be converted.
[in]max_valueMaximum value to be used when wrapping the negative values in coords

Definition at line 287 of file Helpers.h.

288 {
289  for (unsigned int i = 0; i < coords.num_dimensions(); ++i)
290  {
291  coords[i] = wrap_around(coords[i], max_value);
292  }
293  return coords;
294 }

References Dimensions< T >::num_dimensions(), and wrap_around().

Referenced by arm_compute::misc::shape_calculator::calculate_reduce_mean_shape(), NEReduceMean::configure(), and CLReduceMean::configure().

◆ convert_to_float32x4x4() [1/3]

float32x4x4_t arm_compute::convert_to_float32x4x4 ( const int8x16_t &  in)
inline

Definition at line 483 of file NEMath.inl.

484 {
486 }

References convert_int8x16_to_float32x4x4().

◆ convert_to_float32x4x4() [2/3]

float32x4x4_t arm_compute::convert_to_float32x4x4 ( const T &  in)

Converts to float32x4x4_t from the specified templated 16 elements vectors.

Parameters
[in]inVector of float to be converted
Returns
Converted vector of float

◆ convert_to_float32x4x4() [3/3]

float32x4x4_t arm_compute::convert_to_float32x4x4 ( const uint8x16_t &  in)
inline

Definition at line 477 of file NEMath.inl.

478 {
480 }

References convert_uint8x16_to_float32x4x4().

◆ convert_uint8x16_to_float32x4x4()

float32x4x4_t convert_uint8x16_to_float32x4x4 ( const uint8x16_t &  in)
inline

Converts from uint8x16 to float32x4x4_t.

Parameters
[in]inVector of uint8 to be converted
Returns
Converted vector of float

Definition at line 448 of file NEMath.inl.

449 {
450  float32x4x4_t out;
451 
452  const auto tmp1 = vmovl_u8(vget_low_u8(in));
453  out.val[0] = vcvtq_f32_u32(vmovl_u16(vget_low_u16(tmp1)));
454  out.val[1] = vcvtq_f32_u32(vmovl_u16(vget_high_u16(tmp1)));
455 
456  const auto tmp2 = vmovl_u8(vget_high_u8(in));
457  out.val[2] = vcvtq_f32_u32(vmovl_u16(vget_low_u16(tmp2)));
458  out.val[3] = vcvtq_f32_u32(vmovl_u16(vget_high_u16(tmp2)));
459  return out;
460 }

Referenced by colorconvert_iyuv_to_rgb(), colorconvert_nv12_to_rgb(), colorconvert_yuyv_to_rgb(), convert_int_to_float< float32x4x4_t, uint8x16_t >(), and convert_to_float32x4x4().

◆ convert_window_coord_to_position()

Coordinates arm_compute::convert_window_coord_to_position ( const Window w,
const Coordinates offset 
)
inline

Convert an offset in window steps into absolute coordinates.

Parameters
[in]wWindow offset is related to.
[in]offsetOffset inside the window expressed in number of window steps.
Returns
Absolute coordinates.

Definition at line 40 of file WindowIterator.h.

41 {
42  Coordinates position;
43  for (unsigned int i = 0; i < Coordinates::num_max_dimensions; ++i)
44  {
45  position.set(i, w[i].start() + offset[i] * w[i].step());
46  }
47  return position;
48 }

References Dimensions< int >::num_max_dimensions, offset(), Dimensions< T >::set(), arm_compute::cpu::step, and arm_compute::test::validation::w.

◆ coords2index()

int coords2index ( const TensorShape shape,
const Coordinates coord 
)
inline

Convert n-dimensional coordinates into a linear index.

Parameters
[in]shapeShape of the n-dimensional tensor.
[in]coordN-dimensional coordinates.
Returns
linead index

Definition at line 183 of file Helpers.inl.

184 {
185  int num_elements = shape.total_size();
186  ARM_COMPUTE_UNUSED(num_elements);
187  ARM_COMPUTE_ERROR_ON_MSG(num_elements == 0, "Cannot create linear index from empty shape!");
188 
189  int index = 0;
190  int stride = 1;
191 
192  for (unsigned int d = 0; d < coord.num_dimensions(); ++d)
193  {
194  index += coord[d] * stride;
195  stride *= shape[d];
196  }
197 
198  return index;
199 }

References ARM_COMPUTE_ERROR_ON_MSG, ARM_COMPUTE_UNUSED, Dimensions< T >::num_dimensions(), and arm_compute::test::validation::shape.

Referenced by arm_compute::test::validation::reference::convert_fully_connected_weights(), arm_compute::test::validation::reference::gather(), and arm_compute::test::validation::reference::winograd_input_transform().

◆ cpu_impl_dt()

std::string arm_compute::cpu_impl_dt ( const DataType data_type)
inline

Returns the suffix string of CPU kernel implementation names based on the given data type.

Parameters
[in]data_typeThe data type the CPU kernel implemetation uses
Returns
the suffix string of CPU kernel implementations

Definition at line 505 of file DataTypeUtils.h.

506 {
507  std::string ret = "";
508 
509  switch (data_type)
510  {
511  case DataType::F32:
512  ret = "fp32";
513  break;
514  case DataType::F16:
515  ret = "fp16";
516  break;
517  case DataType::U8:
518  ret = "u8";
519  break;
520  case DataType::S16:
521  ret = "s16";
522  break;
523  case DataType::S32:
524  ret = "s32";
525  break;
526  case DataType::QASYMM8:
527  ret = "qu8";
528  break;
529  case DataType::QASYMM8_SIGNED:
530  ret = "qs8";
531  break;
532  case DataType::QSYMM16:
533  ret = "qs16";
534  break;
535  case DataType::QSYMM8_PER_CHANNEL:
536  ret = "qp8";
537  break;
538  case DataType::BFLOAT16:
539  ret = "bf16";
540  break;
541  default:
542  ARM_COMPUTE_ERROR("Unsupported.");
543  }
544 
545  return ret;
546 }

References ARM_COMPUTE_ERROR, BFLOAT16, arm_compute::test::validation::data_type, F16, F32, QASYMM8, QASYMM8_SIGNED, QSYMM16, QSYMM8_PER_CHANNEL, S16, S32, and U8.

◆ create_error()

Status create_error ( ErrorCode  error_code,
std::string  msg 
)

Creates an error containing the error message.

Parameters
[in]error_codeError code
[in]msgMessage to display before abandoning.
Returns
status containing the error

Definition at line 34 of file Error.cpp.

35 {
36  return Status(error_code, msg);
37 }

◆ create_error_msg()

Status create_error_msg ( ErrorCode  error_code,
const char *  func,
const char *  file,
int  line,
const char *  msg 
)

Creates an error and the error message.

Parameters
[in]error_codeError code
[in]funcFunction in which the error occurred.
[in]fileFile in which the error occurred.
[in]lineLine in which the error occurred.
[in]msgMessage to display before abandoning.
Returns
status containing the error

Definition at line 40 of file Error.cpp.

41 {
42  std::array<char, 512> out{0};
43  snprintf(out.data(), out.size(), "in %s %s:%d: %s", func, file, line, msg);
44  return Status(error_code, std::string(out.data()));
45 }

References arm_compute::support::cpp11::snprintf().

◆ create_image2d_from_buffer()

cl::Image2D create_image2d_from_buffer ( const cl::Context &  ctx,
const cl::Buffer &  buffer,
const TensorShape shape2d,
DataType  data_type,
size_t  image_row_pitch,
CLImage2DType  image_type 
)

Create a cl::Image2D object from an OpenCL buffer.

Note
The following conditions are required to create a OpenCL image object from OpenCL buffer,
  1. The platform should support the OpenCL cl_khr_image2d_from_buffer extension
  2. The stride Y for the input1 should satisfy the OpenCL pitch alignment requirement
  3. input width should be less or equal to (CL_DEVICE_IMAGE2D_MAX_WIDTH * 4)
  4. input height should be less or equal to CL_DEVICE_IMAGE2D_MAX_HEIGHT

It is user responsibility to ensure the above conditions are satisfied since no checks are performed within this function

Parameters
[in]ctxcl::Context object
[in]buffercl::Buffer object from which the OpenCL image2d object is created
[in]shape2d2D tensor shape
[in]data_typeDataType to use. Only supported: F32,F16
[in]image_row_pitchImage row pitch (a.k.a. stride Y) to be used in the image2d object
[in]image_typeImage 2D type (CLImage2DType)
Returns
cl::Image2D object

Definition at line 62 of file CLUtils.cpp.

68 {
69  ARM_COMPUTE_ERROR_ON_MSG(!image2d_from_buffer_supported(CLKernelLibrary::get().get_device()),
70  "The extension cl_khr_image2d_from_buffer is not supported on the target platform");
71  ARM_COMPUTE_ERROR_ON_MSG(get_cl_image_pitch_alignment(CLKernelLibrary::get().get_device()) == 0,
72  "Impossible to retrieve the cl_image pitch alignment");
73  ARM_COMPUTE_ERROR_ON_MSG(buffer.get() == nullptr, "Cannot create cl_image from empty cl_buffer");
74 
75  cl_channel_type cl_data_type;
76 
77  switch (data_type)
78  {
79  case DataType::F32:
80  cl_data_type = CL_FLOAT;
81  break;
82  case DataType::F16:
83  cl_data_type = CL_HALF_FLOAT;
84  break;
85  default:
86  ARM_COMPUTE_ERROR("Data type not support with OpenCL image2d");
87  }
88 
89  cl_mem cl_image;
90  cl_int err = CL_SUCCESS;
91 
92  const cl_image_format format = {CL_RGBA, cl_data_type};
93 
94  cl_image_desc desc;
95  memset(&desc, 0, sizeof(desc));
96  desc.image_type = CL_MEM_OBJECT_IMAGE2D;
97  desc.mem_object = buffer();
98  desc.image_row_pitch = image_row_pitch;
99  desc.image_width = shape2d[0];
100  desc.image_height = shape2d[1];
101 
102  switch (image_type)
103  {
104  case CLImage2DType::ReadOnly:
105  cl_image = clCreateImage(ctx(), CL_MEM_READ_ONLY, &format, &desc, nullptr, &err);
106  break;
107  case CLImage2DType::WriteOnly:
108  cl_image = clCreateImage(ctx(), CL_MEM_WRITE_ONLY, &format, &desc, nullptr, &err);
109  break;
110  default:
111  ARM_COMPUTE_ERROR("Unsupported CLImage2DType");
112  }
113 
114  ARM_COMPUTE_UNUSED(err);
115  ARM_COMPUTE_ERROR_ON_MSG(err != CL_SUCCESS, "Error during the creation of CL image from buffer");
116 
117  return cl::Image2D(cl_image);
118 }

References ARM_COMPUTE_ERROR, ARM_COMPUTE_ERROR_ON_MSG, ARM_COMPUTE_UNUSED, clCreateImage(), arm_compute::test::validation::data_type, F16, F32, update_supported_ops::format, CLKernelLibrary::get(), get_cl_image_pitch_alignment(), image2d_from_buffer_supported(), ReadOnly, and WriteOnly.

Referenced by create_image2d_from_tensor(), CLDepthwiseConvolutionLayerNativeKernel::run(), ClMatMulNativeKernel::run_op(), ClIndirectConv2dKernel::run_op(), ClGemmMatrixMultiplyReshapedOnlyRhsMMULKernel::run_op(), ClGemmMatrixMultiplyReshapedOnlyRhsKernel::run_op(), and ClGemmMatrixMultiplyReshapedKernel::run_op().

◆ create_image2d_from_tensor()

cl::Image2D create_image2d_from_tensor ( const ICLTensor tensor,
CLImage2DType  image_type 
)

Create a cl::Image2D object from a tensor.

Parameters
[in]tensorTensor from which to construct Image 2D object
[in]image_typeImage 2D type (CLImage2DType)
Returns
cl::Image2D object

Definition at line 37 of file CLUtils.cpp.

38 {
40 
41  const cl::Context &ctx = CLKernelLibrary::get().context();
42  const cl::Buffer &buffer = tensor->cl_buffer();
43  const ITensorInfo *info = tensor->info();
44  ARM_COMPUTE_ERROR_ON_MSG(info->lock_paddings(), "Tensor paddings must not be locked to allow extending paddings to "
45  "satisfy cl_image pitch alignment requirement");
46 
47  const size_t image_w{info->dimension(0) / 4};
48  const size_t image_h{info->tensor_shape().total_size() / info->dimension(0)};
49  const size_t max_image_w{CLKernelLibrary::get().get_device().getInfo<CL_DEVICE_IMAGE2D_MAX_WIDTH>()};
50  const size_t max_image_h{CLKernelLibrary::get().get_device().getInfo<CL_DEVICE_IMAGE2D_MAX_HEIGHT>()};
51 
52  ARM_COMPUTE_UNUSED(max_image_w, max_image_h);
53  ARM_COMPUTE_ERROR_ON_MSG(image_w > max_image_w, "Image width exceeds maximum width for exporting to cl_image");
54  ARM_COMPUTE_ERROR_ON_MSG(image_h > max_image_h, "Image height exceeds maximum height for exporting to cl_image");
55 
56  const TensorShape shape2d(image_w, image_h);
57  const size_t image_row_pitch = info->strides_in_bytes()[1];
58 
59  return create_image2d_from_buffer(ctx, buffer, shape2d, info->data_type(), image_row_pitch, image_type);
60 }

References ARM_COMPUTE_ERROR_ON_MSG, ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_UNUSED, CLTensor::cl_buffer(), CLKernelLibrary::context(), create_image2d_from_buffer(), CLKernelLibrary::get(), CLKernelLibrary::get_device(), CLTensor::info(), arm_compute::test::validation::info, and tensor.

Referenced by ClDirectConv2dKernel::run_op().

◆ create_kernel()

cl::Kernel create_kernel ( const CLCompileContext ctx,
const std::string &  kernel_name,
const std::set< std::string > &  build_opts = std::set<std::string>() 
)

Creates an opencl kernel using a compile context.

Parameters
[in]ctxA compile context to be used to create the opencl kernel.
[in]kernel_nameThe kernel name.
[in]build_optsThe build options to be used for the opencl kernel compilation.
Returns
An opencl kernel

Definition at line 409 of file CLHelpers.cpp.

410 {
411  opencl::ClKernelLibrary &klib = opencl::ClKernelLibrary::get();
412 
413  const std::string program_name = klib.program_name(kernel_name);
414  auto kernel_src = klib.program(program_name);
415  const std::string kernel_path = klib.kernel_path();
416 
417  return static_cast<cl::Kernel>(ctx.create_kernel(kernel_name, program_name, kernel_src.program, kernel_path,
418  build_opts, kernel_src.is_binary));
419 }

References CLCompileContext::create_kernel(), ClKernelLibrary::get(), kernel_name, ClKernelLibrary::kernel_path(), ClKernelLibrary::program(), and ClKernelLibrary::program_name().

Referenced by ClTransposedConvolutionKernel::configure(), ClDequantizeKernel::configure(), ClReshapeKernel::configure(), ClTransposeKernel::configure(), ClFloorKernel::configure(), ClCopyKernel::configure(), ClElementWiseUnaryKernel::configure(), ClFillKernel::configure(), ClMatMulLowpNativeMMULKernel::configure(), ClWidthConcatenate2TensorsKernel::configure(), ClPool2dKernel::configure(), ClPool3dKernel::configure(), ClHeightConcatenateKernel::configure(), ClQuantizeKernel::configure(), ClScaleKernel::configure(), ClWidthConcatenateKernel::configure(), ClActivationKernel::configure(), ClPermuteKernel::configure(), ClWidthConcatenate4TensorsKernel::configure(), ClMatMulNativeKernel::configure(), ClCropKernel::configure(), CLStridedSliceKernel::configure(), ClBatchConcatenateKernel::configure(), ClDepthConcatenateKernel::configure(), ClMatMulLowpNativeKernel::configure(), ClConvertFullyConnectedWeightsKernel::configure(), ClGemmLowpMatrixMultiplyNativeKernel::configure(), ClGemmReshapeLhsMatrixKernel::configure(), CLInstanceNormalizationLayerKernel::configure(), ClGemmMatrixMultiplyNativeKernel::configure(), CLBitwiseKernel::configure(), CLMaxUnpoolingLayerKernel::configure(), ClGemmMatrixMultiplyReshapedOnlyRhsMMULKernel::configure(), ClIndirectConv2dAddressPrecalculationKernel::configure(), ClWinogradInputTransformKernel::configure(), CLChannelShuffleLayerKernel::configure(), ClWinogradFilterTransformKernel::configure(), ClGemmLowpQuantizeDownInt32ScaleByFixedPointKernel::configure(), CLSelectKernel::configure(), ClIndirectConv2dKernel::configure(), CLComputeAllAnchorsKernel::configure(), CLDeconvolutionLayerUpsampleKernel::configure(), ClWinogradOutputTransformKernel::configure(), ClGemmLowpQuantizeDownInt32ScaleByFloatKernel::configure(), ClGemmLowpQuantizeDownInt32ScaleKernel::configure(), CLSpaceToDepthLayerKernel::configure(), CLDepthToSpaceLayerKernel::configure(), ClSoftmaxKernel::configure(), CLNormalizationLayerKernel::configure(), CLQLSTMLayerNormalizationKernel::configure(), CLFFTScaleKernel::configure(), CLGatherKernel::configure(), CLTileKernel::configure(), CLSpaceToBatchLayerKernel::configure(), ClGemmLowpMatrixMultiplyReshapedKernel::configure(), ClCastKernel::configure(), CLComparisonKernel::configure(), ClGemmLowpOffsetContributionOutputStageKernel::configure(), CLBatchToSpaceLayerKernel::configure(), ClGemmReshapeRhsMatrixKernel::configure(), CLFFTDigitReverseKernel::configure(), CLMeanStdDevNormalizationKernel::configure(), ClGemmLowpOffsetContributionKernel::configure(), CLReorgLayerKernel::configure(), CLNormalizePlanarYUVLayerKernel::configure(), CLReverseKernel::configure(), CLRangeKernel::configure(), CLReductionOperationKernel::configure(), ClDirectConv2dKernel::configure(), ClCol2ImKernel::configure(), CLFFTRadixStageKernel::configure(), ClDirectConv3dKernel::configure(), ClGemmLowpMatrixMultiplyReshapedOnlyRhsKernel::configure(), CLL2NormalizeLayerKernel::configure(), ClMatMulNativeMMULKernel::configure(), CLPadLayerKernel::configure(), CLArgMinMaxLayerKernel::configure(), ClMulKernel::configure(), ClGemmMatrixMultiplyReshapedOnlyRhsKernel::configure(), CLDepthwiseConvolutionLayerNativeKernel::configure(), CLBoundingBoxTransformKernel::configure(), CLROIPoolingLayerKernel::configure(), CLPriorBoxLayerKernel::configure(), ClWeightsReshapeKernel::configure(), CLStackLayerKernel::configure(), ClGemmLowpMatrixAReductionKernel::configure(), CLROIAlignLayerKernel::configure(), ClIm2ColKernel::configure(), CLFillBorderKernel::configure(), ClGemmMatrixMultiplyReshapedKernel::configure(), CLDeconvolutionReshapeOutputKernel::configure(), CLFuseBatchNormalizationKernel::configure(), CLBatchNormalizationLayerKernel::configure(), CLComputeMeanVariance::configure(), ClComplexMulKernel::configure(), and ClGemmLowpMatrixBReductionKernel::configure().

◆ create_lws_hint_parallel_implementations()

cl::NDRange create_lws_hint_parallel_implementations ( unsigned int  input_dimension,
unsigned int  vector_size 
)

Creates a suitable LWS hint object for parallel implementations.

Sets the number of WG based on the input size. If input width is smaller than 128 we can use fewer threads than 8.

Parameters
[in]input_dimensionnumber of elements along the dimension to apply the parallellization
[in]vector_sizesize of the vector in OpenCL
Returns
An LWS hint object

Definition at line 421 of file CLHelpers.cpp.

422 {
423  const unsigned int width_leftover = input_dimension % vector_size;
424  const unsigned int border_width = (width_leftover != 0) ? vector_size - width_leftover : 0;
425  const unsigned int num_of_threads = ((input_dimension + border_width) / 16);
426  return cl::NDRange(std::min(8U, num_of_threads));
427 }

References arm_compute::utils::cast::U, and arm_compute::cpu::vector_size.

◆ create_opencl_context_and_device()

std::tuple< cl::Context, cl::Device, cl_int > create_opencl_context_and_device ( CLBackendType  cl_backend_type)

This function creates an OpenCL context and a device.

Note
In debug builds, the function will automatically enable cl_arm_printf if the driver/device supports it.
Parameters
[in]cl_backend_typeThe OpenCL backend type to use.
Returns
A std::tuple where the first element is the opencl context, the second element is the opencl device and the third one an error code. The error code will be CL_SUCCESS upon successful creation, otherwise a value telling why the function failed.

Definition at line 121 of file CLHelpers.cpp.

122 {
124  cl::Platform p = select_preferable_platform(cl_backend_type);
125  cl::Device device;
126  std::vector<cl::Device> platform_devices;
127  p.getDevices(CL_DEVICE_TYPE_DEFAULT, &platform_devices);
128  ARM_COMPUTE_ERROR_ON_MSG(platform_devices.size() == 0, "Couldn't find any OpenCL device");
129  device = platform_devices[0];
130  cl_int err = CL_SUCCESS;
131  std::array<cl_context_properties, 7> properties = {0, 0, 0, 0, 0, 0, 0};
132  initialise_context_properties(p, device, properties);
133  cl::Context cl_context = cl::Context(device, properties.data(), nullptr, nullptr, &err);
134  ARM_COMPUTE_ERROR_ON_MSG(err != CL_SUCCESS, "Failed to create OpenCL context");
135  return std::make_tuple(cl_context, device, err);
136 }

References ARM_COMPUTE_ERROR_ON, ARM_COMPUTE_ERROR_ON_MSG, opencl_is_available(), and select_preferable_platform().

Referenced by CLRuntimeContext::CLRuntimeContext(), CLScheduler::default_init(), and main().

◆ create_window_iterator()

WindowIterator<L> arm_compute::create_window_iterator ( const Window w,
const Coordinates start,
const Coordinates end,
L &&  lambda_function 
)

Create a WindowIterator object.

Parameters
[in]wWindow to use for the iteration
[in]startWhere to start iterating from (In Window coordinates)
[in]endWhere to stop iterating (In Window coordinates).
[in]lambda_functionLambda function to call for every iteration between start and end. (It will be called last for end - 1)
Returns
A WindowIterator object.

Definition at line 313 of file WindowIterator.h.

314 {
315  return WindowIterator<L>(w, start, end, std::move(lambda_function));
316 }

References arm_compute::mlgo::parser::end(), and arm_compute::test::validation::w.

◆ data_layout_from_name()

arm_compute::DataLayout data_layout_from_name ( const std::string &  name)

Converts a string to a strong types enumeration DataLayout.

Parameters
[in]nameString to convert
Returns
Converted DataLayout enumeration

Definition at line 32 of file TypeLoader.cpp.

33 {
34  static const std::map<std::string, arm_compute::DataLayout> data_layouts = {
35  {"nhwc", DataLayout::NHWC},
36  {"nchw", DataLayout::NCHW},
37  };
38 
39 #ifndef ARM_COMPUTE_EXCEPTIONS_DISABLED
40  try
41  {
42 #endif /* ARM_COMPUTE_EXCEPTIONS_DISABLED */
43  return data_layouts.at(arm_compute::utility::tolower(name));
44 
45 #ifndef ARM_COMPUTE_EXCEPTIONS_DISABLED
46  }
47  catch (const std::out_of_range &)
48  {
49  throw std::invalid_argument(name);
50  }
51 #endif /* ARM_COMPUTE_EXCEPTIONS_DISABLED */
52 }

References name, NCHW, NHWC, and arm_compute::utility::tolower().

Referenced by operator>>().

◆ data_size_from_type()

size_t arm_compute::data_size_from_type ( DataType  data_type)
inline

The size in bytes of the data type.

Parameters
[in]data_typeInput data type
Returns
The size in bytes of the data type

Definition at line 38 of file DataTypeUtils.h.

39 {
40  switch (data_type)
41  {
42  case DataType::U8:
43  case DataType::S8:
44  case DataType::QSYMM8:
45  case DataType::QASYMM8:
46  case DataType::QASYMM8_SIGNED:
47  case DataType::QSYMM8_PER_CHANNEL:
48  return 1;
49  case DataType::U16:
50  case DataType::S16:
51  case DataType::QSYMM16:
52  case DataType::QASYMM16:
53  case DataType::BFLOAT16:
54  case DataType::F16:
55  return 2;
56  case DataType::F32:
57  case DataType::U32:
58  case DataType::S32:
59  return 4;
60  case DataType::F64:
61  case DataType::U64:
62  case DataType::S64:
63  return 8;
64  case DataType::SIZET:
65  return sizeof(size_t);
66  default:
67  ARM_COMPUTE_ERROR("Invalid data type");
68  return 0;
69  }
70 }

References ARM_COMPUTE_ERROR, BFLOAT16, arm_compute::test::validation::data_type, F16, F32, F64, QASYMM16, QASYMM8, QASYMM8_SIGNED, QSYMM16, QSYMM8, QSYMM8_PER_CHANNEL, S16, S32, S64, S8, SIZET, U16, U32, U64, and U8.

Referenced by ClPermuteKernel::configure(), CLStridedSliceKernel::configure(), CLSpaceToDepthLayerKernel::configure(), CLGatherKernel::configure(), CLSpaceToBatchLayerKernel::configure(), CLTileKernel::configure(), ClCastKernel::configure(), ClWeightsReshapeKernel::configure(), CLBatchToSpaceLayerKernel::configure(), TensorInfo::element_size(), arm_compute::cpu::l2_normalize_x(), arm_compute::cpu::l2_normalize_yz(), arm_compute::cpu::matrix_matrix_multiply_f32(), CpuGemmLowpMatrixMultiplyKernel::run_op(), and arm_compute::cpu::vector_matrix_multiply_f32().

◆ data_type_from_format()

DataType arm_compute::data_type_from_format ( Format  format)
inline

Return the data type used by a given single-planar pixel format.

Parameters
[in]formatInput format
Returns
The size in bytes of the pixel format

Definition at line 115 of file DataTypeUtils.h.

116 {
117  switch (format)
118  {
119  case Format::U8:
120  case Format::UV88:
121  case Format::RGB888:
122  case Format::RGBA8888:
123  case Format::YUYV422:
124  case Format::UYVY422:
125  return DataType::U8;
126  case Format::U16:
127  return DataType::U16;
128  case Format::S16:
129  return DataType::S16;
130  case Format::U32:
131  return DataType::U32;
132  case Format::S32:
133  return DataType::S32;
134  case Format::BFLOAT16:
135  return DataType::BFLOAT16;
136  case Format::F16:
137  return DataType::F16;
138  case Format::F32:
139  return DataType::F32;
140  //Doesn't make sense for planar formats:
141  case Format::NV12:
142  case Format::NV21:
143  case Format::IYUV:
144  case Format::YUV444:
145  default:
146  ARM_COMPUTE_ERROR("Not supported data_type for given format");
147  return DataType::UNKNOWN;
148  }
149 }

References ARM_COMPUTE_ERROR, BFLOAT16, F16, F32, update_supported_ops::format, IYUV, NV12, NV21, RGB888, RGBA8888, S16, S32, U16, U32, U8, UNKNOWN, UV88, UYVY422, YUV444, and YUYV422.

Referenced by SimpleTensor< uint8_t >::data_type(), TensorInfo::init(), TensorInfo::init_auto_padding(), and TensorInfo::set_format().

◆ data_type_from_name()

DataType data_type_from_name ( const std::string &  name)

Convert a string to DataType.

Parameters
[in]nameThe name of the data type
Returns
DataType

Definition at line 58 of file DataTypeUtils.cpp.

59 {
60  static const std::map<std::string, DataType> data_types = {
61  {"f16", DataType::F16},
62  {"f32", DataType::F32},
63  {"qasymm8", DataType::QASYMM8},
64  {"qasymm8_signed", DataType::QASYMM8_SIGNED},
65  };
66 
67 #ifndef ARM_COMPUTE_EXCEPTIONS_DISABLED
68  try
69  {
70 #endif /* ARM_COMPUTE_EXCEPTIONS_DISABLED */
71  return data_types.at(utility::tolower(name));
72 
73 #ifndef ARM_COMPUTE_EXCEPTIONS_DISABLED
74  }
75  catch (const std::out_of_range &)
76  {
77  ARM_COMPUTE_ERROR_VAR("Invalid data type name: %s", name.c_str());
78  }
79 #endif /* ARM_COMPUTE_EXCEPTIONS_DISABLED */
80 }

References ARM_COMPUTE_ERROR_VAR, F16, F32, name, QASYMM8, QASYMM8_SIGNED, and arm_compute::utility::tolower().

Referenced by operator>>().

◆ deconvolution_output_dimensions()

std::pair< unsigned int, unsigned int > deconvolution_output_dimensions ( unsigned int  in_width,
unsigned int  in_height,
unsigned int  kernel_width,
unsigned int  kernel_height,
const PadStrideInfo pad_stride_info 
)

Returns expected width and height of the deconvolution's output tensor.

Parameters
[in]in_widthWidth of input tensor (Number of columns)
[in]in_heightHeight of input tensor (Number of rows)
[in]kernel_widthKernel width.
[in]kernel_heightKernel height.
[in]pad_stride_infoPad and stride information.
Returns
A pair with the new width in the first position and the new height in the second.

Definition at line 266 of file Utils.cpp.

271 {
272  const unsigned int pad_left = pad_stride_info.pad_left();
273  const unsigned int pad_top = pad_stride_info.pad_top();
274  const unsigned int pad_right = pad_stride_info.pad_right();
275  const unsigned int pad_bottom = pad_stride_info.pad_bottom();
276  const unsigned int stride_x = pad_stride_info.stride().first;
277  const unsigned int stride_y = pad_stride_info.stride().second;
278 
279  ARM_COMPUTE_ERROR_ON(in_width < 1 || in_height < 1);
280  ARM_COMPUTE_ERROR_ON(((in_width - 1) * stride_x + kernel_width) < (pad_left + pad_right));
281  ARM_COMPUTE_ERROR_ON(((in_height - 1) * stride_y + kernel_height) < (pad_top + pad_bottom));
282  const int w = stride_x * (in_width - 1) + kernel_width - (pad_left + pad_right);
283  const int h = stride_y * (in_height - 1) + kernel_height - (pad_top + pad_bottom);
284 
285  return std::make_pair<unsigned int, unsigned int>(w, h);
286 }

References ARM_COMPUTE_ERROR_ON, PadStrideInfo::pad_bottom(), PadStrideInfo::pad_left(), PadStrideInfo::pad_right(), PadStrideInfo::pad_top(), PadStrideInfo::stride(), and arm_compute::test::validation::w.

Referenced by DeconvolutionLayerNode::compute_output_descriptor(), ClTransposedConvolutionKernel::configure(), NEDeconvolutionLayer::configure(), CLDirectDeconvolutionLayer::configure(), NEDeconvolutionLayer::validate(), CLGEMMDeconvolutionLayer::validate(), and CLDirectDeconvolutionLayer::validate().

◆ dequantize() [1/5]

float arm_compute::dequantize ( int16_t  value,
float  scale 
)
inline

Dequantize a value given a 16-bit symmetric quantization scheme.

Parameters
[in]valueValue to dequantize
[in]scaleScale to use for dequantization
Returns
Dequantized value

Definition at line 429 of file QuantizationInfo.h.

430 {
431  return value * scale;
432 }

References arm_compute::test::validation::scale.

◆ dequantize() [2/5]

float arm_compute::dequantize ( int32_t  value,
float  scale,
int32_t  offset 
)
inline

Dequantize a value given a 32-bit asymmetric quantization scheme.

Parameters
[in]valueValue to dequantize
[in]scaleScale to use for dequantization
[in]offsetZero-offset to use for dequantization
Returns
Dequantized value

Definition at line 455 of file QuantizationInfo.h.

456 {
457  return (static_cast<int>(value) - offset) * scale;
458 }

References offset(), and arm_compute::test::validation::scale.

◆ dequantize() [3/5]

float arm_compute::dequantize ( int8_t  value,
float  scale 
)
inline

Dequantize a value given a 8-bit symmetric quantization scheme.

Parameters
[in]valueValue to dequantize
[in]scaleScale to use for dequantization
Returns
Dequantized value

Definition at line 417 of file QuantizationInfo.h.

418 {
419  return value * scale;
420 }

References arm_compute::test::validation::scale.

◆ dequantize() [4/5]

float arm_compute::dequantize ( uint16_t  value,
float  scale,
int32_t  offset 
)
inline

Dequantize a value given a 16-bit asymmetric quantization scheme.

Parameters
[in]valueValue to dequantize
[in]scaleScale to use for dequantization
[in]offsetZero-offset to use for dequantization
Returns
Dequantized value

Definition at line 442 of file QuantizationInfo.h.

443 {
444  return (static_cast<int>(value) - offset) * scale;
445 }

References offset(), and arm_compute::test::validation::scale.

◆ dequantize() [5/5]

float arm_compute::dequantize ( uint8_t  value,
float  scale,
int32_t  offset 
)
inline

Dequantize a value given an 8-bit asymmetric quantization scheme.

Parameters
[in]valueValue to dequantize
[in]scaleScale to use for dequantization
[in]offsetZero-offset to use for dequantization
Returns
Dequantized value

Definition at line 393 of file QuantizationInfo.h.

394 {
395  return (static_cast<int>(value) - offset) * scale;
396 }

References offset(), and arm_compute::test::validation::scale.

◆ dequantize_qasymm16() [1/2]

float arm_compute::dequantize_qasymm16 ( uint16_t  value,
const QuantizationInfo qinfo 
)
inline

Dequantize a value given a 16-bit asymmetric quantization scheme.

Parameters
[in]valueValue to dequantize
[in]qinfoQuantization information to use for dequantizing
Returns
Dequantized value

Definition at line 561 of file QuantizationInfo.h.

562 {
563  return dequantize_qasymm16(value, qinfo.uniform());
564 }

References dequantize_qasymm16(), arm_compute::test::validation::qinfo, and QuantizationInfo::uniform().

◆ dequantize_qasymm16() [2/2]

float arm_compute::dequantize_qasymm16 ( uint16_t  value,
const UniformQuantizationInfo qinfo 
)
inline

Dequantize a value given a 16-bit asymmetric quantization scheme.

Parameters
[in]valueValue to dequantize
[in]qinfoQuantization information to use for dequantizing
Returns
Dequantized value

Definition at line 537 of file QuantizationInfo.h.

538 {
539  return (static_cast<int>(value) - qinfo.offset) * qinfo.scale;
540 }

References QuantizationInfo::offset(), arm_compute::test::validation::qinfo, and QuantizationInfo::scale().

Referenced by arm_compute::cpu::bounding_box_transform_qsymm16(), arm_compute::test::validation::convert_from_asymmetric(), dequantize_qasymm16(), and arm_compute::cpu::roi_align().

◆ dequantize_qasymm8()

◆ dequantize_qasymm8_signed()

◆ dequantize_qsymm16() [1/2]

float arm_compute::dequantize_qsymm16 ( int16_t  value,
const QuantizationInfo qinfo 
)
inline

Dequantize a value given a 16-bit symmetric quantization scheme.

Parameters
[in]valueValue to dequantize
[in]qinfoQuantization information to use for dequantizing
Returns
Dequantized value

Definition at line 508 of file QuantizationInfo.h.

509 {
510  return dequantize_qsymm16(value, qinfo.uniform());
511 }

References dequantize_qsymm16(), arm_compute::test::validation::qinfo, and QuantizationInfo::uniform().

◆ dequantize_qsymm16() [2/2]

float arm_compute::dequantize_qsymm16 ( int16_t  value,
const UniformQuantizationInfo qinfo 
)
inline

Dequantize a value given a 16-bit symmetric quantization scheme.

Parameters
[in]valueValue to dequantize
[in]qinfoQuantization information to use for dequantizing
Returns
Dequantized value

Definition at line 484 of file QuantizationInfo.h.

485 {
486  return value * qinfo.scale;
487 }

References arm_compute::test::validation::qinfo, and QuantizationInfo::scale().

Referenced by arm_compute::cpu::compute_all_anchors_qasymm16(), arm_compute::test::validation::convert_from_symmetric(), dequantize_qsymm16(), and arm_compute::cpu::neon_qsymm16_activation().

◆ dequantize_qsymm8()

float arm_compute::dequantize_qsymm8 ( int8_t  value,
const UniformQuantizationInfo qinfo 
)
inline

Dequantize a value given a 8-bit symmetric quantization scheme.

Parameters
[in]valueValue to dequantize
[in]qinfoQuantization information to use for dequantizing
Returns
Dequantized value

Definition at line 405 of file QuantizationInfo.h.

406 {
407  return value * qinfo.scale;
408 }

References arm_compute::test::validation::qinfo, and QuantizationInfo::scale().

◆ dequantize_s32() [1/2]

float arm_compute::dequantize_s32 ( int32_t  value,
const QuantizationInfo qinfo 
)
inline

Dequantize a value given a 32-bit asymmetric quantization scheme.

Parameters
[in]valueValue to dequantize
[in]qinfoQuantization information to use for dequantizing
Returns
Dequantized value

Definition at line 586 of file QuantizationInfo.h.

587 {
588  return dequantize_s32(value, qinfo.uniform());
589 }

References dequantize_s32(), arm_compute::test::validation::qinfo, and QuantizationInfo::uniform().

◆ dequantize_s32() [2/2]

float arm_compute::dequantize_s32 ( int32_t  value,
const UniformQuantizationInfo qinfo 
)
inline

Dequantize a value given a 32-bit asymmetric quantization scheme.

Parameters
[in]valueValue to dequantize
[in]qinfoQuantization information to use for dequantizing
Returns
Dequantized value

Definition at line 573 of file QuantizationInfo.h.

574 {
575  return (static_cast<int>(value) - qinfo.offset) * qinfo.scale;
576 }

References QuantizationInfo::offset(), arm_compute::test::validation::qinfo, and QuantizationInfo::scale().

Referenced by dequantize_s32(), and arm_compute::test::validation::reference::quantization_layer().

◆ device_supports_extension()

bool device_supports_extension ( const cl::Device &  device,
const char *  extension_name 
)

Helper function to check whether a given extension is supported.

Parameters
[in]deviceA CL device
[in]extension_nameName of the extension to be checked
Returns
True if the extension is supported

Definition at line 285 of file CLHelpers.cpp.

286 {
287  std::string extensions = device.getInfo<CL_DEVICE_EXTENSIONS>();
288  auto pos = extensions.find(extension_name);
289  return (pos != std::string::npos);
290 }

References check_header_guards::extensions.

Referenced by arm_matrix_multiply_supported(), arm_non_uniform_workgroup_supported(), command_buffer_mutable_dispatch_supported(), command_buffer_supported(), dot8_acc_supported(), dot8_supported(), fp16_supported(), image2d_from_buffer_supported(), and arm_compute::test::validation::TEST_CASE().

◆ DIV_CEIL()

constexpr auto arm_compute::DIV_CEIL ( val,
m 
) -> decltype((val + m - 1) / m)
constexpr

Calculate the rounded up quotient of val / m.

Parameters
[in]valValue to divide and round up.
[in]mValue to divide by.
Returns
the result.

Definition at line 37 of file Math.h.

38 {
39  return (val + m - 1) / m;
40 }

Referenced by ceil_to_multiple(), and arm_compute::misc::shape_calculator::compute_indirect_buffer_shape().

◆ dot8_acc_supported()

bool dot8_acc_supported ( const cl::Device &  device)

Helper function to check whether the cl_arm_integer_dot_product_accumulate_int8 extension is supported.

Parameters
[in]deviceA CL device
Returns
True if the extension is supported

Definition at line 253 of file CLHelpers.cpp.

254 {
255  return device_supports_extension(device, "cl_arm_integer_dot_product_accumulate_int8");
256 }

References device_supports_extension().

◆ dot8_supported()

bool dot8_supported ( const cl::Device &  device)

Helper function to check whether the cl_arm_integer_dot_product_int8 extension is supported.

Parameters
[in]deviceA CL device
Returns
True if the extension is supported

Definition at line 242 of file CLHelpers.cpp.

243 {
244  std::string device_name = device.getInfo<CL_DEVICE_NAME>();
245  const GPUTarget gpu_target = get_target_from_name(device_name);
246 
247  // SW_WORKAROUND: Workaround for DDK revision r14p0.to enable cl_arm_integer_dot_product_int8
248  std::set<GPUTarget> sw_workaround_issue = {GPUTarget::G76};
249  return (device_supports_extension(device, "cl_arm_integer_dot_product_int8") ||
250  sw_workaround_issue.count(gpu_target) != 0);
251 }

References device_supports_extension(), G76, and get_target_from_name().

Referenced by ClGemmLowpMatrixMultiplyNativeKernel::configure(), ClGemmLowpMatrixMultiplyReshapedKernel::configure(), ClGemmLowpMatrixMultiplyReshapedOnlyRhsKernel::configure(), and ClGemmLowpMatrixAReductionKernel::configure().

◆ element_size_from_data_type()

size_t arm_compute::element_size_from_data_type ( DataType  dt)
inline

The size in bytes of the data type.

Parameters
[in]dtInput data type
Returns
The size in bytes of the data type

Definition at line 78 of file DataTypeUtils.h.

79 {
80  switch (dt)
81  {
82  case DataType::S8:
83  case DataType::U8:
84  case DataType::QSYMM8:
85  case DataType::QASYMM8:
86  case DataType::QASYMM8_SIGNED:
87  case DataType::QSYMM8_PER_CHANNEL:
88  return 1;
89  case DataType::U16:
90  case DataType::S16:
91  case DataType::QSYMM16:
92  case DataType::QASYMM16:
93  case DataType::BFLOAT16:
94  case DataType::F16:
95  return 2;
96  case DataType::U32:
97  case DataType::S32:
98  case DataType::F32:
99  return 4;
100  case DataType::U64:
101  case DataType::S64:
102  return 8;
103  default:
104  ARM_COMPUTE_ERROR("Undefined element size for given data type");
105  return 0;
106  }
107 }

References ARM_COMPUTE_ERROR, BFLOAT16, dt, F16, F32, QASYMM16, QASYMM8, QASYMM8_SIGNED, QSYMM16, QSYMM8, QSYMM8_PER_CHANNEL, S16, S32, S64, S8, U16, U32, U64, and U8.

Referenced by CLPadLayerKernel::configure(), arm_compute::test::validation::reference::depth_convert(), SimpleTensor< uint8_t >::element_size(), and arm_compute::test::validation::validate().

◆ enqueue()

void enqueue ( cl::CommandQueue &  queue,
ICLKernel kernel,
const Window window,
const cl::NDRange &  lws_hint = CLKernelLibrary::get().default_ndrange(),
bool  use_dummy_work_items = false 
)

Add the kernel to the command queue with the given window.

Note
Depending on the size of the window, this might translate into several jobs being enqueued.
If kernel->kernel() is empty then the function will return without adding anything to the queue.
Parameters
[in,out]queueOpenCL command queue.
[in]kernelKernel to enqueue
[in]windowWindow the kernel has to process.
[in]lws_hint(Optional) Local workgroup size requested. Default is based on the device target.
[in]use_dummy_work_items(Optional) Use dummy work items in order to have two dimensional power of two NDRange. Default is false Note: it is kernel responsibility to check if the work-item is out-of-range
Note
If any dimension of the lws is greater than the global workgroup size then no lws will be passed.

Definition at line 33 of file ICLKernel.cpp.

38 {
39  if (kernel.kernel()() == nullptr)
40  {
41  return;
42  }
43 
44  for (unsigned int i = 0; i < Coordinates::num_max_dimensions; ++i)
45  {
46  ARM_COMPUTE_ERROR_ON(window[i].step() == 0);
47  // Make sure that dimensions > Z are 1
48  ARM_COMPUTE_ERROR_ON((i >= 3) && ((window[i].end() - window[i].start()) != 1));
49  }
50 
51  cl::NDRange gws = ICLKernel::gws_from_window(window, use_dummy_work_items);
52 
53  // Check for empty NDRange
54  if (gws.dimensions() == 0)
55  {
56  return;
57  }
58 
59  kernel.cache_gws(gws);
60 
61  cl::NDRange valid_lws;
62  if (lws_hint[0] * lws_hint[1] * lws_hint[2] > kernel.get_max_workgroup_size())
63  {
64  valid_lws = cl::NullRange;
65  }
66  else
67  {
68  valid_lws = lws_hint;
69  }
70 
71  cl::NDRange lws = cl::NullRange;
72 
73  if ((valid_lws[0] <= gws[0]) && (valid_lws[1] <= gws[1]) && (valid_lws[2] <= gws[2]))
74  {
75  lws = valid_lws;
76  }
77 
78  if (CLKernelLibrary::get().is_wbsm_supported())
79  {
80  set_wbsm(kernel.kernel(), kernel.wbsm_hint());
81  }
82  queue.enqueueNDRangeKernel(kernel.kernel(), cl::NullRange, gws, lws);
83 }

References ARM_COMPUTE_ERROR_ON, ICLKernel::cache_gws(), arm_compute::mlgo::parser::end(), ICLKernel::get_max_workgroup_size(), ICLKernel::kernel(), set_wbsm(), arm_compute::cpu::step, and ICLKernel::wbsm_hint().

Referenced by ICLSimple2DKernel::run(), ICLSimple3DKernel::run(), CLBitwiseKernel::run(), CLChannelShuffleLayerKernel::run(), CLSpaceToDepthLayerKernel::run(), CLDepthToSpaceLayerKernel::run(), CLDeconvolutionLayerUpsampleKernel::run(), CLInstanceNormalizationLayerKernel::run(), CLFFTScaleKernel::run(), CLSelectKernel::run(), CLComputeAllAnchorsKernel::run(), CLNormalizationLayerKernel::run(), CLRangeKernel::run(), CLReorgLayerKernel::run(), CLTileKernel::run(), CLQLSTMLayerNormalizationKernel::run(), CLROIPoolingLayerKernel::run(), CLMaxUnpoolingLayerKernel::run(), CLMeanStdDevNormalizationKernel::run(), CLGatherKernel::run(), CLComparisonKernel::run(), CLFFTDigitReverseKernel::run(), CLReverseKernel::run(), CLNormalizePlanarYUVLayerKernel::run(), CLReductionOperationKernel::run(), CLFFTRadixStageKernel::run(), CLArgMinMaxLayerKernel::run(), CLL2NormalizeLayerKernel::run(), CLPadLayerKernel::run(), CLFillBorderKernel::run(), CLBoundingBoxTransformKernel::run(), CLPriorBoxLayerKernel::run(), CLStackLayerKernel::run(), CLROIAlignLayerKernel::run(), CLDeconvolutionReshapeOutputKernel::run(), CLDepthwiseConvolutionLayerNativeKernel::run(), CLBatchNormalizationLayerKernel::run(), CLComputeMeanVariance::run(), CLBatchToSpaceLayerKernel::run(), CLFuseBatchNormalizationKernel::run(), CLSpaceToBatchLayerKernel::run(), ClElementwiseKernel::run_op(), ClKernelRuntime::run_op(), ClReshapeKernel::run_op(), ClTransposeKernel::run_op(), ClDequantizeKernel::run_op(), ClFloorKernel::run_op(), ClWidthConcatenate2TensorsKernel::run_op(), ClCopyKernel::run_op(), ClElementWiseUnaryKernel::run_op(), ClFillKernel::run_op(), ClHeightConcatenateKernel::run_op(), ClQuantizeKernel::run_op(), ClWidthConcatenateKernel::run_op(), ClScaleKernel::run_op(), ClPool3dKernel::run_op(), ClTransposedConvolutionKernel::run_op(), ClBatchConcatenateKernel::run_op(), ClDepthConcatenateKernel::run_op(), ClActivationKernel::run_op(), ClPermuteKernel::run_op(), ClPool2dKernel::run_op(), ClSoftmaxKernel::run_op(), ClMatMulLowpNativeMMULKernel::run_op(), ClWidthConcatenate4TensorsKernel::run_op(), ClConvertFullyConnectedWeightsKernel::run_op(), ClWinogradFilterTransformKernel::run_op(), ClWinogradInputTransformKernel::run_op(), ClMatMulNativeKernel::run_op(), ClGemmReshapeLhsMatrixKernel::run_op(), ClCastKernel::run_op(), ClMatMulLowpNativeKernel::run_op(), ClCropKernel::run_op(), ClGemmLowpQuantizeDownInt32ScaleByFixedPointKernel::run_op(), ClGemmLowpMatrixMultiplyNativeKernel::run_op(), ClGemmLowpQuantizeDownInt32ScaleByFloatKernel::run_op(), ClIndirectConv2dAddressPrecalculationKernel::run_op(), ClGemmLowpQuantizeDownInt32ScaleKernel::run_op(), ClGemmReshapeRhsMatrixKernel::run_op(), ClWinogradOutputTransformKernel::run_op(), ClCol2ImKernel::run_op(), ClGemmMatrixMultiplyNativeKernel::run_op(), ClGemmLowpMatrixMultiplyReshapedKernel::run_op(), ClIndirectConv2dKernel::run_op(), ClGemmMatrixMultiplyReshapedOnlyRhsMMULKernel::run_op(), CLStridedSliceKernel::run_op(), ClGemmLowpOffsetContributionKernel::run_op(), ClDirectConv3dKernel::run_op(), ClWeightsReshapeKernel::run_op(), ClMatMulNativeMMULKernel::run_op(), ClGemmLowpMatrixAReductionKernel::run_op(), ClDirectConv2dKernel::run_op(), ClGemmLowpOffsetContributionOutputStageKernel::run_op(), ClMulKernel::run_op(), CLFillBorderKernel::run_op(), ClGemmLowpMatrixMultiplyReshapedOnlyRhsKernel::run_op(), ClIm2ColKernel::run_op(), ClGemmMatrixMultiplyReshapedOnlyRhsKernel::run_op(), ClGemmMatrixMultiplyReshapedKernel::run_op(), ClGemmLowpMatrixBReductionKernel::run_op(), and ClComplexMulKernel::run_op().

◆ error_on_channel_not_in()

arm_compute::Status arm_compute::error_on_channel_not_in ( const char *  function,
const char *  file,
const int  line,
cn,
T &&  channel,
Ts &&...  channels 
)
inline

Return an error if the channel is not in channels.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]cnInput channel
[in]channelFirst channel allowed.
[in]channels(Optional) Further allowed channels.
Returns
Status

Definition at line 1036 of file Validate.h.

1037 {
1038  ARM_COMPUTE_RETURN_ERROR_ON_LOC(cn == Channel::UNKNOWN, function, file, line);
1039 
1040  const std::array<T, sizeof...(Ts)> channels_array{{std::forward<Ts>(channels)...}};
1041  ARM_COMPUTE_RETURN_ERROR_ON_LOC(channel != cn && std::none_of(channels_array.begin(), channels_array.end(),
1042  [&](const T &f) { return f == cn; }),
1043  function, file, line);
1044  return arm_compute::Status{};
1045 }

References ARM_COMPUTE_RETURN_ERROR_ON_LOC, and UNKNOWN.

Referenced by error_on_channel_not_in_known_format().

◆ error_on_channel_not_in_known_format()

arm_compute::Status error_on_channel_not_in_known_format ( const char *  function,
const char *  file,
const int  line,
arm_compute::Format  fmt,
arm_compute::Channel  cn 
)

Return an error if the channel is not in format.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]fmtInput channel
[in]cnFirst channel allowed.
Returns
Status

Definition at line 127 of file Validate.cpp.

129 {
132 
133  switch (fmt)
134  {
138  break;
143  break;
147  break;
156  break;
157  default:
158  ARM_COMPUTE_ERROR_LOC(function, file, line, "Not supported format.");
159  }
160  return arm_compute::Status{};
161 }

References A, ARM_COMPUTE_ERROR_LOC, ARM_COMPUTE_RETURN_ERROR_ON_LOC, B, error_on_channel_not_in(), G, IYUV, NV12, NV21, R, RGB888, RGBA8888, U, UNKNOWN, UV88, UYVY422, V, Y, YUV444, and YUYV422.

◆ error_on_coordinates_dimensions_gte()

arm_compute::Status error_on_coordinates_dimensions_gte ( const char *  function,
const char *  file,
const int  line,
const Coordinates pos,
unsigned int  max_dim 
)

Return an error if the passed coordinates have too many dimensions.

The coordinates have too many dimensions if any of the dimensions greater or equal to max_dim is different from 0.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]posCoordinates to validate
[in]max_dimMaximum number of dimensions allowed.
Returns
Status

Definition at line 80 of file Validate.cpp.

82 {
83  for (unsigned int i = max_dim; i < arm_compute::Coordinates::num_max_dimensions; ++i)
84  {
85  ARM_COMPUTE_RETURN_ERROR_ON_LOC(pos[i] != 0, function, file, line);
86  }
87  return arm_compute::Status{};
88 }

References ARM_COMPUTE_RETURN_ERROR_ON_LOC, and Dimensions< int >::num_max_dimensions.

◆ error_on_data_layout_not_in() [1/2]

arm_compute::Status arm_compute::error_on_data_layout_not_in ( const char *  function,
const char *  file,
const int  line,
const ITensor tensor,
T &&  dl,
Ts &&...  dls 
)
inline

Return an error if the data layout of the passed tensor does not match any of the data layout provided.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]tensorTensor to validate.
[in]dlFirst data layout allowed.
[in]dls(Optional) Further allowed data layouts.
Returns
Status

Definition at line 880 of file Validate.h.

882 {
883  ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor == nullptr, function, file, line);
885  function, file, line, tensor->info(), std::forward<T>(dl), std::forward<Ts>(dls)...));
886  return arm_compute::Status{};
887 }

References ARM_COMPUTE_RETURN_ERROR_ON_LOC, ARM_COMPUTE_RETURN_ON_ERROR, dl, error_on_data_layout_not_in(), CLTensor::info(), and tensor.

◆ error_on_data_layout_not_in() [2/2]

arm_compute::Status arm_compute::error_on_data_layout_not_in ( const char *  function,
const char *  file,
const int  line,
const ITensorInfo tensor_info,
T &&  dl,
Ts &&...  dls 
)
inline

Return an error if the data layout of the passed tensor info does not match any of the data layouts provided.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]tensor_infoTensor info to validate.
[in]dlFirst data layout allowed.
[in]dls(Optional) Further allowed data layouts.
Returns
Status

Definition at line 853 of file Validate.h.

855 {
856  ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor_info == nullptr, function, file, line);
857 
858  const DataLayout &tensor_dl = tensor_info->data_layout(); //NOLINT
859  ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor_dl == DataLayout::UNKNOWN, function, file, line);
860 
861  const std::array<T, sizeof...(Ts)> dls_array{{std::forward<Ts>(dls)...}};
863  tensor_dl != dl && std::none_of(dls_array.begin(), dls_array.end(), [&](const T &l) { return l == tensor_dl; }),
864  function, file, line, "ITensor data layout %s not supported by this kernel",
865  string_from_data_layout(tensor_dl).c_str());
866  return arm_compute::Status{};
867 }

References ARM_COMPUTE_RETURN_ERROR_ON_LOC, ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG_VAR, TensorInfo::data_layout(), dl, string_from_data_layout(), tensor_info, and UNKNOWN.

Referenced by error_on_data_layout_not_in().

◆ error_on_data_type_channel_not_in() [1/2]

arm_compute::Status arm_compute::error_on_data_type_channel_not_in ( const char *  function,
const char *  file,
const int  line,
const ITensor tensor,
size_t  num_channels,
T &&  dt,
Ts &&...  dts 
)
inline

Return an error if the data type or the number of channels of the passed tensor does not match any of the data types and number of channels provided.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]tensorTensor to validate.
[in]num_channelsNumber of channels to check
[in]dtFirst data type allowed.
[in]dts(Optional) Further allowed data types.
Returns
Status

Definition at line 936 of file Validate.h.

943 {
944  ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor == nullptr, function, file, line);
945  ARM_COMPUTE_RETURN_ON_ERROR(error_on_data_type_channel_not_in(function, file, line, tensor->info(), num_channels,
946  std::forward<T>(dt), std::forward<Ts>(dts)...));
947  return arm_compute::Status{};
948 }

References ARM_COMPUTE_RETURN_ERROR_ON_LOC, ARM_COMPUTE_RETURN_ON_ERROR, dt, error_on_data_type_channel_not_in(), CLTensor::info(), and tensor.

◆ error_on_data_type_channel_not_in() [2/2]

arm_compute::Status arm_compute::error_on_data_type_channel_not_in ( const char *  function,
const char *  file,
const int  line,
const ITensorInfo tensor_info,
size_t  num_channels,
T &&  dt,
Ts &&...  dts 
)
inline

Return an error if the data type or the number of channels of the passed tensor info does not match any of the data types and number of channels provided.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]tensor_infoTensor info to validate.
[in]num_channelsNumber of channels to check
[in]dtFirst data type allowed.
[in]dts(Optional) Further allowed data types.
Returns
Status

Definition at line 907 of file Validate.h.

914 {
916  function, file, line, tensor_info, std::forward<T>(dt), std::forward<Ts>(dts)...));
917  const size_t tensor_nc = tensor_info->num_channels();
918  ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG_VAR(tensor_nc != num_channels, function, file, line,
919  "Number of channels %zu. Required number of channels %zu", tensor_nc,
920  num_channels);
921  return arm_compute::Status{};
922 }

References ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG_VAR, ARM_COMPUTE_RETURN_ON_ERROR, dt, error_on_data_type_not_in(), TensorInfo::num_channels(), and tensor_info.

Referenced by error_on_data_type_channel_not_in().

◆ error_on_data_type_not_in() [1/2]

arm_compute::Status arm_compute::error_on_data_type_not_in ( const char *  function,
const char *  file,
const int  line,
const ITensor tensor,
T &&  dt,
Ts &&...  dts 
)
inline

Return an error if the data type of the passed tensor does not match any of the data types provided.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]tensorTensor to validate.
[in]dtFirst data type allowed.
[in]dts(Optional) Further allowed data types.
Returns
Status

Definition at line 828 of file Validate.h.

830 {
831  ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor == nullptr, function, file, line);
833  function, file, line, tensor->info(), std::forward<T>(dt), std::forward<Ts>(dts)...));
834  return arm_compute::Status{};
835 }

References ARM_COMPUTE_RETURN_ERROR_ON_LOC, ARM_COMPUTE_RETURN_ON_ERROR, dt, error_on_data_type_not_in(), CLTensor::info(), and tensor.

◆ error_on_data_type_not_in() [2/2]

arm_compute::Status arm_compute::error_on_data_type_not_in ( const char *  function,
const char *  file,
const int  line,
const ITensorInfo tensor_info,
T &&  dt,
Ts &&...  dts 
)
inline

Return an error if the data type of the passed tensor info does not match any of the data types provided.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]tensor_infoTensor info to validate.
[in]dtFirst data type allowed.
[in]dts(Optional) Further allowed data types.
Returns
Status

Definition at line 801 of file Validate.h.

803 {
804  ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor_info == nullptr, function, file, line);
805 
806  const DataType &tensor_dt = tensor_info->data_type(); //NOLINT
807  ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor_dt == DataType::UNKNOWN, function, file, line);
808 
809  const std::array<T, sizeof...(Ts)> dts_array{{std::forward<Ts>(dts)...}};
811  tensor_dt != dt && std::none_of(dts_array.begin(), dts_array.end(), [&](const T &d) { return d == tensor_dt; }),
812  function, file, line, "ITensor data type %s not supported by this kernel",
813  string_from_data_type(tensor_dt).c_str());
814  return arm_compute::Status{};
815 }

References ARM_COMPUTE_RETURN_ERROR_ON_LOC, ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG_VAR, TensorInfo::data_type(), dt, string_from_data_type(), tensor_info, and UNKNOWN.

Referenced by error_on_data_type_channel_not_in(), and error_on_data_type_not_in().

◆ error_on_format_not_in()

void arm_compute::error_on_format_not_in ( const char *  function,
const char *  file,
const int  line,
const T *  object,
F &&  format,
Fs &&...  formats 
)

Throw an error if the format of the passed tensor/multi-image does not match any of the formats provided.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]objectTensor/multi-image to validate.
[in]formatFirst format allowed.
[in]formats(Optional) Further allowed formats.

Definition at line 767 of file Validate.h.

769 {
770  ARM_COMPUTE_ERROR_ON_LOC(object == nullptr, function, file, line);
771 
772  Format &&object_format = object->info()->format();
773  ARM_COMPUTE_UNUSED(object_format);
774 
775  ARM_COMPUTE_ERROR_ON_LOC(object_format == Format::UNKNOWN, function, file, line);
776 
777  const std::array<F, sizeof...(Fs)> formats_array{{std::forward<Fs>(formats)...}};
778  ARM_COMPUTE_UNUSED(formats_array);
779 
781  object_format != format &&
782  std::none_of(formats_array.begin(), formats_array.end(), [&](const F &f) { return f == object_format; }),
783  function, file, line, "Format %s not supported by this kernel", string_from_format(object_format).c_str());
784  ARM_COMPUTE_UNUSED(function, format, file, line);
785 }

References ARM_COMPUTE_ERROR_ON_LOC, ARM_COMPUTE_ERROR_ON_LOC_MSG, ARM_COMPUTE_UNUSED, update_supported_ops::format, string_from_format(), and UNKNOWN.

◆ error_on_invalid_subtensor()

arm_compute::Status error_on_invalid_subtensor ( const char *  function,
const char *  file,
const int  line,
const TensorShape parent_shape,
const Coordinates coords,
const TensorShape shape 
)

Return an error if if the coordinates and shape of the subtensor are within the parent tensor.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]parent_shapeParent tensor shape
[in]coordsCoordinates inside the parent tensor where the first element of the subtensor is
[in]shapeShape of the subtensor
Returns
Status

Definition at line 174 of file Validate.cpp.

180 {
181  // Check dimensions
182  for (unsigned int i = 0; i < TensorShape::num_max_dimensions; ++i)
183  {
184  const bool invalid_idx = coords[i] >= static_cast<int>(parent_shape[i]);
185  const bool out_of_bounds_size = coords[i] + static_cast<int>(shape[i]) > static_cast<int>(parent_shape[i]);
186  ARM_COMPUTE_RETURN_ERROR_ON_LOC(invalid_idx || out_of_bounds_size, function, file, line);
187  }
188  return arm_compute::Status{};
189 }

References ARM_COMPUTE_RETURN_ERROR_ON_LOC, and arm_compute::test::validation::shape.

◆ error_on_invalid_subtensor_valid_region()

arm_compute::Status error_on_invalid_subtensor_valid_region ( const char *  function,
const char *  file,
const int  line,
const ValidRegion parent_valid_region,
const ValidRegion valid_region 
)

Return an error if the valid region of a subtensor is not inside the valid region of the parent tensor.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]parent_valid_regionParent valid region.
[in]valid_regionValid region of subtensor.
Returns
Status

Definition at line 191 of file Validate.cpp.

196 {
197  // Check valid regions
198  for (unsigned int d = 0; d < TensorShape::num_max_dimensions; ++d)
199  {
200  ARM_COMPUTE_RETURN_ERROR_ON_LOC((parent_valid_region.anchor[d] > valid_region.anchor[d]), function, file, line);
202  (parent_valid_region.anchor[d] + static_cast<int>(parent_valid_region.shape[d])) <
203  (valid_region.anchor[d] + static_cast<int>(valid_region.shape[d])),
204  function, file, line);
205  }
206 
207  return arm_compute::Status{};
208 }

References ValidRegion::anchor, ARM_COMPUTE_RETURN_ERROR_ON_LOC, ValidRegion::shape, and arm_compute::test::validation::valid_region.

◆ error_on_invalid_subwindow()

arm_compute::Status error_on_invalid_subwindow ( const char *  function,
const char *  file,
const int  line,
const Window full,
const Window sub 
)

Return an error if the passed subwindow is invalid.

The subwindow is invalid if:

  • It is not a valid window.
  • It is not fully contained inside the full window
  • The step for each of its dimension is not identical to the corresponding one of the full window.
Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]fullFull size window
[in]subSub-window to validate.
Returns
Status

Definition at line 44 of file Validate.cpp.

49 {
50  full.validate();
51  sub.validate();
52 
53  for (size_t i = 0; i < arm_compute::Coordinates::num_max_dimensions; ++i)
54  {
55  ARM_COMPUTE_RETURN_ERROR_ON_LOC(full[i].start() > sub[i].start(), function, file, line);
56  ARM_COMPUTE_RETURN_ERROR_ON_LOC(full[i].end() < sub[i].end(), function, file, line);
57  ARM_COMPUTE_RETURN_ERROR_ON_LOC(full[i].step() != sub[i].step(), function, file, line);
58  ARM_COMPUTE_RETURN_ERROR_ON_LOC((sub[i].start() - full[i].start()) % sub[i].step(), function, file, line);
59  }
60  return arm_compute::Status{};
61 }

References ARM_COMPUTE_RETURN_ERROR_ON_LOC, arm_compute::mlgo::parser::end(), Dimensions< int >::num_max_dimensions, arm_compute::cpu::step, and Window::validate().

◆ error_on_mismatching_data_layouts() [1/2]

arm_compute::Status arm_compute::error_on_mismatching_data_layouts ( const char *  function,
const char *  file,
const int  line,
const ITensor tensor,
Ts...  tensors 
)
inline

Return an error if the passed tensors have different data layouts.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]tensorThe first tensor to be compared.
[in]tensors(Optional) Further allowed tensors.
Returns
Status

Definition at line 613 of file Validate.h.

615 {
616  ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor == nullptr, function, file, line);
617  ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_nullptr(function, file, line, std::forward<Ts>(tensors)...));
619  function, file, line, tensor->info(), detail::get_tensor_info_t<ITensorInfo *>()(tensors)...));
620  return arm_compute::Status{};
621 }

References ARM_COMPUTE_RETURN_ERROR_ON_LOC, ARM_COMPUTE_RETURN_ON_ERROR, error_on_mismatching_data_layouts(), error_on_nullptr(), CLTensor::info(), and tensor.

◆ error_on_mismatching_data_layouts() [2/2]

arm_compute::Status arm_compute::error_on_mismatching_data_layouts ( const char *  function,
const char *  file,
const int  line,
const ITensorInfo tensor_info,
Ts...  tensor_infos 
)
inline

Return an error if the passed tensor infos have different data layouts.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]tensor_infoThe first tensor info to be compared.
[in]tensor_infos(Optional) Further allowed tensor infos.
Returns
Status

Definition at line 588 of file Validate.h.

590 {
591  ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor_info == nullptr, function, file, line);
592  ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_nullptr(function, file, line, tensor_infos...));
593 
594  DataLayout &&tensor_data_layout = tensor_info->data_layout();
595  const std::array<const ITensorInfo *, sizeof...(Ts)> tensors_infos_array{{tensor_infos...}};
596  ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG(std::any_of(tensors_infos_array.begin(), tensors_infos_array.end(),
597  [&](const ITensorInfo *tensor_info_obj)
598  { return tensor_info_obj->data_layout() != tensor_data_layout; }),
599  function, file, line, "Tensors have different data layouts");
600  return arm_compute::Status{};
601 }

References ARM_COMPUTE_RETURN_ERROR_ON_LOC, ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG, ARM_COMPUTE_RETURN_ON_ERROR, TensorInfo::data_layout(), error_on_nullptr(), and tensor_info.

Referenced by error_on_mismatching_data_layouts().

◆ error_on_mismatching_data_types() [1/2]

arm_compute::Status arm_compute::error_on_mismatching_data_types ( const char *  function,
const char *  file,
const int  line,
const ITensor tensor,
Ts...  tensors 
)
inline

Return an error if the passed two tensors have different data types.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]tensorThe first tensor to be compared.
[in]tensors(Optional) Further allowed tensors.
Returns
Status

Definition at line 665 of file Validate.h.

667 {
668  ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor == nullptr, function, file, line);
669  ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_nullptr(function, file, line, tensors...));
671  function, file, line, tensor->info(), detail::get_tensor_info_t<ITensorInfo *>()(tensors)...));
672  return arm_compute::Status{};
673 }

References ARM_COMPUTE_RETURN_ERROR_ON_LOC, ARM_COMPUTE_RETURN_ON_ERROR, error_on_mismatching_data_types(), error_on_nullptr(), CLTensor::info(), and tensor.

◆ error_on_mismatching_data_types() [2/2]

arm_compute::Status arm_compute::error_on_mismatching_data_types ( const char *  function,
const char *  file,
const int  line,
const ITensorInfo tensor_info,
Ts...  tensor_infos 
)
inline

Return an error if the passed two tensor infos have different data types.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]tensor_infoThe first tensor info to be compared.
[in]tensor_infos(Optional) Further allowed tensor infos.
Returns
Status

Definition at line 640 of file Validate.h.

642 {
643  ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor_info == nullptr, function, file, line);
644  ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_nullptr(function, file, line, tensor_infos...));
645 
646  DataType &&tensor_data_type = tensor_info->data_type();
647  const std::array<const ITensorInfo *, sizeof...(Ts)> tensors_infos_array{{tensor_infos...}};
648  ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG(std::any_of(tensors_infos_array.begin(), tensors_infos_array.end(),
649  [&](const ITensorInfo *tensor_info_obj)
650  { return tensor_info_obj->data_type() != tensor_data_type; }),
651  function, file, line, "Tensors have different data types");
652  return arm_compute::Status{};
653 }

References ARM_COMPUTE_RETURN_ERROR_ON_LOC, ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG, ARM_COMPUTE_RETURN_ON_ERROR, TensorInfo::data_type(), error_on_nullptr(), and tensor_info.

Referenced by error_on_mismatching_data_types().

◆ error_on_mismatching_dimensions()

arm_compute::Status arm_compute::error_on_mismatching_dimensions ( const char *  function,
const char *  file,
int  line,
const Dimensions< T > &  dim1,
const Dimensions< T > &  dim2,
Ts &&...  dims 
)

Return an error if the passed dimension objects differ.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]dim1The first object to be compared.
[in]dim2The second object to be compared.
[in]dims(Optional) Further allowed objects.
Returns
Status

Definition at line 280 of file Validate.h.

286 {
287  ARM_COMPUTE_RETURN_ON_ERROR(detail::for_each_error(detail::compare_dimension<T>(dim1, function, file, line), dim2,
288  std::forward<Ts>(dims)...));
289  return arm_compute::Status{};
290 }

References ARM_COMPUTE_RETURN_ON_ERROR, and arm_compute::detail::for_each_error().

◆ error_on_mismatching_quantization_info() [1/2]

arm_compute::Status arm_compute::error_on_mismatching_quantization_info ( const char *  function,
const char *  file,
const int  line,
const ITensor tensor_1,
const ITensor tensor_2,
Ts...  tensors 
)
inline

Return an error if the passed tensor have different asymmetric quantized data types or different quantization info.

Note
: If the first tensor doesn't have asymmetric quantized data type, the function returns without throwing an error
Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]tensor_1The first tensor to be compared.
[in]tensor_2The second tensor to be compared.
[in]tensors(Optional) Further allowed tensors.
Returns
Status

Definition at line 738 of file Validate.h.

744 {
746  ::arm_compute::error_on_mismatching_quantization_info(function, file, line, tensor_1->info(), tensor_2->info(),
747  detail::get_tensor_info_t<ITensorInfo *>()(tensors)...));
748  return arm_compute::Status{};
749 }

References ARM_COMPUTE_RETURN_ON_ERROR, error_on_mismatching_quantization_info(), and ITensor::info().

◆ error_on_mismatching_quantization_info() [2/2]

arm_compute::Status arm_compute::error_on_mismatching_quantization_info ( const char *  function,
const char *  file,
const int  line,
const ITensorInfo tensor_info_1,
const ITensorInfo tensor_info_2,
Ts...  tensor_infos 
)
inline

Return an error if the passed tensor infos have different asymmetric quantized data types or different quantization info.

Note
: If the first tensor info doesn't have asymmetric quantized data type, the function returns without throwing an error
Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]tensor_info_1The first tensor info to be compared.
[in]tensor_info_2The second tensor info to be compared.
[in]tensor_infos(Optional) Further allowed tensor infos.
Returns
Status

Definition at line 695 of file Validate.h.

701 {
702  DataType &&first_data_type = tensor_info_1->data_type();
703  const QuantizationInfo first_quantization_info = tensor_info_1->quantization_info();
704 
705  if (!is_data_type_quantized(first_data_type))
706  {
707  return arm_compute::Status{};
708  }
709 
710  const std::array<const ITensorInfo *, 1 + sizeof...(Ts)> tensor_infos_array{
711  {tensor_info_2, std::forward<Ts>(tensor_infos)...}};
712  ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG(std::any_of(tensor_infos_array.begin(), tensor_infos_array.end(),
713  [&](const ITensorInfo *tensor_info)
714  { return tensor_info->data_type() != first_data_type; }),
715  function, file, line, "Tensors have different asymmetric quantized data types");
717  std::any_of(tensor_infos_array.begin(), tensor_infos_array.end(),
718  [&](const ITensorInfo *tensor_info)
719  { return tensor_info->quantization_info() != first_quantization_info; }),
720  function, file, line, "Tensors have different quantization information");
721 
722  return arm_compute::Status{};
723 }

References ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG, ITensorInfo::data_type(), is_data_type_quantized(), ITensorInfo::quantization_info(), and tensor_info.

Referenced by error_on_mismatching_quantization_info().

◆ error_on_mismatching_shapes() [1/4]

arm_compute::Status arm_compute::error_on_mismatching_shapes ( const char *  function,
const char *  file,
const int  line,
const ITensor tensor_1,
const ITensor tensor_2,
Ts...  tensors 
)
inline

Return an error if the passed two tensors have different shapes from the given dimension.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]tensor_1The first tensor to be compared.
[in]tensor_2The second tensor to be compared.
[in]tensors(Optional) Further allowed tensors.
Returns
Status

Definition at line 497 of file Validate.h.

503 {
504  return error_on_mismatching_shapes(function, file, line, 0U, tensor_1, tensor_2, std::forward<Ts>(tensors)...);
505 }

References error_on_mismatching_shapes(), and arm_compute::utils::cast::U.

◆ error_on_mismatching_shapes() [2/4]

arm_compute::Status arm_compute::error_on_mismatching_shapes ( const char *  function,
const char *  file,
const int  line,
const ITensorInfo tensor_info_1,
const ITensorInfo tensor_info_2,
Ts...  tensor_infos 
)
inline

Return an error if the passed two tensor infos have different shapes from the given dimension.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]tensor_info_1The first tensor info to be compared.
[in]tensor_info_2The second tensor info to be compared.
[in]tensor_infos(Optional) Further allowed tensor infos.
Returns
Status

Definition at line 475 of file Validate.h.

481 {
482  return error_on_mismatching_shapes(function, file, line, 0U, tensor_info_1, tensor_info_2,
483  std::forward<Ts>(tensor_infos)...);
484 }

References arm_compute::utils::cast::U.

Referenced by error_on_mismatching_shapes().

◆ error_on_mismatching_shapes() [3/4]

arm_compute::Status arm_compute::error_on_mismatching_shapes ( const char *  function,
const char *  file,
const int  line,
unsigned int  upper_dim,
const ITensor tensor_1,
const ITensor tensor_2,
Ts...  tensors 
)
inline

Return an error if the passed two tensors have different shapes from the given dimension.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]upper_dimThe dimension from which to check.
[in]tensor_1The first tensor to be compared.
[in]tensor_2The second tensor to be compared.
[in]tensors(Optional) Further allowed tensors.
Returns
Status

Definition at line 556 of file Validate.h.

563 {
564  ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor_1 == nullptr, function, file, line);
565  ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor_2 == nullptr, function, file, line);
566  ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_nullptr(function, file, line, tensors...));
568  ::arm_compute::error_on_mismatching_shapes(function, file, line, upper_dim, tensor_1->info(), tensor_2->info(),
569  detail::get_tensor_info_t<ITensorInfo *>()(tensors)...));
570  return arm_compute::Status{};
571 }

References ARM_COMPUTE_RETURN_ERROR_ON_LOC, ARM_COMPUTE_RETURN_ON_ERROR, error_on_mismatching_shapes(), error_on_nullptr(), and ITensor::info().

◆ error_on_mismatching_shapes() [4/4]

arm_compute::Status arm_compute::error_on_mismatching_shapes ( const char *  function,
const char *  file,
const int  line,
unsigned int  upper_dim,
const ITensorInfo tensor_info_1,
const ITensorInfo tensor_info_2,
Ts...  tensor_infos 
)
inline

Return an error if the passed two tensors have different shapes from the given dimension.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]upper_dimThe dimension from which to check.
[in]tensor_info_1The first tensor info to be compared.
[in]tensor_info_2The second tensor info to be compared.
[in]tensor_infos(Optional) Further allowed tensor infos.
Returns
Status

Definition at line 519 of file Validate.h.

526 {
527  ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor_info_1 == nullptr, function, file, line);
528  ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor_info_2 == nullptr, function, file, line);
529  ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_nullptr(function, file, line, tensor_infos...));
530 
531  const std::array<const ITensorInfo *, 2 + sizeof...(Ts)> tensors_info_array{
532  {tensor_info_1, tensor_info_2, tensor_infos...}};
533  ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG(std::any_of(std::next(tensors_info_array.cbegin()), tensors_info_array.cend(),
534  [&](const ITensorInfo *tensor_info)
535  {
536  return detail::have_different_dimensions(
537  (*tensors_info_array.cbegin())->tensor_shape(),
538  tensor_info->tensor_shape(), upper_dim);
539  }),
540  function, file, line, "Tensors have different shapes");
541  return arm_compute::Status{};
542 }

References ARM_COMPUTE_RETURN_ERROR_ON_LOC, ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG, ARM_COMPUTE_RETURN_ON_ERROR, error_on_nullptr(), and tensor_info.

◆ error_on_mismatching_windows()

arm_compute::Status error_on_mismatching_windows ( const char *  function,
const char *  file,
const int  line,
const Window full,
const Window win 
)

Return an error if the passed window is invalid.

The subwindow is invalid if:

  • It is not a valid window.
  • Its dimensions don't match the full window's ones
  • The step for each of its dimension is not identical to the corresponding one of the full window.
Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]fullFull size window
[in]winWindow to validate.
Returns
Status

Definition at line 26 of file Validate.cpp.

31 {
32  full.validate();
33  win.validate();
34 
35  for (size_t i = 0; i < arm_compute::Coordinates::num_max_dimensions; ++i)
36  {
37  ARM_COMPUTE_RETURN_ERROR_ON_LOC(full[i].start() != win[i].start(), function, file, line);
38  ARM_COMPUTE_RETURN_ERROR_ON_LOC(full[i].end() != win[i].end(), function, file, line);
39  ARM_COMPUTE_RETURN_ERROR_ON_LOC(full[i].step() != win[i].step(), function, file, line);
40  }
41  return arm_compute::Status{};
42 }

References ARM_COMPUTE_RETURN_ERROR_ON_LOC, arm_compute::mlgo::parser::end(), Dimensions< int >::num_max_dimensions, arm_compute::cpu::step, and Window::validate().

◆ error_on_nullptr()

arm_compute::Status arm_compute::error_on_nullptr ( const char *  function,
const char *  file,
const int  line,
Ts &&...  pointers 
)
inline

Create an error if one of the pointers is a nullptr.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]pointersPointers to check against nullptr.
Returns
Status

Definition at line 151 of file Validate.h.

152 {
153  const std::array<const void *, sizeof...(Ts)> pointers_array{{std::forward<Ts>(pointers)...}};
154  bool has_nullptr =
155  std::any_of(pointers_array.begin(), pointers_array.end(), [&](const void *ptr) { return (ptr == nullptr); });
156  ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG(has_nullptr, function, file, line, "Nullptr object!");
157  return arm_compute::Status{};
158 }

References ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG.

Referenced by error_on_mismatching_data_layouts(), error_on_mismatching_data_types(), error_on_mismatching_shapes(), error_on_tensors_not_even(), and error_on_tensors_not_subsampled().

◆ error_on_tensor_not_2d() [1/2]

arm_compute::Status error_on_tensor_not_2d ( const char *  function,
const char *  file,
const int  line,
const ITensor tensor 
)

Return an error if the tensor is not 2D.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]tensorTensor to validate.
Returns
Status

Definition at line 102 of file Validate.cpp.

106 {
107  ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor == nullptr, function, file, line);
108  ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor->info() == nullptr, function, file, line);
109  ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG_VAR(tensor->info()->num_dimensions() != 2, function, file, line,
110  "Only 2D Tensors are supported by this kernel (%zu passed)",
111  tensor->info()->num_dimensions());
112  return arm_compute::Status{};
113 }

References ARM_COMPUTE_RETURN_ERROR_ON_LOC, ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG_VAR, and tensor.

◆ error_on_tensor_not_2d() [2/2]

arm_compute::Status error_on_tensor_not_2d ( const char *  function,
const char *  file,
const int  line,
const ITensorInfo tensor 
)

Return an error if the tensor info is not 2D.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]tensorTensor info to validate.
Returns
Status

Definition at line 115 of file Validate.cpp.

119 {
120  ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor == nullptr, function, file, line);
121  ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG_VAR(tensor->num_dimensions() != 2, function, file, line,
122  "Only 2D Tensors are supported by this kernel (%zu passed)",
123  tensor->num_dimensions());
124  return arm_compute::Status{};
125 }

References ARM_COMPUTE_RETURN_ERROR_ON_LOC, ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG_VAR, and tensor.

◆ error_on_tensors_not_even()

arm_compute::Status arm_compute::error_on_tensors_not_even ( const char *  function,
const char *  file,
int  line,
const Format format,
const ITensor tensor1,
Ts...  tensors 
)

Return an error if the passed tensor objects are not even.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]formatFormat to check if odd shape is allowed
[in]tensor1The first object to be compared for odd shape.
[in]tensors(Optional) Further allowed objects.
Returns
Status

Definition at line 369 of file Validate.h.

371 {
372  ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor1 == nullptr, function, file, line);
373  ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_nullptr(function, file, line, std::forward<Ts>(tensors)...));
374  const std::array<const ITensor *, 1 + sizeof...(Ts)> tensors_info_array{{tensor1, std::forward<Ts>(tensors)...}};
376  std::any_of(tensors_info_array.cbegin(), tensors_info_array.cend(),
377  [&](const ITensor *tensor)
378  {
379  const TensorShape correct_shape = adjust_odd_shape(tensor->info()->tensor_shape(), format);
380  return detail::have_different_dimensions(tensor->info()->tensor_shape(), correct_shape, 2);
381  }),
382  function, file, line, "Tensor shape has odd dimensions");
383  return arm_compute::Status{};
384 }

References ARM_COMPUTE_RETURN_ERROR_ON_LOC, ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG, ARM_COMPUTE_RETURN_ON_ERROR, error_on_nullptr(), and tensor.

◆ error_on_tensors_not_subsampled()

arm_compute::Status arm_compute::error_on_tensors_not_subsampled ( const char *  function,
const char *  file,
int  line,
const Format format,
const TensorShape shape,
const ITensor tensor1,
Ts...  tensors 
)

Return an error if the passed tensor objects are not sub-sampled.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]formatFormat to check if sub-sampling allowed.
[in]shapeThe tensor shape to calculate sub-sampling from.
[in]tensor1The first object to be compared.
[in]tensors(Optional) Further allowed objects.
Returns
Status

Definition at line 436 of file Validate.h.

443 {
444  ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor1 == nullptr, function, file, line);
445  ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_nullptr(function, file, line, std::forward<Ts>(tensors)...));
446  const TensorShape sub2_shape = calculate_subsampled_shape(shape, format);
447  const std::array<const ITensor *, 1 + sizeof...(Ts)> tensors_info_array{{tensor1, std::forward<Ts>(tensors)...}};
449  std::any_of(tensors_info_array.cbegin(), tensors_info_array.cend(),
450  [&](const ITensor *tensor)
451  { return detail::have_different_dimensions(tensor->info()->tensor_shape(), sub2_shape, 2); }),
452  function, file, line, "Tensor shape has mismatch dimensions for sub-sampling");
453  return arm_compute::Status{};
454 }

References ARM_COMPUTE_RETURN_ERROR_ON_LOC, ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG, ARM_COMPUTE_RETURN_ON_ERROR, calculate_subsampled_shape(), error_on_nullptr(), update_supported_ops::format, arm_compute::test::validation::shape, and tensor.

◆ error_on_unconfigured_kernel()

arm_compute::Status error_on_unconfigured_kernel ( const char *  function,
const char *  file,
const int  line,
const IKernel kernel 
)

Return an error if the kernel is not configured.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]kernelKernel to validate.
Returns
Status

Definition at line 163 of file Validate.cpp.

167 {
168  ARM_COMPUTE_RETURN_ERROR_ON_LOC(kernel == nullptr, function, file, line);
169  ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG(!kernel->is_window_configured(), function, file, line,
170  "This kernel hasn't been configured.");
171  return arm_compute::Status{};
172 }

References ARM_COMPUTE_RETURN_ERROR_ON_LOC, ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG, and IKernel::is_window_configured().

◆ error_on_unsupported_cpu_bf16() [1/2]

Status arm_compute::error_on_unsupported_cpu_bf16 ( const char *  function,
const char *  file,
const int  line,
const ITensor tensor 
)
inline

Return an error if the data type of the passed tensor is BFLOAT16 and BFLOAT16 support is not compiled in.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]tensorTensor to validate.
Returns
Status

Definition at line 107 of file Validate.h.

108 {
109  ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor == nullptr, function, file, line);
111  return Status{};
112 }

References ARM_COMPUTE_RETURN_ERROR_ON_LOC, ARM_COMPUTE_RETURN_ON_ERROR, error_on_unsupported_cpu_bf16(), CLTensor::info(), and tensor.

◆ error_on_unsupported_cpu_bf16() [2/2]

Status arm_compute::error_on_unsupported_cpu_bf16 ( const char *  function,
const char *  file,
const int  line,
const ITensorInfo tensor_info 
)
inline

Return an error if the data type of the passed tensor info is BFLOAT16 and BFLOAT16 support is not compiled in.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]tensor_infoTensor info to validate.
Returns
Status

Definition at line 66 of file Validate.h.

67 {
68  bool bf16_kernels_enabled = false;
69 #if defined(ARM_COMPUTE_ENABLE_BF16)
70  bf16_kernels_enabled = true;
71 #endif /* defined(ARM_COMPUTE_ENABLE_BF16) */
72 
73  ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor_info == nullptr, function, file, line);
75  (tensor_info->data_type() == DataType::BFLOAT16) && (!CPUInfo::get().has_bf16() || !bf16_kernels_enabled),
76  function, file, line, "This CPU architecture does not support BFloat16 data type, you need v8.6 or above");
77  return Status{};
78 }

References ARM_COMPUTE_RETURN_ERROR_ON_LOC, ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG, BFLOAT16, TensorInfo::data_type(), CPUInfo::get(), CPUInfo::has_bf16(), and tensor_info.

Referenced by error_on_unsupported_cpu_bf16().

◆ error_on_unsupported_cpu_fp16() [1/2]

Status arm_compute::error_on_unsupported_cpu_fp16 ( const char *  function,
const char *  file,
const int  line,
const ITensor tensor 
)
inline

Return an error if the data type of the passed tensor is FP16 and FP16 support is not compiled in.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]tensorTensor to validate.
Returns
Status

Definition at line 90 of file Validate.h.

91 {
92  ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor == nullptr, function, file, line);
94  return Status{};
95 }

References ARM_COMPUTE_RETURN_ERROR_ON_LOC, ARM_COMPUTE_RETURN_ON_ERROR, error_on_unsupported_cpu_fp16(), CLTensor::info(), and tensor.

◆ error_on_unsupported_cpu_fp16() [2/2]

Status arm_compute::error_on_unsupported_cpu_fp16 ( const char *  function,
const char *  file,
const int  line,
const ITensorInfo tensor_info 
)
inline

Return an error if the data type of the passed tensor info is FP16 and FP16 support is not compiled in.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]tensor_infoTensor info to validate.
Returns
Status

Definition at line 42 of file Validate.h.

43 {
44  bool fp16_kernels_enabled = false;
45 #if defined(ARM_COMPUTE_ENABLE_FP16) && defined(ENABLE_FP16_KERNELS)
46  fp16_kernels_enabled = true;
47 #endif /* defined(ARM_COMPUTE_ENABLE_FP16) && defined(ENABLE_FP16_KERNELS) */
48 
49  ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor_info == nullptr, function, file, line);
51  (tensor_info->data_type() == DataType::F16) && (!CPUInfo::get().has_fp16() || !fp16_kernels_enabled), function,
52  file, line, "This CPU architecture does not support F16 data type, you need v8.2 or above");
53  return Status{};
54 }

References ARM_COMPUTE_RETURN_ERROR_ON_LOC, ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG, TensorInfo::data_type(), F16, CPUInfo::get(), CPUInfo::has_fp16(), and tensor_info.

Referenced by error_on_unsupported_cpu_fp16().

◆ error_on_unsupported_fp16() [1/2]

arm_compute::Status arm_compute::error_on_unsupported_fp16 ( const char *  function,
const char *  file,
const int  line,
const ITensor tensor,
bool  is_fp16_supported 
)
inline

Return an error if the data type of the passed tensor is FP16 and FP16 extension is not supported by the device.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]tensorTensor to validate.
[in]is_fp16_supportedIs fp16 supported by the device.
Returns
Status

Definition at line 985 of file Validate.h.

987 {
988  ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor == nullptr, function, file, line);
990  ::arm_compute::error_on_unsupported_fp16(function, file, line, tensor->info(), is_fp16_supported));
991  return arm_compute::Status{};
992 }

References ARM_COMPUTE_RETURN_ERROR_ON_LOC, ARM_COMPUTE_RETURN_ON_ERROR, error_on_unsupported_fp16(), CLTensor::info(), and tensor.

◆ error_on_unsupported_fp16() [2/2]

arm_compute::Status arm_compute::error_on_unsupported_fp16 ( const char *  function,
const char *  file,
const int  line,
const ITensorInfo tensor_info,
bool  is_fp16_supported 
)
inline

Return an error if the data type of the passed tensor info is FP16 and FP16 extension is not supported by the device.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]tensor_infoTensor info to validate.
[in]is_fp16_supportedIs fp16 supported by the device.
Returns
Status

Definition at line 966 of file Validate.h.

968 {
969  ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor_info == nullptr, function, file, line);
970  ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG((tensor_info->data_type() == DataType::F16 && !is_fp16_supported), function,
971  file, line, "FP16 not supported by the device");
972  return arm_compute::Status{};
973 }

References ARM_COMPUTE_RETURN_ERROR_ON_LOC, ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG, TensorInfo::data_type(), F16, and tensor_info.

Referenced by error_on_unsupported_fp16().

◆ error_on_unsupported_int64_base_atomics()

arm_compute::Status arm_compute::error_on_unsupported_int64_base_atomics ( const char *  function,
const char *  file,
const int  line 
)
inline

Return an error if int64_base_atomics extension is not supported by the device.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
Returns
Status

Definition at line 49 of file CLValidate.h.

50 {
51  if (!CLKernelLibrary::get().int64_base_atomics_supported())
52  {
54  "Atomic functions are not supported");
55  }
56  return arm_compute::Status{};
57 }

References ARM_COMPUTE_CREATE_ERROR_LOC, CLKernelLibrary::get(), and UNSUPPORTED_EXTENSION_USE.

◆ error_on_window_dimensions_gte()

arm_compute::Status error_on_window_dimensions_gte ( const char *  function,
const char *  file,
const int  line,
const Window win,
unsigned int  max_dim 
)

Return an error if the passed window has too many dimensions.

The window has too many dimensions if any of the dimension greater or equal to max_dim is different from 0.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]winWindow to validate
[in]max_dimMaximum number of dimensions allowed.
Returns
Status

Definition at line 90 of file Validate.cpp.

92 {
93  for (unsigned int i = max_dim; i < arm_compute::Coordinates::num_max_dimensions; ++i)
94  {
96  (win[i].start() != 0) || (win[i].end() != win[i].step()), function, file, line,
97  "Maximum number of dimensions expected %u but dimension %u is not empty", max_dim, i);
98  }
99  return arm_compute::Status{};
100 }

References ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG_VAR, arm_compute::mlgo::parser::end(), Dimensions< int >::num_max_dimensions, and arm_compute::cpu::step.

◆ error_on_window_not_collapsable_at_dimension()

arm_compute::Status error_on_window_not_collapsable_at_dimension ( const char *  function,
const char *  file,
const int  line,
const Window full,
const Window window,
const int  dim 
)

Return an error if the window can't be collapsed at the given dimension.

The window cannot be collapsed if the given dimension not equal to the full window's dimension or not start from 0.

Parameters
[in]functionFunction in which the error occurred.
[in]fileName of the file where the error occurred.
[in]lineLine on which the error occurred.
[in]fullFull size window
[in]windowWindow to be collapsed.
[in]dimDimension need to be checked.
Returns
Status

Definition at line 63 of file Validate.cpp.

69 {
70  full.validate();
71  window.validate();
72 
73  ARM_COMPUTE_RETURN_ERROR_ON_LOC(window[dim].start() != 0, function, file, line);
74  ARM_COMPUTE_RETURN_ERROR_ON_LOC(window[dim].start() != full[dim].start(), function, file, line);
75  ARM_COMPUTE_RETURN_ERROR_ON_LOC(full[dim].end() != window[dim].end(), function, file, line);
76 
77  return arm_compute::Status{};
78 }

References ARM_COMPUTE_RETURN_ERROR_ON_LOC, arm_compute::mlgo::parser::end(), and Window::validate().

◆ execute_window_loop()

void execute_window_loop ( const Window w,
L &&  lambda_function,
Ts &&...  iterators 
)
inline

Iterate through the passed window, automatically adjusting the iterators and calling the lambda_functino for each element.

It passes the x and y positions to the lambda_function for each iteration

Parameters
[in]wWindow to iterate through.
[in]lambda_functionThe function of type void(function)( const Coordinates & id ) to call at each iteration. Where id represents the absolute coordinates of the item to process.
[in,out]iteratorsTensor iterators which will be updated by this function before calling lambda_function.

Definition at line 74 of file Helpers.inl.

75 {
76  w.validate();
77 
78  for (unsigned int i = 0; i < Coordinates::num_max_dimensions; ++i)
79  {
80  ARM_COMPUTE_ERROR_ON(w[i].step() == 0);
81  }
82 
83  Coordinates id;
84  ForEachDimension<Coordinates::num_max_dimensions>::unroll(w, id, std::forward<L>(lambda_function),
85  std::forward<Ts>(iterators)...);
86 }

References ARM_COMPUTE_ERROR_ON, Dimensions< int >::num_max_dimensions, arm_compute::cpu::step, and arm_compute::test::validation::w.

Referenced by arm_compute::cpu::add_qasymm8_signed_sve2(), arm_compute::cpu::add_qasymm8_sve2(), arm_compute::cpu::add_qsymm16_neon(), arm_compute::cpu::add_qsymm16_sve2(), arm_compute::cpu::add_same_neon(), arm_compute::cpu::add_same_sve(), arm_compute::cpu::add_sub_q8_neon_fixedpoint(), arm_compute::cpu::add_sub_qasymm8_neon(), arm_compute::cpu::add_sub_qasymm8_signed_neon(), arm_compute::cpu::avg_poolingMxNxD_q8_neon_ndhwc(), arm_compute::cpu::batch_normalization_nchw(), arm_compute::cpu::bounding_box_transform(), arm_compute::cpu::bounding_box_transform_qsymm16(), colorconvert_iyuv_to_nv12(), colorconvert_iyuv_to_rgb(), colorconvert_iyuv_to_yuv4(), colorconvert_nv12_to_iyuv(), colorconvert_nv12_to_rgb(), colorconvert_nv12_to_yuv4(), colorconvert_rgb_to_iyuv(), colorconvert_rgb_to_nv12(), colorconvert_rgb_to_rgbx(), colorconvert_rgb_to_u8(), colorconvert_rgb_to_yuv4(), colorconvert_rgbx_to_rgb(), colorconvert_yuyv_to_iyuv(), colorconvert_yuyv_to_nv12(), colorconvert_yuyv_to_rgb(), arm_compute::utils::compare_tensor(), arm_compute::cpu::compute_all_anchors(), arm_compute::cpu::compute_all_anchors_qasymm16(), arm_compute::cpu::kernels::convolve_nchw(), arm_compute::cpu::kernels::convolve_nhwc(), ITensor::copy_from(), arm_compute::cpu::depthwise_loop_generic_fp(), arm_compute::cpu::depthwise_loop_multiplier1_fp(), arm_compute::cpu::directconv3d_float_neon_ndhwc(), arm_compute::cpu::directconv3d_quantized_neon_ndhwc(), arm_compute::cpu::elementwise_arithmetic_op(), arm_compute::cpu::elementwise_arithmetic_quantized_op(), arm_compute::cpu::elementwise_comp_quantized_signed(), arm_compute::cpu::elementwise_comparison_op(), arm_compute::cpu::elementwise_comparison_quantized_op(), arm_compute::cpu::elementwise_op(), arm_compute::cpu::elementwise_op< int8_t >(), arm_compute::cpu::elementwise_op< uint8_t >(), arm_compute::cpu::elementwise_op_quantized(), arm_compute::cpu::elementwise_op_quantized_signed(), arm_compute::cpu::elementwise_sve_op(), AssetsLibrary::fill_borders_with_garbage(), IImageLoader::fill_image(), AssetsLibrary::fill_layer_data(), IImageLoader::fill_planar_tensor(), arm_compute::utils::fill_random_tensor(), NPYLoader::fill_tensor(), arm_compute::utils::fill_tensor_value(), arm_compute::utils::fill_tensor_vector(), arm_compute::cpu::fp_neon_activation_impl(), arm_compute::cpu::fused_batch_normalization_conv(), arm_compute::cpu::fused_batch_normalization_dwc_nchw(), arm_compute::cpu::fused_batch_normalization_dwc_nhwc(), arm_compute::test::validation::reference::gather(), arm_compute::cpu::instance_normalization_nchw(), arm_compute::cpu::l2_normalize_x(), arm_compute::cpu::l2_normalize_yz(), arm_compute::utils::load_trained_data(), arm_compute::cpu::matrix_addition_f32(), arm_compute::cpu::matrix_matrix_multiply_f32(), arm_compute::cpu::max_poolingMxNxD_q8_neon_ndhwc(), arm_compute::cpu::max_unpooling(), arm_compute::cpu::mean_stddev_normalization(), arm_compute::cpu::mul_F32_F32_F32(), arm_compute::cpu::neon_qasymm8_activation(), arm_compute::cpu::neon_qasymm8_meanstddevnorm(), arm_compute::cpu::neon_qasymm8_signed_activation(), arm_compute::cpu::neon_qsymm16_activation(), arm_compute::cpu::neon_range_function(), arm_compute::cpu::neon_softmax_non_x_float(), arm_compute::cpu::neon_softmax_non_x_quantized(), arm_compute::cpu::neon_softmax_x_float(), arm_compute::cpu::neon_softmax_x_quantized(), normalize_float(), arm_compute::cpu::poolingMxN_fp32_neon_nhwc(), arm_compute::cpu::poolingMxN_fp32_neon_nhwc_kernel_indices(), arm_compute::cpu::poolingMxN_q8_neon_nhwc(), CPPUpsampleKernel::run(), NEBitwiseNotKernel::run(), NEBitwiseXorKernel::run(), NEBitwiseAndKernel::run(), NEBitwiseOrKernel::run(), NETileKernel::run(), NESpaceToDepthLayerKernel::run(), NEFFTScaleKernel::run(), NEReorgLayerKernel::run(), NEFFTRadixStageKernel::run(), NEBatchToSpaceLayerKernel::run(), NESpaceToBatchLayerKernel::run(), arm_compute::cpu::kernels::run_im2col(), CpuFillKernel::run_op(), CpuConvertQuantizedSignednessKernel::run_op(), CpuCopyKernel::run_op(), CpuConcatenateHeightKernel::run_op(), CpuConcatenateWidthKernel::run_op(), CpuFloorKernel::run_op(), CpuConvertFullyConnectedWeightsKernel::run_op(), CpuGemmInterleave4x4Kernel::run_op(), CpuCol2ImKernel::run_op(), CpuCastKernel::run_op(), CpuWeightsReshapeKernel::run_op(), CpuGemmTranspose1xWKernel::run_op(), NEStridedSliceKernel::run_op(), run_reverse(), arm_compute::utils::save_to_npy(), arm_compute::utils::save_to_ppm(), arm_compute::cpu::select_op(), arm_compute::test::validation::reference::slice(), arm_compute::test::validation::reference::softmax_layer_generic(), arm_compute::test::validation::reference::strided_slice(), arm_compute::cpu::sub_qsymm16_neon(), arm_compute::cpu::sub_same_neon(), arm_compute::cpu::sve2_q8_elementwise_unary(), arm_compute::cpu::sve2_qasymm8_activation(), arm_compute::cpu::sve2_qasymm8_signed_activation(), arm_compute::cpu::sve2_qsymm16_activation(), arm_compute::cpu::sve2_softmax_logits_1d_quantized(), arm_compute::cpu::sve_fp32_activation(), arm_compute::cpu::sve_logits_1d_max(), arm_compute::cpu::sve_softmax_logits_1d_float(), arm_compute::test::validation::TEST_CASE(), and arm_compute::cpu::vector_matrix_multiply_f32().

◆ export_to_cl_image()

bool export_to_cl_image ( const ITensorInfo tensor)

Definition at line 449 of file CLHelpers.cpp.

450 {
451  if (tensor->tensor_shape()[0] % 4 != 0)
452  {
453  return false;
454  }
455 
456  // If not floating point
457  if (!is_data_type_float(tensor->data_type()))
458  {
459  return false;
460  }
461 
462  // Check if the cl_khr_image2d_from_buffer extension is supported on the target platform
463  if (!image2d_from_buffer_supported(CLKernelLibrary::get().get_device()))
464  {
465  return false;
466  }
467 
468  // Check cl image pitch alignment
469  if (get_cl_image_pitch_alignment(CLKernelLibrary::get().get_device()) == 0)
470  {
471  return false;
472  }
473 
474  const size_t image_w = tensor->tensor_shape()[0] / 4;
475  const size_t image_h = tensor->tensor_shape().total_size() / tensor->tensor_shape()[0];
476  const size_t max_image_w = CLKernelLibrary::get().get_device().getInfo<CL_DEVICE_IMAGE2D_MAX_WIDTH>();
477  const size_t max_image_h = CLKernelLibrary::get().get_device().getInfo<CL_DEVICE_IMAGE2D_MAX_HEIGHT>();
478 
479  if (image_w > max_image_w || image_h > max_image_h)
480  {
481  return false;
482  }
483 
484  return true;
485 }

References CLKernelLibrary::get(), get_cl_image_pitch_alignment(), CLKernelLibrary::get_device(), image2d_from_buffer_supported(), is_data_type_float(), and tensor.

Referenced by arm_compute::opencl::kernels::gemm::configure_lhs_rhs_info(), arm_compute::cl_dwc::use_cl_image_for_weights(), and ClComponentDepthwiseConv2d::validate().

◆ finalize_quantization() [1/4]

int8_t arm_compute::finalize_quantization ( int32_t  in_value,
int  result_fixedpoint_multiplier,
int32_t  result_shift,
int32_t  result_offset_after_shift_s32,
int8_t  min_s8,
int8_t  max_s8,
bool  is_bounded_relu 
)
inline

Performs final quantization step on single element.

Parameters
[in]in_valueInput to be quantized.
[in]result_fixedpoint_multiplierResult multiplier parameter
[in]result_shiftResult shift parameter
[in]result_offset_after_shift_s32Result offset parameter
[in]min_s8Relu lower bound
[in]max_s8Relu upper bound
[in]is_bounded_reluSpecified if a fused bounded relu should be applied
Returns
Quantized value

Definition at line 366 of file NEAsymm.h.

373 {
374  int32x4_t in_s32 = vdupq_n_s32(in_value);
375 
376  if (result_shift < 0)
377  {
378  in_value = vgetq_lane_s32(
379  vqrdmulhq_n_s32(vmulq_n_s32(in_s32, (1 << (-result_shift))), result_fixedpoint_multiplier), 0);
380  }
381  else
382  {
383  // Fixed point multiplication with vector saturating rounding doubling multiply high with scalar
384  in_value = vgetq_lane_s32(vqrdmulhq_n_s32(in_s32, result_fixedpoint_multiplier), 0);
385 
386  // Shift value by result_shift_s32
387  in_value = rounding_divide_by_pow2(in_value, result_shift);
388  }
389 
390  // Add the offset term
391  in_value += result_offset_after_shift_s32;
392 
393  // Bound the result
394  int8_t out_s8 = static_cast<int8_t>(std::max<int32_t>(-128, std::min<int32_t>(127, in_value)));
395  if (is_bounded_relu)
396  {
397  out_s8 = static_cast<int8_t>(std::max(min_s8, std::min(max_s8, out_s8)));
398  }
399 
400  return out_s8;
401 }

References rounding_divide_by_pow2().

◆ finalize_quantization() [2/4]

uint8_t arm_compute::finalize_quantization ( int32_t  in_value,
int  result_fixedpoint_multiplier,
int32_t  result_shift,
int32_t  result_offset_after_shift_s32,
uint8_t  min_u8,
uint8_t  max_u8,
bool  is_bounded_relu 
)
inline

Performs final quantization step on single element.

Parameters
[in]in_valueInput to be quantized.
[in]result_fixedpoint_multiplierResult multiplier parameter
[in]result_shiftResult shift parameter
[in]result_offset_after_shift_s32Result offset parameter
[in]min_u8Relu lower bound
[in]max_u8Relu upper bound
[in]is_bounded_reluSpecified if a fused bounded relu should be applied
Returns
Quantized value

Definition at line 318 of file NEAsymm.h.

325 {
326  int32x4_t in_s32 = vdupq_n_s32(in_value);
327 
328  if (result_shift < 0)
329  {
330  in_value = vgetq_lane_s32(
331  vqrdmulhq_n_s32(vmulq_n_s32(in_s32, (1 << (-result_shift))), result_fixedpoint_multiplier), 0);
332  }
333  else
334  {
335  // Fixed point multiplication with vector saturating rounding doubling multiply high with scalar
336  in_value = vgetq_lane_s32(vqrdmulhq_n_s32(in_s32, result_fixedpoint_multiplier), 0);
337  // Shift value by result_shift_s32
338  in_value = rounding_divide_by_pow2(in_value, result_shift);
339  }
340 
341  // Add the offset term
342  in_value += result_offset_after_shift_s32;
343 
344  // Bound the result
345  uint8_t out_u8 = static_cast<uint8_t>(std::max<int32_t>(0, std::min<int32_t>(255, in_value)));
346  if (is_bounded_relu)
347  {
348  out_u8 = static_cast<uint8_t>(std::max(min_u8, std::min(max_u8, out_u8)));
349  }
350 
351  return out_u8;
352 }

References rounding_divide_by_pow2().

◆ finalize_quantization() [3/4]

int8x16_t arm_compute::finalize_quantization ( int32x4x4_t &  in_s32,
int  result_fixedpoint_multiplier,
int32_t  result_shift,
int32x4_t  result_offset_after_shift_s32,
int8x16_t  min_s8,
int8x16_t  max_s8,
bool  is_bounded_relu 
)
inline

Performs final quantization step on 16 elements.

Parameters
[in]in_s32Input to be quantized.
[in]result_fixedpoint_multiplierResult multiplier parameter
[in]result_shiftResult shift parameter
[in]result_offset_after_shift_s32Result offset parameter
[in]min_s8Relu lower bound
[in]max_s8Relu upper bound
[in]is_bounded_reluSpecified if a fused bounded relu should be applied
Returns
Quantized values

Definition at line 161 of file NEAsymm.h.

168 {
169  if (result_shift < 0)
170  {
171  in_s32.val[0] = vmulq_n_s32(in_s32.val[0], (1 << (-result_shift)));
172  in_s32.val[1] = vmulq_n_s32(in_s32.val[1], (1 << (-result_shift)));
173  in_s32.val[2] = vmulq_n_s32(in_s32.val[2], (1 << (-result_shift)));
174  in_s32.val[3] = vmulq_n_s32(in_s32.val[3], (1 << (-result_shift)));
175 
176  in_s32.val[0] = vqrdmulhq_n_s32(in_s32.val[0], result_fixedpoint_multiplier);
177  in_s32.val[1] = vqrdmulhq_n_s32(in_s32.val[1], result_fixedpoint_multiplier);
178  in_s32.val[2] = vqrdmulhq_n_s32(in_s32.val[2], result_fixedpoint_multiplier);
179  in_s32.val[3] = vqrdmulhq_n_s32(in_s32.val[3], result_fixedpoint_multiplier);
180  }
181  else
182  {
183  // Fixed point multiplication with vector saturating rounding doubling multiply high with scalar
184  in_s32.val[0] = vqrdmulhq_n_s32(in_s32.val[0], result_fixedpoint_multiplier);
185  in_s32.val[1] = vqrdmulhq_n_s32(in_s32.val[1], result_fixedpoint_multiplier);
186  in_s32.val[2] = vqrdmulhq_n_s32(in_s32.val[2], result_fixedpoint_multiplier);
187  in_s32.val[3] = vqrdmulhq_n_s32(in_s32.val[3], result_fixedpoint_multiplier);
188 
189  // Round to the nearest division by a power-of-two using result_shift_s32
190  in_s32.val[0] = rounding_divide_by_pow2(in_s32.val[0], result_shift);
191  in_s32.val[1] = rounding_divide_by_pow2(in_s32.val[1], result_shift);
192  in_s32.val[2] = rounding_divide_by_pow2(in_s32.val[2], result_shift);
193  in_s32.val[3] = rounding_divide_by_pow2(in_s32.val[3], result_shift);
194  }
195 
196  // Add the offset terms
197  in_s32.val[0] = vaddq_s32(in_s32.val[0], result_offset_after_shift_s32);
198  in_s32.val[1] = vaddq_s32(in_s32.val[1], result_offset_after_shift_s32);
199  in_s32.val[2] = vaddq_s32(in_s32.val[2], result_offset_after_shift_s32);
200  in_s32.val[3] = vaddq_s32(in_s32.val[3], result_offset_after_shift_s32);
201 
202  // Convert S32 to S16
203  const int16x8x2_t in_s16 = {{vcombine_s16(vqmovn_s32(in_s32.val[0]), vqmovn_s32(in_s32.val[1])),
204  vcombine_s16(vqmovn_s32(in_s32.val[2]), vqmovn_s32(in_s32.val[3]))}};
205 
206  // Convert S16 to S8
207  int8x16_t out_s8 = vcombine_s8(vqmovn_s16(in_s16.val[0]), vqmovn_s16(in_s16.val[1]));
208 
209  if (is_bounded_relu)
210  {
211  out_s8 = vmaxq_s8(out_s8, min_s8);
212  out_s8 = vminq_s8(out_s8, max_s8);
213  }
214 
215  return out_s8;
216 }

References rounding_divide_by_pow2().

◆ finalize_quantization() [4/4]

uint8x16_t arm_compute::finalize_quantization ( int32x4x4_t &  in_s32,
int  result_fixedpoint_multiplier,
int32_t  result_shift,
int32x4_t  result_offset_after_shift_s32,
uint8x16_t  min_u8,
uint8x16_t  max_u8,
bool  is_bounded_relu 
)
inline

Performs final quantization step on 16 elements.

Parameters
[in]in_s32Input to be quantized.
[in]result_fixedpoint_multiplierResult multiplier parameter
[in]result_shiftResult shift parameter
[in]result_offset_after_shift_s32Result offset parameter
[in]min_u8Relu lower bound
[in]max_u8Relu upper bound
[in]is_bounded_reluSpecified if a fused bounded relu should be applied
Returns
Quantized values

Definition at line 84 of file NEAsymm.h.

91 {
92  const static int32x4_t zero_s32 = vdupq_n_s32(0);
93 
94  if (result_shift < 0)
95  {
96  in_s32.val[0] = vmulq_n_s32(in_s32.val[0], (1 << (-result_shift)));
97  in_s32.val[1] = vmulq_n_s32(in_s32.val[1], (1 << (-result_shift)));
98  in_s32.val[2] = vmulq_n_s32(in_s32.val[2], (1 << (-result_shift)));
99  in_s32.val[3] = vmulq_n_s32(in_s32.val[3], (1 << (-result_shift)));
100 
101  in_s32.val[0] = vqrdmulhq_n_s32(in_s32.val[0], result_fixedpoint_multiplier);
102  in_s32.val[1] = vqrdmulhq_n_s32(in_s32.val[1], result_fixedpoint_multiplier);
103  in_s32.val[2] = vqrdmulhq_n_s32(in_s32.val[2], result_fixedpoint_multiplier);
104  in_s32.val[3] = vqrdmulhq_n_s32(in_s32.val[3], result_fixedpoint_multiplier);
105  }
106  else
107  {
108  // Fixed point multiplication with vector saturating rounding doubling multiply high with scalar
109  in_s32.val[0] = vqrdmulhq_n_s32(in_s32.val[0], result_fixedpoint_multiplier);
110  in_s32.val[1] = vqrdmulhq_n_s32(in_s32.val[1], result_fixedpoint_multiplier);
111  in_s32.val[2] = vqrdmulhq_n_s32(in_s32.val[2], result_fixedpoint_multiplier);
112  in_s32.val[3] = vqrdmulhq_n_s32(in_s32.val[3], result_fixedpoint_multiplier);
113 
114  // Round to the nearest division by a power-of-two using result_shift_s32
115  in_s32.val[0] = rounding_divide_by_pow2(in_s32.val[0], result_shift);
116  in_s32.val[1] = rounding_divide_by_pow2(in_s32.val[1], result_shift);
117  in_s32.val[2] = rounding_divide_by_pow2(in_s32.val[2], result_shift);
118  in_s32.val[3] = rounding_divide_by_pow2(in_s32.val[3], result_shift);
119  }
120 
121  // Add the offset terms
122  in_s32.val[0] = vaddq_s32(in_s32.val[0], result_offset_after_shift_s32);
123  in_s32.val[1] = vaddq_s32(in_s32.val[1], result_offset_after_shift_s32);
124  in_s32.val[2] = vaddq_s32(in_s32.val[2], result_offset_after_shift_s32);
125  in_s32.val[3] = vaddq_s32(in_s32.val[3], result_offset_after_shift_s32);
126 
127  // Saturate negative values
128  in_s32.val[0] = vmaxq_s32(in_s32.val[0], zero_s32);
129  in_s32.val[1] = vmaxq_s32(in_s32.val[1], zero_s32);
130  in_s32.val[2] = vmaxq_s32(in_s32.val[2], zero_s32);
131  in_s32.val[3] = vmaxq_s32(in_s32.val[3], zero_s32);
132 
133  // Convert S32 to S16
134  const int16x8x2_t in_s16 = {{vcombine_s16(vqmovn_s32(in_s32.val[0]), vqmovn_s32(in_s32.val[1])),
135  vcombine_s16(vqmovn_s32(in_s32.val[2]), vqmovn_s32(in_s32.val[3]))}};
136 
137  // Convert S16 to U8
138  uint8x16_t out_u8 = vcombine_u8(vqmovun_s16(in_s16.val[0]), vqmovun_s16(in_s16.val[1]));
139 
140  if (is_bounded_relu)
141  {
142  out_u8 = vmaxq_u8(out_u8, min_u8);
143  out_u8 = vminq_u8(out_u8, max_u8);
144  }
145 
146  return out_u8;
147 }

References rounding_divide_by_pow2().

Referenced by arm_compute::cpu::directconv3d_quantized_neon_ndhwc().

◆ finalize_quantization_int16() [1/2]

int16_t arm_compute::finalize_quantization_int16 ( int32_t  in_value,
int  result_fixedpoint_multiplier,
int32_t  result_shift,
int16_t  min_s16,
int16_t  max_s16 
)
inline

Performs final quantization step on single signed 16-bit element.

Template Parameters
is_bounded_reluSpecified if a fused bounded relu should be applied
Parameters
[in]in_valueInput to be quantized.
[in]result_fixedpoint_multiplierResult multiplier parameter
[in]result_shiftResult shift parameter
[in]min_s16Relu lower bound
[in]max_s16Relu upper bound
Returns
Quantized values

Definition at line 100 of file NESymm.h.

102 {
103  if (result_shift < 0)
104  {
105  const int64_t in_64 = static_cast<int64_t>(in_value) * (1 << (-result_shift)) *
106  static_cast<int64_t>(result_fixedpoint_multiplier);
107  in_value = static_cast<int32_t>((in_64 + (1 << 30)) >> 31);
108  }
109  else
110  {
111  // Fixed point multiplication with vector saturating rounding doubling multiply high with scalar
112  const int64_t in_64 = static_cast<int64_t>(in_value) * static_cast<int64_t>(result_fixedpoint_multiplier);
113  // Shift value by result_shift_s32
114  in_value = rounding_divide_by_pow2(static_cast<int32_t>((in_64 + (1 << 30)) >> 31), result_shift);
115  }
116 
117  // Bound the result
118  int16_t out_s16 = static_cast<int16_t>(std::max<int32_t>(-32768, std::min<int32_t>(32767, in_value)));
119 
120  if (is_bounded_relu)
121  {
122  out_s16 = static_cast<int16_t>(std::max(min_s16, std::min(max_s16, out_s16)));
123  }
124 
125  return out_s16;
126 }

References rounding_divide_by_pow2().

◆ finalize_quantization_int16() [2/2]

int16x8_t arm_compute::finalize_quantization_int16 ( int32x4x2_t &  in_s32,
int  result_fixedpoint_multiplier,
int32_t  result_shift,
int16x8_t  min_s16,
int16x8_t  max_s16 
)

Performs final quantization step on 8 signed 16-bit elements.

Template Parameters
is_bounded_reluSpecified if a fused bounded relu should be applied
Parameters
[in]in_s32Input to be quantized.
[in]result_fixedpoint_multiplierResult multiplier parameter
[in]result_shiftResult shift parameter
[in]min_s16Relu lower bound
[in]max_s16Relu upper bound
Returns
Quantized values

Definition at line 54 of file NESymm.h.

56 {
57  if (result_shift < 0)
58  {
59  in_s32.val[0] = vmulq_n_s32(in_s32.val[0], (1 << -result_shift));
60  in_s32.val[1] = vmulq_n_s32(in_s32.val[1], (1 << -result_shift));
61 
62  in_s32.val[0] = vqrdmulhq_n_s32(in_s32.val[0], result_fixedpoint_multiplier);
63  in_s32.val[1] = vqrdmulhq_n_s32(in_s32.val[1], result_fixedpoint_multiplier);
64  }
65  else
66  {
67  // Fixed point multiplication with vector saturating rounding doubling multiply high with scalar
68  in_s32.val[0] = vqrdmulhq_n_s32(in_s32.val[0], result_fixedpoint_multiplier);
69  in_s32.val[1] = vqrdmulhq_n_s32(in_s32.val[1], result_fixedpoint_multiplier);
70  // Round to the nearest division by a power-of-two using result_shift_s32
71  in_s32.val[0] = rounding_divide_by_pow2(in_s32.val[0], result_shift);
72  in_s32.val[1] = rounding_divide_by_pow2(in_s32.val[1], result_shift);
73  }
74 
75  // Convert S32 to S16
76  int16x8_t out_s16 = vcombine_s16(vqmovn_s32(in_s32.val[0]), vqmovn_s32(in_s32.val[1]));
77 
78  if (is_bounded_relu)
79  {
80  out_s16 = vmaxq_s16(out_s16, min_s16);
81  out_s16 = vminq_s16(out_s16, max_s16);
82  }
83 
84  return out_s16;
85 }

References rounding_divide_by_pow2().

◆ finalize_quantization_symm()

int8x16_t arm_compute::finalize_quantization_symm ( int32x4x4_t &  in_s32,
const int32x4x4_t &  result_fixedpoint_multiplier,
const int32x4x4_t &  result_shift,
const int32x4_t &  result_offset_after_shift_s32,
const int8x16_t &  min_s8,
const int8x16_t &  max_s8,
const bool  is_bounded_relu 
)
inline

Performs final quantization step on 16 elements for symmetric quantization.

Parameters
[in]in_s32Input to be quantized.
[in]result_fixedpoint_multiplierResult multiplier parameter
[in]result_shiftResult shift parameter
[in]result_offset_after_shift_s32Result offset parameter
[in]min_s8Relu lower bound
[in]max_s8Relu upper bound
[in]is_bounded_reluSpecified if a fused bounded relu should be applied
Returns
Quantized values

Definition at line 230 of file NEAsymm.h.

237 {
238  const static int32x4_t one_s32 = vdupq_n_s32(1);
239 
240  // Fixed point multiplication with vector saturating rounding doubling multiply high with scalar
241  int32x4x4_t res_shift_gt0 = {
242  vqrdmulhq_s32(in_s32.val[0], result_fixedpoint_multiplier.val[0]),
243  vqrdmulhq_s32(in_s32.val[1], result_fixedpoint_multiplier.val[1]),
244  vqrdmulhq_s32(in_s32.val[2], result_fixedpoint_multiplier.val[2]),
245  vqrdmulhq_s32(in_s32.val[3], result_fixedpoint_multiplier.val[3]),
246  };
247  // Round to the nearest division by a power-of-two using result_shift_s32
248  res_shift_gt0.val[0] = rounding_divide_by_pow2(res_shift_gt0.val[0], result_shift.val[0]);
249  res_shift_gt0.val[1] = rounding_divide_by_pow2(res_shift_gt0.val[1], result_shift.val[1]);
250  res_shift_gt0.val[2] = rounding_divide_by_pow2(res_shift_gt0.val[2], result_shift.val[2]);
251  res_shift_gt0.val[3] = rounding_divide_by_pow2(res_shift_gt0.val[3], result_shift.val[3]);
252 
253  int32x4x4_t res_shift_lt0 = {
254  vmulq_s32(in_s32.val[0], vshlq_s32(one_s32, vnegq_s32(result_shift.val[0]))),
255  vmulq_s32(in_s32.val[1], vshlq_s32(one_s32, vnegq_s32(result_shift.val[1]))),
256  vmulq_s32(in_s32.val[2], vshlq_s32(one_s32, vnegq_s32(result_shift.val[2]))),
257  vmulq_s32(in_s32.val[3], vshlq_s32(one_s32, vnegq_s32(result_shift.val[3]))),
258  };
259  res_shift_lt0.val[0] = vqrdmulhq_s32(res_shift_lt0.val[0], result_fixedpoint_multiplier.val[0]);
260  res_shift_lt0.val[1] = vqrdmulhq_s32(res_shift_lt0.val[1], result_fixedpoint_multiplier.val[1]);
261  res_shift_lt0.val[2] = vqrdmulhq_s32(res_shift_lt0.val[2], result_fixedpoint_multiplier.val[2]);
262  res_shift_lt0.val[3] = vqrdmulhq_s32(res_shift_lt0.val[3], result_fixedpoint_multiplier.val[3]);
263 
264  // Select result depending on shift value
265  const uint32x4x4_t mask_lt0 = {
266 #ifdef __aarch64__
267  vcltzq_s32(result_shift.val[0]),
268  vcltzq_s32(result_shift.val[1]),
269  vcltzq_s32(result_shift.val[2]),
270  vcltzq_s32(result_shift.val[3]),
271 #else //__aarch64__
272  vcltq_s32(result_shift.val[0], vdupq_n_s32(0)),
273  vcltq_s32(result_shift.val[1], vdupq_n_s32(0)),
274  vcltq_s32(result_shift.val[2], vdupq_n_s32(0)),
275  vcltq_s32(result_shift.val[3], vdupq_n_s32(0)),
276 #endif //__aarch64__
277  };
278 
279  in_s32.val[0] = vbslq_s32(mask_lt0.val[0], res_shift_lt0.val[0], res_shift_gt0.val[0]);
280  in_s32.val[1] = vbslq_s32(mask_lt0.val[1], res_shift_lt0.val[1], res_shift_gt0.val[1]);
281  in_s32.val[2] = vbslq_s32(mask_lt0.val[2], res_shift_lt0.val[2], res_shift_gt0.val[2]);
282  in_s32.val[3] = vbslq_s32(mask_lt0.val[3], res_shift_lt0.val[3], res_shift_gt0.val[3]);
283 
284  // Add the offset terms
285  in_s32.val[0] = vaddq_s32(in_s32.val[0], result_offset_after_shift_s32);
286  in_s32.val[1] = vaddq_s32(in_s32.val[1], result_offset_after_shift_s32);
287  in_s32.val[2] = vaddq_s32(in_s32.val[2], result_offset_after_shift_s32);
288  in_s32.val[3] = vaddq_s32(in_s32.val[3], result_offset_after_shift_s32);
289 
290  // Convert S32 to S16
291  const int16x8x2_t in_s16 = {{vcombine_s16(vqmovn_s32(in_s32.val[0]), vqmovn_s32(in_s32.val[1])),
292  vcombine_s16(vqmovn_s32(in_s32.val[2]), vqmovn_s32(in_s32.val[3]))}};
293 
294  // Convert S16 to S8
295  int8x16_t out_s8 = vcombine_s8(vqmovn_s16(in_s16.val[0]), vqmovn_s16(in_s16.val[1]));
296 
297  if (is_bounded_relu)
298  {
299  out_s8 = vmaxq_s8(out_s8, min_s8);
300  out_s8 = vminq_s8(out_s8, max_s8);
301  }
302 
303  return out_s8;
304 }

References rounding_divide_by_pow2().

◆ float_to_string_with_full_precision()

std::string float_to_string_with_full_precision ( float  val)

Create a string with the float in full precision.

Parameters
valFloating point value
Returns
String with the floating point value.

Definition at line 52 of file StringUtils.cpp.

53 {
54  std::stringstream ss;
55  ss.precision(std::numeric_limits<float>::max_digits10);
56  ss << val;
57 
58  if (val != static_cast<int>(val))
59  {
60  ss << "f";
61  }
62 
63  return ss.str();
64 }

References arm_compute::test::validation::ss().

Referenced by ClDequantizeKernel::configure(), ClElementWiseUnaryKernel::configure(), ClWidthConcatenate2TensorsKernel::configure(), ClPool3dKernel::configure(), ClPool2dKernel::configure(), ClQuantizeKernel::configure(), ClScaleKernel::configure(), ClWidthConcatenateKernel::configure(), ClHeightConcatenateKernel::configure(), ClWidthConcatenate4TensorsKernel::configure(), ClActivationKernel::configure(), ClMatMulNativeKernel::configure(), ClDepthConcatenateKernel::configure(), ClBatchConcatenateKernel::configure(), ClGemmMatrixMultiplyNativeKernel::configure(), CLInstanceNormalizationLayerKernel::configure(), ClGemmMatrixMultiplyReshapedOnlyRhsMMULKernel::configure(), ClIndirectConv2dKernel::configure(), ClWinogradOutputTransformKernel::configure(), ClGemmLowpQuantizeDownInt32ScaleByFloatKernel::configure(), CLComputeAllAnchorsKernel::configure(), CLNormalizationLayerKernel::configure(), ClSoftmaxKernel::configure(), CLComparisonKernel::configure(), CLMeanStdDevNormalizationKernel::configure(), CLRangeKernel::configure(), CLReductionOperationKernel::configure(), ClDirectConv2dKernel::configure(), ClMulKernel::configure(), ClGemmMatrixMultiplyReshapedOnlyRhsKernel::configure(), CLDepthwiseConvolutionLayerNativeKernel::configure(), CLBoundingBoxTransformKernel::configure(), CLROIPoolingLayerKernel::configure(), CLROIAlignLayerKernel::configure(), ClGemmMatrixMultiplyReshapedKernel::configure(), CLFuseBatchNormalizationKernel::configure(), CLBatchNormalizationLayerKernel::configure(), ClComplexMulKernel::configure(), and string_from_pixel_value().

◆ floor_to_multiple()

auto arm_compute::floor_to_multiple ( value,
divisor 
) -> decltype((value / divisor) * divisor)
inline

Computes the largest number smaller or equal to value that is a multiple of divisor.

Parameters
[in]valueUpper bound value
[in]divisorValue to compute multiple of.
Returns
the result.

Definition at line 64 of file Math.h.

65 {
66  ARM_COMPUTE_ERROR_ON(value < 0 || divisor <= 0);
67  return (value / divisor) * divisor;
68 }

References ARM_COMPUTE_ERROR_ON.

◆ fp16_supported()

bool fp16_supported ( const cl::Device &  device)

Helper function to check whether the cl_khr_fp16 extension is supported.

Parameters
[in]deviceA CL device
Returns
True if the extension is supported

Definition at line 237 of file CLHelpers.cpp.

238 {
239  return device_supports_extension(device, "cl_khr_fp16");
240 }

References device_supports_extension().

◆ get_arch_from_target()

◆ get_cl_dot8_acc_type_from_data_type()

std::string get_cl_dot8_acc_type_from_data_type ( const DataType dt)

Translates a tensor data type to the appropriate OpenCL dot8 accumulator type.

Parameters
[in]dtDataType to be translated to OpenCL dot8 accumulator type.
Returns
The string specifying the OpenCL dot8 accumulator type to be used.

Definition at line 176 of file CLHelpers.cpp.

177 {
178  switch (dt)
179  {
180  case DataType::U8:
181  case DataType::QASYMM8:
182  return "uint";
183  case DataType::S8:
184  case DataType::QASYMM8_SIGNED:
185  case DataType::QSYMM8:
186  case DataType::QSYMM8_PER_CHANNEL:
187  return "int";
188  default:
189  ARM_COMPUTE_ERROR("Unsupported data type.");
190  return "";
191  }
192 }

References ARM_COMPUTE_ERROR, dt, QASYMM8, QASYMM8_SIGNED, QSYMM8, QSYMM8_PER_CHANNEL, S8, and U8.

Referenced by ClGemmLowpMatrixMultiplyNativeKernel::configure(), ClGemmLowpMatrixMultiplyReshapedKernel::configure(), ClGemmLowpMatrixMultiplyReshapedOnlyRhsKernel::configure(), ClGemmLowpMatrixAReductionKernel::configure(), and ClGemmLowpMatrixBReductionKernel::configure().

◆ get_cl_image_pitch_alignment()

size_t get_cl_image_pitch_alignment ( const cl::Device &  device)

Helper function to get the cl_image pitch alignment in pixels.

Parameters
[in]deviceA CL device
Returns
the cl_image pitch alignment in pixels. If an error occurs, the function will return 0

Definition at line 382 of file CLHelpers.cpp.

383 {
384  cl_uint pixel_aligment = 0;
385 
386  cl_int err = clGetDeviceInfo(device(), CL_DEVICE_IMAGE_PITCH_ALIGNMENT, sizeof(cl_uint), &pixel_aligment, nullptr);
387 
388  if (err == CL_SUCCESS)
389  {
390  return pixel_aligment;
391  }
392  else
393  {
394  return 0;
395  }
396 }

References clGetDeviceInfo().

Referenced by create_image2d_from_buffer(), export_to_cl_image(), examples::gemm_tuner_helpers::update_padding_for_cl_image(), arm_compute::opencl::kernels::gemm::update_padding_for_cl_image(), and arm_compute::opencl::kernels::gemm::validate_image2d_support_on_rhs().

◆ get_cl_non_uniform_work_group_supported()

bool get_cl_non_uniform_work_group_supported ( const cl::Device &  device)

Helper function to check whether non-uniform work group is supported.

Parameters
[in]deviceA CL device
Returns
True if the feature is supported

Definition at line 398 of file CLHelpers.cpp.

399 {
400  cl_bool supported = CL_FALSE;
401 
402  cl_int err =
403  clGetDeviceInfo(device(), CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT, sizeof(cl_bool), &supported, nullptr);
404 
405  return (err == CL_SUCCESS && supported == CL_TRUE);
406 }

References clGetDeviceInfo().

Referenced by CLDevice::is_non_uniform_workgroup_supported().

◆ get_cl_promoted_type_from_data_type()

std::string get_cl_promoted_type_from_data_type ( const DataType dt)

Translates a tensor data type to the appropriate OpenCL promoted type.

Parameters
[in]dtDataType to be used to get the promoted OpenCL type.
Returns
The string specifying the OpenCL type to be used.

Definition at line 77 of file CLHelpers.cpp.

78 {
79  switch (dt)
80  {
81  case DataType::U8:
82  case DataType::QASYMM8:
83  return "ushort";
84  case DataType::S8:
85  case DataType::QASYMM8_SIGNED:
86  case DataType::QSYMM8:
87  case DataType::QSYMM8_PER_CHANNEL:
88  return "short";
89  case DataType::U16:
90  case DataType::QASYMM16:
91  return "uint";
92  case DataType::S16:
93  case DataType::QSYMM16:
94  return "int";
95  case DataType::U32:
96  return "ulong";
97  case DataType::S32:
98  return "long";
99  case DataType::F16:
100  return "float";
101  default:
102  ARM_COMPUTE_ERROR("Cannot get promoted OpenCL type for the input data type.");
103  return "";
104  }
105 }

References ARM_COMPUTE_ERROR, dt, F16, QASYMM16, QASYMM8, QASYMM8_SIGNED, QSYMM16, QSYMM8, QSYMM8_PER_CHANNEL, S16, S32, S8, U16, U32, and U8.

◆ get_cl_select_type_from_data_type()

std::string get_cl_select_type_from_data_type ( const DataType dt)

Translates a tensor data type to the appropriate OpenCL select type.

Parameters
[in]dtDataType to be translated to OpenCL select type.
Returns
The string specifying the OpenCL select type to be used.

Definition at line 143 of file CLHelpers.cpp.

144 {
145  switch (dt)
146  {
147  case DataType::U8:
148  case DataType::QASYMM8:
149  case DataType::S8:
150  case DataType::QASYMM8_SIGNED:
151  case DataType::QSYMM8:
152  case DataType::QSYMM8_PER_CHANNEL:
153  return "char";
154  case DataType::U16:
155  case DataType::QASYMM16:
156  return "ushort";
157  case DataType::F16:
158  case DataType::S16:
159  case DataType::QSYMM16:
160  return "short";
161  case DataType::U32:
162  return "uint";
163  case DataType::F32:
164  case DataType::S32:
165  return "int";
166  case DataType::U64:
167  return "ulong";
168  case DataType::S64:
169  return "long";
170  default:
171  ARM_COMPUTE_ERROR("Unsupported input data type.");
172  return "";
173  }
174 }

References ARM_COMPUTE_ERROR, dt, F16, F32, QASYMM16, QASYMM8, QASYMM8_SIGNED, QSYMM16, QSYMM8, QSYMM8_PER_CHANNEL, S16, S32, S64, S8, U16, U32, U64, and U8.

Referenced by CLArgMinMaxLayerKernel::configure().

◆ get_cl_signed_type_from_element_size()

std::string get_cl_signed_type_from_element_size ( size_t  element_size)

Translates the element size to an signed integer data type.

Parameters
[in]element_sizeSize in bytes of an element.
Returns
The string specifying the OpenCL type to be used.

Definition at line 125 of file CLHelpers.cpp.

126 {
127  switch (element_size)
128  {
129  case 1:
130  return "char";
131  case 2:
132  return "short";
133  case 4:
134  return "int";
135  case 8:
136  return "long";
137  default:
138  ARM_COMPUTE_ERROR("Data type not supported");
139  return "";
140  }
141 }

References ARM_COMPUTE_ERROR.

◆ get_cl_type_from_data_type()

std::string get_cl_type_from_data_type ( const DataType dt)

Translates a tensor data type to the appropriate OpenCL type.

Parameters
[in]dtDataType to be translated to OpenCL type.
Returns
The string specifying the OpenCL type to be used.

Definition at line 41 of file CLHelpers.cpp.

42 {
43  switch (dt)
44  {
45  case DataType::U8:
46  case DataType::QASYMM8:
47  return "uchar";
48  case DataType::S8:
49  case DataType::QASYMM8_SIGNED:
50  case DataType::QSYMM8:
51  case DataType::QSYMM8_PER_CHANNEL:
52  return "char";
53  case DataType::U16:
54  case DataType::QASYMM16:
55  return "ushort";
56  case DataType::S16:
57  case DataType::QSYMM16:
58  return "short";
59  case DataType::U32:
60  return "uint";
61  case DataType::S32:
62  return "int";
63  case DataType::U64:
64  return "ulong";
65  case DataType::S64:
66  return "long";
67  case DataType::F16:
68  return "half";
69  case DataType::F32:
70  return "float";
71  default:
72  ARM_COMPUTE_ERROR("Unsupported input data type.");
73  return "";
74  }
75 }

References ARM_COMPUTE_ERROR, dt, F16, F32, QASYMM16, QASYMM8, QASYMM8_SIGNED, QSYMM16, QSYMM8, QSYMM8_PER_CHANNEL, S16, S32, S64, S8, U16, U32, U64, and U8.

Referenced by ClTransposedConvolutionKernel::configure(), ClDequantizeKernel::configure(), ClFloorKernel::configure(), ClElementWiseUnaryKernel::configure(), ClCopyKernel::configure(), ClFillKernel::configure(), ClWidthConcatenate2TensorsKernel::configure(), ClMatMulLowpNativeMMULKernel::configure(), ClPool3dKernel::configure(), ClPool2dKernel::configure(), ClQuantizeKernel::configure(), ClScaleKernel::configure(), ClWidthConcatenateKernel::configure(), ClWidthConcatenate4TensorsKernel::configure(), ClActivationKernel::configure(), ClCropKernel::configure(), ClMatMulNativeKernel::configure(), ClDepthConcatenateKernel::configure(), ClBatchConcatenateKernel::configure(), ClMatMulLowpNativeKernel::configure(), ClGemmLowpMatrixMultiplyNativeKernel::configure(), ClGemmMatrixMultiplyNativeKernel::configure(), CLInstanceNormalizationLayerKernel::configure(), ClWinogradFilterTransformKernel::configure(), ClWinogradInputTransformKernel::configure(), ClGemmLowpQuantizeDownInt32ScaleByFixedPointKernel::configure(), ClGemmMatrixMultiplyReshapedOnlyRhsMMULKernel::configure(), ClIndirectConv2dAddressPrecalculationKernel::configure(), ClIndirectConv2dKernel::configure(), ClWinogradOutputTransformKernel::configure(), ClGemmLowpQuantizeDownInt32ScaleByFloatKernel::configure(), ClGemmLowpQuantizeDownInt32ScaleKernel::configure(), CLComputeAllAnchorsKernel::configure(), ClSoftmaxKernel::configure(), CLNormalizationLayerKernel::configure(), CLQLSTMLayerNormalizationKernel::configure(), CLFFTScaleKernel::configure(), CLComparisonKernel::configure(), ClGemmLowpMatrixMultiplyReshapedKernel::configure(), ClCastKernel::configure(), CLMeanStdDevNormalizationKernel::configure(), CLFFTDigitReverseKernel::configure(), ClGemmLowpOffsetContributionOutputStageKernel::configure(), CLBatchToSpaceLayerKernel::configure(), CLReorgLayerKernel::configure(), CLNormalizePlanarYUVLayerKernel::configure(), CLRangeKernel::configure(), CLReductionOperationKernel::configure(), ClDirectConv2dKernel::configure(), ClCol2ImKernel::configure(), CLFFTRadixStageKernel::configure(), ClDirectConv3dKernel::configure(), ClGemmLowpMatrixMultiplyReshapedOnlyRhsKernel::configure(), CLL2NormalizeLayerKernel::configure(), CLPadLayerKernel::configure(), ClMatMulNativeMMULKernel::configure(), ClMulKernel::configure(), CLArgMinMaxLayerKernel::configure(), CLDepthwiseConvolutionLayerNativeKernel::configure(), CLBoundingBoxTransformKernel::configure(), ClGemmMatrixMultiplyReshapedOnlyRhsKernel::configure(), CLPriorBoxLayerKernel::configure(), CLROIPoolingLayerKernel::configure(), CLStackLayerKernel::configure(), CLROIAlignLayerKernel::configure(), ClGemmLowpMatrixAReductionKernel::configure(), CLFillBorderKernel::configure(), ClGemmMatrixMultiplyReshapedKernel::configure(), CLDeconvolutionReshapeOutputKernel::configure(), CLFuseBatchNormalizationKernel::configure(), CLBatchNormalizationLayerKernel::configure(), CLComputeMeanVariance::configure(), ClComplexMulKernel::configure(), and ClGemmLowpMatrixBReductionKernel::configure().

◆ get_cl_unsigned_type_from_element_size()

std::string get_cl_unsigned_type_from_element_size ( size_t  element_size)

Translates the element size to an unsigned integer data type.

Parameters
[in]element_sizeSize in bytes of an element.
Returns
The string specifying the OpenCL type to be used.

Definition at line 107 of file CLHelpers.cpp.

108 {
109  switch (element_size)
110  {
111  case 1:
112  return "uchar";
113  case 2:
114  return "ushort";
115  case 4:
116  return "uint";
117  case 8:
118  return "ulong";
119  default:
120  ARM_COMPUTE_ERROR("Data type not supported");
121  return "";
122  }
123 }

References ARM_COMPUTE_ERROR.

Referenced by ClReshapeKernel::configure(), ClHeightConcatenateKernel::configure(), ClPermuteKernel::configure(), CLStridedSliceKernel::configure(), ClConvertFullyConnectedWeightsKernel::configure(), ClGemmReshapeLhsMatrixKernel::configure(), CLMaxUnpoolingLayerKernel::configure(), CLChannelShuffleLayerKernel::configure(), CLSelectKernel::configure(), CLDeconvolutionLayerUpsampleKernel::configure(), CLDepthToSpaceLayerKernel::configure(), CLSpaceToDepthLayerKernel::configure(), CLSpaceToBatchLayerKernel::configure(), CLGatherKernel::configure(), CLTileKernel::configure(), ClGemmReshapeRhsMatrixKernel::configure(), CLReverseKernel::configure(), ClWeightsReshapeKernel::configure(), and CLBatchToSpaceLayerKernel::configure().

◆ get_cl_version()

CLVersion get_cl_version ( const cl::Device &  device)

Helper function to get the highest OpenCL version supported.

Parameters
[in]deviceA CL device
Returns
the highest OpenCL version supported

Definition at line 258 of file CLHelpers.cpp.

259 {
260  std::string version_str = device.getInfo<CL_DEVICE_VERSION>();
261  if (version_str.find("OpenCL 3") != std::string::npos)
262  {
263  return CLVersion::CL30;
264  }
265  else if (version_str.find("OpenCL 2") != std::string::npos)
266  {
267  return CLVersion::CL20;
268  }
269  else if (version_str.find("OpenCL 1.2") != std::string::npos)
270  {
271  return CLVersion::CL12;
272  }
273  else if (version_str.find("OpenCL 1.1") != std::string::npos)
274  {
275  return CLVersion::CL11;
276  }
277  else if (version_str.find("OpenCL 1.0") != std::string::npos)
278  {
279  return CLVersion::CL10;
280  }
281 
282  return CLVersion::UNKNOWN;
283 }

References CL10, CL11, CL12, CL20, CL30, and UNKNOWN.

Referenced by CLDevice::CLDevice().

◆ get_data_layout_dimension_index()

size_t get_data_layout_dimension_index ( const DataLayout data_layout,
const DataLayoutDimension data_layout_dimension 
)
inline

Get the index of the given dimension.

Parameters
[in]data_layoutThe data layout.
[in]data_layout_dimensionThe dimension which this index is requested for.
Returns
The int conversion of the requested data layout index.

Definition at line 201 of file Helpers.inl.

203 {
205  "Cannot retrieve the dimension index for an unknown layout!");
206  const auto &dims = get_layout_map().at(data_layout);
207  const auto &it = std::find(dims.cbegin(), dims.cend(), data_layout_dimension);
208  ARM_COMPUTE_ERROR_ON_MSG(it == dims.cend(), "Invalid dimension for the given layout.");
209  return it - dims.cbegin();
210 }

References ARM_COMPUTE_ERROR_ON_MSG, arm_compute::cpu::data_layout, get_layout_map(), and UNKNOWN.

Referenced by calculate_same_pad(), calculate_valid_region_scale(), arm_compute::misc::shape_calculator::compute_col2im_shape(), arm_compute::misc::shape_calculator::compute_deconvolution_output_shape(), arm_compute::misc::shape_calculator::compute_deconvolution_padding(), arm_compute::misc::shape_calculator::compute_deconvolution_upsampled_shape(), arm_compute::misc::shape_calculator::compute_deep_convolution_shape(), arm_compute::misc::shape_calculator::compute_depth_to_space_shape(), arm_compute::misc::shape_calculator::compute_depthwise_convolution_shape(), arm_compute::misc::shape_calculator::compute_im2col_conv_shape(), arm_compute::misc::shape_calculator::compute_pool3d_shape(), arm_compute::misc::shape_calculator::compute_pool_shape(), arm_compute::misc::shape_calculator::compute_prior_box_shape(), arm_compute::misc::shape_calculator::compute_reorg_output_shape(), arm_compute::misc::shape_calculator::compute_roi_align_shape(), arm_compute::misc::shape_calculator::compute_space_to_batch_shape(), arm_compute::misc::shape_calculator::compute_space_to_depth_shape(), arm_compute::misc::shape_calculator::compute_unpool_shape(), arm_compute::misc::shape_calculator::compute_upsample_shape(), arm_compute::misc::shape_calculator::compute_vector_to_tensor_output_shape(), arm_compute::misc::shape_calculator::compute_winograd_filter_transform_shape(), arm_compute::misc::shape_calculator::compute_winograd_input_transform_shape(), arm_compute::misc::shape_calculator::compute_winograd_output_transform_shape(), CpuScale::configure(), ClPool2dKernel::configure(), ClPool3dKernel::configure(), ClScaleKernel::configure(), CpuConvertFullyConnectedWeightsKernel::configure(), ClConvertFullyConnectedWeightsKernel::configure(), CpuPool2dKernel::configure(), NEDepthToSpaceLayerKernel::configure(), CpuDirectConv2dKernel::configure(), ClWinogradInputTransformKernel::configure(), CLChannelShuffleLayerKernel::configure(), CpuPool3dKernel::configure(), CpuPool2d::configure(), ClWinogradOutputTransformKernel::configure(), CLSpaceToDepthLayerKernel::configure(), CLDepthToSpaceLayerKernel::configure(), CLSpaceToBatchLayerKernel::configure(), CLReorgLayerKernel::configure(), CLNormalizePlanarYUVLayerKernel::configure(), CpuScaleKernel::configure(), ClDirectConv2dKernel::configure(), NERNNLayer::configure(), NEScale::configure(), CLPriorBoxLayerKernel::configure(), CLROIAlignLayerKernel::configure(), ClIm2ColKernel::configure(), CpuIm2ColKernel::configure(), CLDeconvolutionReshapeOutputKernel::configure(), CLRNNLayer::configure(), CLDepthwiseConvolutionLayer::configure(), NEFFTConvolutionLayer::configure(), ClWinogradConv2d::configure(), NEGenerateProposalsLayer::configure(), CpuGemmConv2d::configure(), ClGemmConv2d::configure(), CLComputeMeanVariance::configure(), NEDeconvolutionLayer::configure(), CLFFTConvolutionLayer::configure(), CLGenerateProposalsLayer::configure(), CLGEMMDeconvolutionLayer::configure(), CLDirectDeconvolutionLayer::configure(), ROIAlignLayerNode::configure_output(), arm_compute::test::validation::reference::convert_fully_connected_weights(), SubTensorInfo::dimension(), TensorInfo::dimension(), IImageLoader::fill_planar_tensor(), ClConv2d::get_convolution_method(), CpuConv2d::get_convolution_method(), CLDeconvolutionLayer::get_deconvolution_method(), get_normalization_dimension_index(), CpuGemmConv2d::has_opt_impl(), CpuScale::prepare(), arm_compute::cpu::roi_align(), CPPUpsampleKernel::run(), NESpaceToDepthLayerKernel::run(), NEReorgLayerKernel::run(), CLDeconvolutionLayerUpsampleKernel::run(), CLROIAlignLayerKernel::run(), NESpaceToBatchLayerKernel::run(), CpuGemmConv2d::run(), arm_compute::cpu::kernels::run_im2col(), ClWinogradInputTransformKernel::run_op(), arm_compute::cl_dwc::use_cl_image_for_weights(), CpuScale::validate(), CpuPool2dKernel::validate(), CLDeconvolutionLayerUpsampleKernel::validate(), NERNNLayer::validate(), CLRNNLayer::validate(), ClComponentDirectConv2d::validate(), ClGemmConv2d::validate(), CpuGemmConv2d::validate(), CLDepthwiseConvolutionLayer::validate(), NEFFTConvolutionLayer::validate(), NEGenerateProposalsLayer::validate(), ClComponentDepthwiseConv2d::validate(), NEDeconvolutionLayer::validate(), CLFFTConvolutionLayer::validate(), CLGEMMDeconvolutionLayer::validate(), CLGenerateProposalsLayer::validate(), CLDirectDeconvolutionLayer::validate(), arm_compute::cpu::kernels::validate_arguments(), arm_compute::test::validation::reference::winograd_output_transform(), GpuCkwPool2d::write_component_code(), GpuCkwDepthwiseConv2d::write_component_code(), and GpuCkwDirectConv2d::write_component_code().

◆ get_data_size_from_data_type()

std::string get_data_size_from_data_type ( const DataType dt)

Get the size of a data type in number of bits.

Parameters
[in]dtDataType.
Returns
Number of bits in the data type specified.

Definition at line 194 of file CLHelpers.cpp.

195 {
196  switch (dt)
197  {
198  case DataType::U8:
199  case DataType::S8:
200  case DataType::QSYMM8:
201  case DataType::QASYMM8:
202  case DataType::QASYMM8_SIGNED:
203  case DataType::QSYMM8_PER_CHANNEL:
204  return "8";
205  case DataType::U16:
206  case DataType::S16:
207  case DataType::QSYMM16:
208  case DataType::QASYMM16:
209  case DataType::F16:
210  return "16";
211  case DataType::U32:
212  case DataType::S32:
213  case DataType::F32:
214  return "32";
215  case DataType::U64:
216  case DataType::S64:
217  return "64";
218  default:
219  ARM_COMPUTE_ERROR("Unsupported input data type.");
220  return "0";
221  }
222 }

References ARM_COMPUTE_ERROR, dt, F16, F32, QASYMM16, QASYMM8, QASYMM8_SIGNED, QSYMM16, QSYMM8, QSYMM8_PER_CHANNEL, S16, S32, S64, S8, U16, U32, U64, and U8.

Referenced by ClDirectConv2dKernel::configure(), CLROIPoolingLayerKernel::configure(), and CLROIAlignLayerKernel::configure().

◆ get_default_lws_for_type()

cl::NDRange get_default_lws_for_type ( CLKernelType  kernel_type,
cl::NDRange  gws 
)

Definition at line 97 of file DefaultLWSHeuristics.cpp.

98 {
99  const size_t gws_x = gws[0];
100  const size_t gws_y = gws[1];
101  const size_t gws_z = gws[2];
102 
103  switch (kernel_type)
104  {
105  case CLKernelType::GEMM:
106  {
107  return get_gemm_lws(gws_x, gws_y, gws_z);
108  }
110  {
111  return get_direct_lws(gws_x, gws_y, gws_z);
112  }
114  {
115  return get_winograd_lws(gws_x, gws_y, gws_z);
116  }
118  {
119  return get_dwc_lws(gws_x, gws_y, gws_z);
120  }
121  default:
122  {
123  return CLKernelLibrary::get().default_ndrange();
124  }
125  }
126 }

References CLKernelLibrary::default_ndrange(), DEPTHWISE, DIRECT, GEMM, CLKernelLibrary::get(), and WINOGRAD.

◆ get_index_data_layout_dimension()

DataLayoutDimension get_index_data_layout_dimension ( const DataLayout data_layout,
const size_t  index 
)
inline

Get the DataLayoutDimension of a given index and layout.

Parameters
[in]data_layoutThe data layout.
[in]indexThe data layout index.
Returns
The dimension which this index is requested for.

Definition at line 212 of file Helpers.inl.

213 {
215  "Cannot retrieve the layout dimension for an unknown layout!");
216  const auto &dims = get_layout_map().at(data_layout);
217  ARM_COMPUTE_ERROR_ON_MSG(index >= dims.size(), "Invalid index for the given layout.");
218  return dims[index];
219 }

References ARM_COMPUTE_ERROR_ON_MSG, arm_compute::cpu::data_layout, get_layout_map(), and UNKNOWN.

◆ get_internal() [1/5]

IContext* arm_compute::get_internal ( AclContext  ctx)
inline

Extract internal representation of a Context.

Parameters
[in]ctxOpaque context pointer
Returns
The internal representation as an IContext

Definition at line 127 of file IContext.h.

128 {
129  return static_cast<IContext *>(ctx);
130 }

Referenced by AclActivation(), AclCreateQueue(), AclCreateTensor(), AclCreateTensorPack(), AclDestroyContext(), AclDestroyOperator(), AclDestroyQueue(), AclDestroyTensor(), AclDestroyTensorPack(), AclGetClContext(), AclGetClDevice(), AclGetClMem(), AclGetClQueue(), AclMapTensor(), AclPackTensor(), AclPackTensors(), AclQueueFinish(), AclRunOperator(), AclSetClContext(), AclSetClQueue(), AclTensorImport(), and AclUnmapTensor().

◆ get_internal() [2/5]

IOperator* arm_compute::get_internal ( AclOperator  op)
inline

Extract internal representation of an Operator.

Parameters
[in]opOpaque operator pointer
Returns
The internal representation as an IOperator

Definition at line 113 of file IOperator.h.

114 {
115  return static_cast<IOperator *>(op);
116 }

◆ get_internal() [3/5]

IQueue* arm_compute::get_internal ( AclQueue  queue)
inline

Extract internal representation of a Queue.

Parameters
[in]queueOpaque queue pointer
Returns
The internal representation as an IQueue

Definition at line 76 of file IQueue.h.

77 {
78  return static_cast<IQueue *>(queue);
79 }

◆ get_internal() [4/5]

ITensorV2* arm_compute::get_internal ( AclTensor  tensor)
inline

Extract internal representation of a Tensor.

Parameters
[in]tensorOpaque tensor pointer
Returns
The internal representation as an ITensor

Definition at line 115 of file ITensorV2.h.

116 {
117  return static_cast<ITensorV2 *>(tensor);
118 }

References tensor.

◆ get_internal() [5/5]

TensorPack* arm_compute::get_internal ( AclTensorPack  pack)
inline

Extract internal representation of a TensoPack.

Parameters
[in]packOpaque tensor pack pointer
Returns
The internal representation as an TensorPack

Definition at line 107 of file TensorPack.h.

108 {
109  return static_cast<TensorPack *>(pack);
110 }

References arm_compute::test::validation::pack.

◆ get_layout_map()

const std::map< DataLayout, std::vector< DataLayoutDimension > > & get_layout_map ( )

Returns a static map used to find an index or dimension based on a data layout.

*** Layouts ***

*** 4D *** [N C H W] [3 2 1 0] [N H W C]

  • *** 5D *** [N C D H W] [4 3 2 1 0] [N D H W C]

Definition at line 107 of file Helpers.cpp.

108 {
109  constexpr DataLayoutDimension W = DataLayoutDimension::WIDTH;
110  constexpr DataLayoutDimension H = DataLayoutDimension::HEIGHT;
111  constexpr DataLayoutDimension C = DataLayoutDimension::CHANNEL;
112  constexpr DataLayoutDimension D = DataLayoutDimension::DEPTH;
113  constexpr DataLayoutDimension N = DataLayoutDimension::BATCHES;
114 
115  static const std::map<DataLayout, std::vector<DataLayoutDimension>> layout_map = {
116  {DataLayout::NDHWC, {C, W, H, D, N}},
117  {DataLayout::NCDHW, {W, H, D, C, N}},
118  {DataLayout::NHWC, {C, W, H, N}},
119  {DataLayout::NCHW, {W, H, C, N}}};
120 
121  return layout_map;
122 }

References BATCHES, CHANNEL, DEPTH, HEIGHT, N, NCDHW, NCHW, NDHWC, NHWC, and WIDTH.

Referenced by get_data_layout_dimension_index(), and get_index_data_layout_dimension().

◆ get_min_max()

std::tuple<PixelValue, PixelValue> arm_compute::get_min_max ( DataType  dt)
inline

Compute the mininum and maximum values a data type can take.

Parameters
[in]dtData type to get the min/max bounds of
Returns
A tuple (min,max) with the minimum and maximum values respectively wrapped in PixelValue.

Definition at line 195 of file DataTypeUtils.h.

196 {
197  PixelValue min{};
198  PixelValue max{};
199  switch (dt)
200  {
201  case DataType::U8:
202  case DataType::QASYMM8:
203  {
204  min = PixelValue(static_cast<int32_t>(std::numeric_limits<uint8_t>::lowest()));
205  max = PixelValue(static_cast<int32_t>(std::numeric_limits<uint8_t>::max()));
206  break;
207  }
208  case DataType::S8:
209  case DataType::QSYMM8:
210  case DataType::QASYMM8_SIGNED:
211  case DataType::QSYMM8_PER_CHANNEL:
212  {
213  min = PixelValue(static_cast<int32_t>(std::numeric_limits<int8_t>::lowest()));
214  max = PixelValue(static_cast<int32_t>(std::numeric_limits<int8_t>::max()));
215  break;
216  }
217  case DataType::U16:
218  case DataType::QASYMM16:
219  {
220  min = PixelValue(static_cast<int32_t>(std::numeric_limits<uint16_t>::lowest()));
221  max = PixelValue(static_cast<int32_t>(std::numeric_limits<uint16_t>::max()));
222  break;
223  }
224  case DataType::S16:
225  case DataType::QSYMM16:
226  {
227  min = PixelValue(static_cast<int32_t>(std::numeric_limits<int16_t>::lowest()));
228  max = PixelValue(static_cast<int32_t>(std::numeric_limits<int16_t>::max()));
229  break;
230  }
231  case DataType::U32:
232  {
233  min = PixelValue(std::numeric_limits<uint32_t>::lowest());
234  max = PixelValue(std::numeric_limits<uint32_t>::max());
235  break;
236  }
237  case DataType::S32:
238  {
239  min = PixelValue(std::numeric_limits<int32_t>::lowest());
240  max = PixelValue(std::numeric_limits<int32_t>::max());
241  break;
242  }
243  case DataType::BFLOAT16:
244  {
245  min = PixelValue(bfloat16::lowest());
246  max = PixelValue(bfloat16::max());
247  break;
248  }
249  case DataType::F16:
250  {
251  min = PixelValue(std::numeric_limits<half>::lowest());
252  max = PixelValue(std::numeric_limits<half>::max());
253  break;
254  }
255  case DataType::F32:
256  {
257  min = PixelValue(std::numeric_limits<float>::lowest());
258  max = PixelValue(std::numeric_limits<float>::max());
259  break;
260  }
261  default:
262  ARM_COMPUTE_ERROR("Undefined data type!");
263  }
264  return std::make_tuple(min, max);
265 }

References ARM_COMPUTE_ERROR, BFLOAT16, dt, F16, F32, bfloat16::lowest(), arm_compute::support::cpp11::lowest(), bfloat16::max(), QASYMM16, QASYMM8, QASYMM8_SIGNED, QSYMM16, QSYMM8, QSYMM8_PER_CHANNEL, S16, S32, S8, U16, U32, and U8.

Referenced by ClPool2dKernel::configure(), ClPool3dKernel::configure(), ClGemmLowpOffsetContributionOutputStageKernel::configure(), ClGemmLowpMatrixMultiplyReshapedOnlyRhsKernel::configure(), ClGemmConv2d::configure(), get_quantized_activation_min_max(), arm_compute::quantization::get_quantized_asymmetric_output_min_max(), and CpuGemmLowpOffsetContributionOutputStageKernel::run_op().

◆ get_next_power_two()

unsigned int arm_compute::get_next_power_two ( unsigned int  x)
inline

Given an integer value, this function returns the next power of two.

Parameters
[in]xInput value
Returns
the next power of two

Definition at line 74 of file Utils.h.

75 {
76  // Decrement by 1
77  x--;
78 
79  // Shift right by 1
80  x |= x >> 1u;
81  // Shift right by 2
82  x |= x >> 2u;
83  // Shift right by 4
84  x |= x >> 4u;
85  // Shift right by 8
86  x |= x >> 8u;
87  // Shift right by 16
88  x |= x >> 16u;
89 
90  // Increment by 1
91  x++;
92 
93  return x;
94 }

Referenced by ICLKernel::gws_from_window().

◆ get_normalization_dimension_index()

unsigned int arm_compute::get_normalization_dimension_index ( DataLayout  layout,
const NormalizationLayerInfo info 
)
inline

Calculate the normalization dimension index for a given normalization type.

Parameters
[in]layoutData layout of the input and output tensor
[in]infoNormalization info
Returns
Normalization dimension index

Definition at line 39 of file NormalizationHelpers.h.

40 {
41  const unsigned int width_idx = get_data_layout_dimension_index(layout, DataLayoutDimension::WIDTH);
42  const unsigned int channel_idx = get_data_layout_dimension_index(layout, DataLayoutDimension::CHANNEL);
43 
44  return info.is_in_map() ? width_idx : channel_idx;
45 }

References CHANNEL, arm_compute::cpu::channel_idx, get_data_layout_dimension_index(), arm_compute::test::validation::info, WIDTH, and arm_compute::cpu::width_idx.

Referenced by NENormalizationLayerKernel::configure(), and CLNormalizationLayerKernel::configure().

◆ get_padding_info() [1/2]

std::unordered_map< const ITensorInfo *, PaddingSize > get_padding_info ( std::initializer_list< const ITensor * >  tensors)

Stores padding information before configuring a kernel.

Parameters
[in]tensorslist of tensors to store the padding info for
Returns
An unordered map where each tensor info pointer is paired with its original padding info

Definition at line 462 of file Utils.cpp.

463 {
464  std::unordered_map<const ITensorInfo *, PaddingSize> res;
465 
466  for (const ITensor *tensor : tensors)
467  {
468  if (tensor)
469  {
470  res.insert({tensor->info(), tensor->info()->padding()});
471  }
472  }
473 
474  return res;
475 }

References CLTensor::info(), TensorInfo::padding(), and tensor.

◆ get_padding_info() [2/2]

std::unordered_map< const ITensorInfo *, PaddingSize > get_padding_info ( std::initializer_list< const ITensorInfo * >  infos)

Stores padding information before configuring a kernel.

Parameters
[in]infoslist of tensor infos to store the padding info for
Returns
An unordered map where each tensor info pointer is paired with its original padding info

Definition at line 477 of file Utils.cpp.

478 {
479  std::unordered_map<const ITensorInfo *, PaddingSize> res;
480 
481  for (const ITensorInfo *info : infos)
482  {
483  if (info)
484  {
485  res.insert({info, info->padding()});
486  }
487  }
488 
489  return res;
490 }

References arm_compute::test::validation::info.

Referenced by ClDequantizeKernel::configure(), ClFloorKernel::configure(), ClReshapeKernel::configure(), ClTransposeKernel::configure(), ClCopyKernel::configure(), ClElementWiseUnaryKernel::configure(), ClWidthConcatenate2TensorsKernel::configure(), ClPool2dKernel::configure(), ClPool3dKernel::configure(), ClQuantizeKernel::configure(), ClScaleKernel::configure(), ClWidthConcatenateKernel::configure(), ClHeightConcatenateKernel::configure(), ClPermuteKernel::configure(), ClWidthConcatenate4TensorsKernel::configure(), ClActivationKernel::configure(), ClBatchConcatenateKernel::configure(), CLStridedSliceKernel::configure(), ClDepthConcatenateKernel::configure(), ClConvertFullyConnectedWeightsKernel::configure(), ClGemmLowpMatrixMultiplyNativeKernel::configure(), ClGemmReshapeLhsMatrixKernel::configure(), CLInstanceNormalizationLayerKernel::configure(), CLMaxUnpoolingLayerKernel::configure(), CLBitwiseKernel::configure(), ClGemmMatrixMultiplyNativeKernel::configure(), ClWinogradInputTransformKernel::configure(), ClWinogradFilterTransformKernel::configure(), ClGemmLowpQuantizeDownInt32ScaleByFixedPointKernel::configure(), CLChannelShuffleLayerKernel::configure(), ClGemmMatrixMultiplyReshapedOnlyRhsMMULKernel::configure(), CLSelectKernel::configure(), CLComputeAllAnchorsKernel::configure(), ClWinogradOutputTransformKernel::configure(), ClGemmLowpQuantizeDownInt32ScaleByFloatKernel::configure(), ClGemmLowpQuantizeDownInt32ScaleKernel::configure(), CLDeconvolutionLayerUpsampleKernel::configure(), CLSpaceToDepthLayerKernel::configure(), CLDepthToSpaceLayerKernel::configure(), CLNormalizationLayerKernel::configure(), CLQLSTMLayerNormalizationKernel::configure(), CLFFTScaleKernel::configure(), CLGatherKernel::configure(), CLSpaceToBatchLayerKernel::configure(), ClCastKernel::configure(), ClGemmLowpMatrixMultiplyReshapedKernel::configure(), CLBatchToSpaceLayerKernel::configure(), CLFFTDigitReverseKernel::configure(), ClGemmLowpMatrixMultiplyReshapedOnlyRhsMMULKernel::configure(), ClGemmLowpOffsetContributionOutputStageKernel::configure(), ClGemmLowpOffsetContributionKernel::configure(), CLReorgLayerKernel::configure(), CLNormalizePlanarYUVLayerKernel::configure(), CLReductionOperationKernel::configure(), CLReverseKernel::configure(), CLRangeKernel::configure(), CLFFTRadixStageKernel::configure(), CLL2NormalizeLayerKernel::configure(), ClGemmLowpMatrixMultiplyReshapedOnlyRhsKernel::configure(), CLPadLayerKernel::configure(), ClMulKernel::configure(), CLArgMinMaxLayerKernel::configure(), CLDepthwiseConvolutionLayerNativeKernel::configure(), CLBoundingBoxTransformKernel::configure(), ClGemmMatrixMultiplyReshapedOnlyRhsKernel::configure(), ClWeightsReshapeKernel::configure(), CLROIPoolingLayerKernel::configure(), ClGemmLowpMatrixAReductionKernel::configure(), ClIm2ColKernel::configure(), CLROIAlignLayerKernel::configure(), CLFillBorderKernel::configure(), ClGemmMatrixMultiplyReshapedKernel::configure(), CLDeconvolutionReshapeOutputKernel::configure(), CLFuseBatchNormalizationKernel::configure(), CLBatchNormalizationLayerKernel::configure(), CLComputeMeanVariance::configure(), ClComplexMulKernel::configure(), ClGemmLowpMatrixBReductionKernel::configure(), ClSaturatedArithmeticKernel::configure(), and ClArithmeticKernel::configure().

◆ get_promoted_data_type()

DataType arm_compute::get_promoted_data_type ( DataType  dt)
inline

Return the promoted data type of a given data type.

Note
If promoted data type is not supported an error will be thrown
Parameters
[in]dtData type to get the promoted type of.
Returns
Promoted data type

Definition at line 159 of file DataTypeUtils.h.

160 {
161  switch (dt)
162  {
163  case DataType::U8:
164  return DataType::U16;
165  case DataType::S8:
166  return DataType::S16;
167  case DataType::U16:
168  return DataType::U32;
169  case DataType::S16:
170  return DataType::S32;
171  case DataType::QSYMM8:
172  case DataType::QASYMM8:
173  case DataType::QASYMM8_SIGNED:
174  case DataType::QSYMM8_PER_CHANNEL:
175  case DataType::QSYMM16:
176  case DataType::QASYMM16:
177  case DataType::BFLOAT16:
178  case DataType::F16:
179  case DataType::U32:
180  case DataType::S32:
181  case DataType::F32:
182  ARM_COMPUTE_ERROR("Unsupported data type promotions!");
183  default:
184  ARM_COMPUTE_ERROR("Undefined data type!");
185  }
186  return DataType::UNKNOWN;
187 }

References ARM_COMPUTE_ERROR, BFLOAT16, dt, F16, F32, QASYMM16, QASYMM8, QASYMM8_SIGNED, QSYMM16, QSYMM8, QSYMM8_PER_CHANNEL, S16, S32, S8, U16, U32, U8, and UNKNOWN.

◆ get_quantized_activation_min_max()

std::pair< int32_t, int32_t > get_quantized_activation_min_max ( const ActivationLayerInfo act_info,
DataType  data_type,
UniformQuantizationInfo  oq_info 
)

Returns a pair of minimum and maximum values for a quantized activation.

Parameters
[in]act_infoThe information for activation
[in]data_typeThe used data type
[in]oq_infoThe output quantization information
Returns
The pair with minimum and maximum values

Definition at line 442 of file Utils.cpp.

445 {
446  const bool is_qasymm8_signed = is_data_type_quantized_asymmetric_signed(data_type);
447  const auto a = act_info.a();
448  const auto b = act_info.b();
449  const int a_int = is_qasymm8_signed ? quantize_qasymm8_signed(a, oq_info) : quantize_qasymm8(a, oq_info);
450  const int b_int = is_qasymm8_signed ? quantize_qasymm8_signed(b, oq_info) : quantize_qasymm8(b, oq_info);
451  const auto type_max_value = std::get<1>(get_min_max(data_type)).get<int32_t>();
452 
453  const int32_t min_activation = act_info.activation() != ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU
454  ? std::min(oq_info.offset, type_max_value)
455  : b_int;
456  const int32_t max_activation =
457  act_info.activation() == ActivationLayerInfo::ActivationFunction::RELU ? type_max_value : a_int;
458 
459  return std::make_pair(min_activation, max_activation);
460 }

References arm_compute::test::validation::act_info, arm_compute::test::validation::b, arm_compute::test::validation::data_type, get_min_max(), is_data_type_quantized_asymmetric_signed(), UniformQuantizationInfo::offset, quantize_qasymm8(), and quantize_qasymm8_signed().

Referenced by ClMatMulLowpNativeKernel::configure(), CLDepthwiseConvolutionLayerNativeKernel::configure(), ClGemmConv2d::configure(), and ClGemmConv2d::validate().

◆ get_softmax_output_quantization_info()

QuantizationInfo get_softmax_output_quantization_info ( DataType  input_type,
bool  is_log 
)

Returns output quantization information for softmax layer.

Parameters
[in]input_typeThe data type of the input tensor
[in]is_logTrue for log softmax
Returns
Quantization information for the output tensor

Definition at line 421 of file Utils.cpp.

422 {
423  // Note: Output quantization info for softmax should always have
424  // * Softmax with QASYMM8: scale = 1/256, offset = 0
425  // * Softmax with QASYMM8_SIGNED: scale = 1/256, offset = -128
426  // * LogSoftmax with QASYMM8: scale = 1/256, offset = 0
427  // * LogSoftmax with QASYMM8_SIGNED: scale = 16/256, offset = 127
429  {
430  if (is_log)
431  {
432  return QuantizationInfo(16.f / 256, 127);
433  }
434  else
435  {
436  return QuantizationInfo(1.f / 256, -128);
437  }
438  }
439  return QuantizationInfo(1.f / 256, 0);
440 }

References is_data_type_quantized_asymmetric_signed().

Referenced by CpuSoftmaxKernel::configure(), SoftmaxLayerNode::configure_output(), and ClSoftmaxKernel::validate().

◆ get_target_from_device()

GPUTarget get_target_from_device ( const cl::Device &  device)

Helper function to get the GPU target from CL device.

Parameters
[in]deviceA CL device
Returns
the GPU target

Definition at line 224 of file CLHelpers.cpp.

225 {
226  // Query device name size
227  std::string device_name = device.getInfo<CL_DEVICE_NAME>();
228 
229  return get_target_from_name(device_name);
230 }

References get_target_from_name().

Referenced by CLCompileContext::default_ndrange(), CLScheduler::init(), and ICLKernel::set_target().

◆ get_target_from_name()

GPUTarget get_target_from_name ( const std::string &  device_name)

Helper function to get the GPU target from a device name.

Parameters
[in]device_nameA device name
Returns
the GPU target

Definition at line 188 of file GPUTarget.cpp.

189 {
190  std::regex mali_regex(R"(Mali-(.*))");
191  std::smatch name_parts;
192  const bool found_mali = std::regex_search(device_name, name_parts, mali_regex);
193 
194  if (!found_mali)
195  {
196  ARM_COMPUTE_LOG_INFO_MSG_CORE("Can't find valid Arm® Maliâ„¢ GPU. Target is set to default.");
197  return GPUTarget::MIDGARD;
198  }
199 
200  const char target = name_parts.str(1)[0];
201  const std::string &version = name_parts.str(1);
202 
203  std::regex future_regex(R"(.*X)");
204  const bool is_future_gpu = std::regex_search(version, future_regex);
205 
206  // Work-out gpu target
207  GPUTarget gpu_target;
208  if (target == 'G' || is_future_gpu)
209  {
210  // Check for Valhall, Bifrost or 5-th Gen
211  gpu_target = get_fifth_gen_target(version);
212  if (gpu_target == GPUTarget::UNKNOWN)
213  {
214  gpu_target = get_valhall_target(version);
215  }
216 
217  if (gpu_target == GPUTarget::UNKNOWN)
218  {
219  gpu_target = get_bifrost_target(version);
220  }
221 
222  // Default GPUTarget
223  if (gpu_target == GPUTarget::UNKNOWN)
224  {
225  gpu_target = GPUTarget::VALHALL;
226  }
227  }
228  else if (target == 'T')
229  {
230  gpu_target = get_midgard_target(version);
231  }
232  else
233  {
234  gpu_target = GPUTarget::UNKNOWN;
235  }
236 
237  // Report in case of unknown target
238  if (gpu_target == GPUTarget::UNKNOWN)
239  {
240  ARM_COMPUTE_LOG_INFO_MSG_CORE("Arm® Maliâ„¢ Mali GPU unknown. Target is set to the default one. (BIFROST)");
241  return GPUTarget::BIFROST;
242  }
243 
244  return gpu_target;
245 }

References ARM_COMPUTE_LOG_INFO_MSG_CORE, BIFROST, MIDGARD, UNKNOWN, and VALHALL.

Referenced by CLDevice::CLDevice(), dot8_supported(), get_target_from_device(), and arm_compute::test::validation::TEST_CASE().

◆ get_wbsm_support_info()

bool get_wbsm_support_info ( const cl::Device &  device)

Definition at line 429 of file CLHelpers.cpp.

430 {
431  cl_bitfield capabilities = 0;
432  cl_int err = clGetDeviceInfo(device.get(), CL_DEVICE_SCHEDULING_CONTROLS_CAPABILITIES_ARM, sizeof(cl_bitfield),
433  &capabilities, nullptr);
434  if ((err == CL_SUCCESS) && (capabilities & CL_KERNEL_EXEC_INFO_WORKGROUP_BATCH_SIZE_MODIFIER_ARM))
435  {
436  return true;
437  }
438  return false;
439 }

References clGetDeviceInfo().

Referenced by CLCompileContext::CLCompileContext(), and CLCompileContext::set_device().

◆ gpu_target_is_in() [1/2]

bool arm_compute::gpu_target_is_in ( GPUTarget  target_to_check,
GPUTarget  target 
)
inline

Variant of gpu_target_is_in for comparing two targets.

Definition at line 115 of file GPUTarget.h.

116 {
117  return target_to_check == target;
118 }

◆ gpu_target_is_in() [2/2]

bool arm_compute::gpu_target_is_in ( GPUTarget  target_to_check,
GPUTarget  target,
Args...  targets 
)

Helper function to check whether a gpu target is equal to the provided targets.

Parameters
[in]target_to_checkgpu target to check
[in]targetFirst target to compare against
[in]targets(Optional) Additional targets to compare with
Returns
True if the target is equal with at least one of the targets.

Definition at line 109 of file GPUTarget.h.

110 {
111  return (target_to_check == target) | gpu_target_is_in(target_to_check, targets...);
112 }

Referenced by arm_compute::test::validation::TEST_CASE().

◆ handle_cl_error()

void handle_cl_error ( const std::string &  function_name,
cl_int  error_code 
)

Check for CL error code and throw exception accordingly.

Parameters
[in]function_nameThe name of the CL function being called.
[in]error_codeThe error returned by the CL function.

Definition at line 120 of file CLUtils.cpp.

121 {
122  if (error_code != CL_SUCCESS)
123  {
124  std::string error_message = function_name + " - Error code: " + std::to_string(error_code);
125  ARM_COMPUTE_ERROR(error_message.c_str());
126  }
127 }

References ARM_COMPUTE_ERROR, and to_string().

Referenced by CLMutableCommandBuffer::add_kernel(), CLMutableCommandBuffer::CLMutableCommandBuffer(), CLCompatCommandBuffer::enqueue(), CLMutableCommandBuffer::enqueue(), CLMutableCommandBuffer::finalize(), and CLMutableCommandBuffer::update().

◆ has_format_horizontal_subsampling()

bool arm_compute::has_format_horizontal_subsampling ( Format  format)
inline

Return true if the given format has horizontal subsampling.

Parameters
[in]formatFormat to determine subsampling.
Returns
True if the format can be subsampled horizontaly.

Definition at line 304 of file Validate.h.

305 {
306  return (format == Format::YUYV422 || format == Format::UYVY422 || format == Format::NV12 ||
307  format == Format::NV21 || format == Format::IYUV || format == Format::UV88)
308  ? true
309  : false;
310 }

References update_supported_ops::format, IYUV, NV12, NV21, UV88, UYVY422, and YUYV422.

Referenced by adjust_odd_shape(), and calculate_subsampled_shape().

◆ has_format_vertical_subsampling()

bool arm_compute::has_format_vertical_subsampling ( Format  format)
inline

Return true if the given format has vertical subsampling.

Parameters
[in]formatFormat to determine subsampling.
Returns
True if the format can be subsampled verticaly.

Definition at line 318 of file Validate.h.

319 {
320  return (format == Format::NV12 || format == Format::NV21 || format == Format::IYUV || format == Format::UV88)
321  ? true
322  : false;
323 }

References update_supported_ops::format, IYUV, NV12, NV21, and UV88.

Referenced by adjust_odd_shape(), and calculate_subsampled_shape().

◆ has_holes() [1/2]

bool has_holes ( const ITensorInfo info)

Check if the tensor has any holes.

A hole is defined as any gap in the tensor between two consecutive values. This can be a result of extending the paddings or manipulating the strides of the tensor

Parameters
[in]infoTensor info object defining the shape of the input tensor.
Note
This function checks for holes in all dimensions.

Definition at line 28 of file Utils.cpp.

29 {
30  return has_holes(info, info.num_dimensions() - 1);
31 }

References arm_compute::test::validation::info.

Referenced by CpuSoftmaxKernel::configure(), CpuReshapeKernel::prepare(), and NEStackLayerKernel::prepare().

◆ has_holes() [2/2]

bool has_holes ( const ITensorInfo info,
size_t  dimension 
)

Check if the tensor has any holes.

Parameters
[in]infoTensor info object defining the shape of the input tensor.
[in]dimensionHighest dimension to check.
Note
This function checks for holes in all the dimensions upto and including the highest dimension.

Definition at line 33 of file Utils.cpp.

34 {
35  const auto &shape = info.tensor_shape();
36  const auto &strides = info.strides_in_bytes();
37  size_t squashed_bytes = info.element_size();
38 
39  for (size_t dim = 0; dim <= dimension; ++dim)
40  {
41  if (strides[dim] != squashed_bytes)
42  {
43  return true;
44  }
45  squashed_bytes *= shape[dim];
46  }
47  return false;
48 }

References arm_compute::test::validation::info, and arm_compute::test::validation::shape.

◆ has_padding_changed()

bool has_padding_changed ( const std::unordered_map< const ITensorInfo *, PaddingSize > &  padding_map)

Check if the previously stored padding info has changed after configuring a kernel.

Parameters
[in]padding_mapan unordered map where each tensor info pointer is paired with its original padding info
Returns
true if any of the tensor infos has changed its paddings

Definition at line 492 of file Utils.cpp.

493 {
494  return std::find_if(padding_map.begin(), padding_map.end(),
495  [](const std::pair<const ITensorInfo *, PaddingSize> &padding_info)
496  { return (padding_info.first->padding() != padding_info.second); }) != padding_map.end();
497 }

Referenced by ClDequantizeKernel::configure(), ClFloorKernel::configure(), ClReshapeKernel::configure(), ClTransposeKernel::configure(), ClCopyKernel::configure(), ClElementWiseUnaryKernel::configure(), ClWidthConcatenate2TensorsKernel::configure(), ClPool2dKernel::configure(), ClPool3dKernel::configure(), ClQuantizeKernel::configure(), ClScaleKernel::configure(), ClWidthConcatenateKernel::configure(), ClHeightConcatenateKernel::configure(), ClPermuteKernel::configure(), ClWidthConcatenate4TensorsKernel::configure(), ClActivationKernel::configure(), ClBatchConcatenateKernel::configure(), CLStridedSliceKernel::configure(), ClDepthConcatenateKernel::configure(), ClConvertFullyConnectedWeightsKernel::configure(), ClGemmLowpMatrixMultiplyNativeKernel::configure(), ClGemmReshapeLhsMatrixKernel::configure(), CLInstanceNormalizationLayerKernel::configure(), CLBitwiseKernel::configure(), CLMaxUnpoolingLayerKernel::configure(), ClGemmMatrixMultiplyNativeKernel::configure(), ClWinogradFilterTransformKernel::configure(), ClWinogradInputTransformKernel::configure(), ClGemmLowpQuantizeDownInt32ScaleByFixedPointKernel::configure(), ClGemmMatrixMultiplyReshapedOnlyRhsMMULKernel::configure(), CLChannelShuffleLayerKernel::configure(), CLSelectKernel::configure(), CLComputeAllAnchorsKernel::configure(), ClWinogradOutputTransformKernel::configure(), ClGemmLowpQuantizeDownInt32ScaleByFloatKernel::configure(), ClGemmLowpQuantizeDownInt32ScaleKernel::configure(), CLDeconvolutionLayerUpsampleKernel::configure(), CLSpaceToDepthLayerKernel::configure(), CLDepthToSpaceLayerKernel::configure(), CLNormalizationLayerKernel::configure(), CLQLSTMLayerNormalizationKernel::configure(), CLFFTScaleKernel::configure(), CLGatherKernel::configure(), CLSpaceToBatchLayerKernel::configure(), ClCastKernel::configure(), ClGemmLowpMatrixMultiplyReshapedKernel::configure(), CLBatchToSpaceLayerKernel::configure(), CLFFTDigitReverseKernel::configure(), ClGemmLowpOffsetContributionKernel::configure(), ClGemmLowpOffsetContributionOutputStageKernel::configure(), CLReorgLayerKernel::configure(), CLNormalizePlanarYUVLayerKernel::configure(), CLRangeKernel::configure(), CLReductionOperationKernel::configure(), CLReverseKernel::configure(), CLFFTRadixStageKernel::configure(), ClGemmLowpMatrixMultiplyReshapedOnlyRhsKernel::configure(), CLL2NormalizeLayerKernel::configure(), CLPadLayerKernel::configure(), ClMulKernel::configure(), CLArgMinMaxLayerKernel::configure(), CLDepthwiseConvolutionLayerNativeKernel::configure(), CLBoundingBoxTransformKernel::configure(), ClGemmMatrixMultiplyReshapedOnlyRhsKernel::configure(), ClWeightsReshapeKernel::configure(), CLROIPoolingLayerKernel::configure(), ClIm2ColKernel::configure(), ClGemmLowpMatrixAReductionKernel::configure(), CLROIAlignLayerKernel::configure(), CLFillBorderKernel::configure(), ClGemmMatrixMultiplyReshapedKernel::configure(), CLDeconvolutionReshapeOutputKernel::configure(), CLFuseBatchNormalizationKernel::configure(), CLBatchNormalizationLayerKernel::configure(), CLComputeMeanVariance::configure(), ClComplexMulKernel::configure(), ClGemmLowpMatrixBReductionKernel::configure(), ClSaturatedArithmeticKernel::configure(), and ClArithmeticKernel::configure().

◆ ignore_unused()

void arm_compute::ignore_unused ( T &&  ...)
inline

Ignores unused arguments.

Template Parameters
TArgument types
Parameters
[in]...Ignored arguments

Definition at line 39 of file Error.h.

40 {
41 }

◆ image2d_from_buffer_supported()

bool image2d_from_buffer_supported ( const cl::Device &  device)

Helper function to check whether the cl_khr_image2d_from_buffer extension is supported.

Parameters
[in]deviceA CL device
Returns
True if the extension is supported

Definition at line 377 of file CLHelpers.cpp.

378 {
379  return device_supports_extension(device, "cl_khr_image2d_from_buffer");
380 }

References device_supports_extension().

Referenced by create_image2d_from_buffer(), export_to_cl_image(), arm_compute::test::validation::TEST_CASE(), and arm_compute::opencl::kernels::gemm::validate_image2d_support_on_rhs().

◆ index2coords()

Coordinates index2coords ( const TensorShape shape,
int  index 
)
inline

Convert a linear index into n-dimensional coordinates.

Parameters
[in]shapeShape of the n-dimensional tensor.
[in]indexLinear index specifying the i-th element.
Returns
n-dimensional coordinates.

Definition at line 164 of file Helpers.inl.

165 {
166  int num_elements = shape.total_size();
167 
168  ARM_COMPUTE_ERROR_ON_MSG(index < 0 || index >= num_elements, "Index has to be in [0, num_elements]!");
169  ARM_COMPUTE_ERROR_ON_MSG(num_elements == 0, "Cannot create coordinate from empty shape!");
170 
171  Coordinates coord{0};
172 
173  for (int d = shape.num_dimensions() - 1; d >= 0; --d)
174  {
175  num_elements /= shape[d];
176  coord.set(d, index / num_elements);
177  index %= num_elements;
178  }
179 
180  return coord;
181 }

References ARM_COMPUTE_ERROR_ON_MSG, and arm_compute::test::validation::shape.

Referenced by arm_compute::test::validation::reference::convert_fully_connected_weights().

◆ interleave_by()

int arm_compute::interleave_by ( const WeightFormat  wf)
inline

Definition at line 1652 of file Types.h.

1653 {
1654  return (static_cast<int>(wf) >> 8) & 0xFFF;
1655 }

◆ intersect_valid_regions()

ValidRegion arm_compute::intersect_valid_regions ( const Ts &...  regions)

Intersect multiple valid regions.

Parameters
[in]regionsValid regions.
Returns
Intersection of all regions.

Definition at line 64 of file WindowHelpers.h.

65 {
66  auto intersect = [](const ValidRegion &r1, const ValidRegion &r2) -> ValidRegion
67  {
68  ValidRegion region;
69 
70  for (size_t d = 0; d < std::min(r1.anchor.num_dimensions(), r2.anchor.num_dimensions()); ++d)
71  {
72  region.anchor.set(d, std::max(r1.anchor[d], r2.anchor[d]));
73  }
74 
75  for (size_t d = 0; d < std::min(r1.shape.num_dimensions(), r2.shape.num_dimensions()); ++d)
76  {
77  region.shape.set(d, std::min(r1.shape[d], r2.shape[d]));
78  }
79 
80  return region;
81  };
82 
83  return utility::foldl(intersect, regions...);
84 }

References ValidRegion::anchor, arm_compute::utility::foldl(), Dimensions< T >::num_dimensions(), Dimensions< T >::set(), TensorShape::set(), and ValidRegion::shape.

◆ is_data_type_float()

bool arm_compute::is_data_type_float ( DataType  dt)
inline

Check if a given data type is of floating point type.

Parameters
[in]dtInput data type.
Returns
True if data type is of floating point type, else false.

Definition at line 304 of file DataTypeUtils.h.

305 {
306  switch (dt)
307  {
308  case DataType::F16:
309  case DataType::F32:
310  return true;
311  default:
312  return false;
313  }
314 }

References dt, F16, and F32.

Referenced by ClPool2dKernel::configure(), ClQuantizeKernel::configure(), ClScaleKernel::configure(), ClDirectConv2d::configure(), ClCastKernel::configure(), CLReductionOperationKernel::configure(), CLArgMinMaxLayerKernel::configure(), ClMulKernel::configure(), export_to_cl_image(), arm_compute::graph::detail::fuse_node_with_activation(), ClConv2d::get_convolution_method(), ClPool2dKernel::run_op(), ClSaturatedArithmeticKernel::validate(), and ClArithmeticKernel::validate().

◆ is_data_type_quantized()

bool arm_compute::is_data_type_quantized ( DataType  dt)
inline

Check if a given data type is of quantized type.

Note
Quantized is considered a super-set of fixed-point and asymmetric data types.
Parameters
[in]dtInput data type.
Returns
True if data type is of quantized type, else false.

Definition at line 324 of file DataTypeUtils.h.

325 {
326  switch (dt)
327  {
328  case DataType::QSYMM8:
329  case DataType::QASYMM8:
330  case DataType::QASYMM8_SIGNED:
331  case DataType::QSYMM8_PER_CHANNEL:
332  case DataType::QSYMM16:
333  case DataType::QASYMM16:
334  return true;
335  default:
336  return false;
337  }
338 }

References dt, QASYMM16, QASYMM8, QASYMM8_SIGNED, QSYMM16, QSYMM8, and QSYMM8_PER_CHANNEL.

Referenced by arm_compute::test::validation::reference::arithmetic_operation(), CpuAddMulAdd::configure(), ClTransposedConvolutionKernel::configure(), ClElementWiseUnaryKernel::configure(), ClPool2dKernel::configure(), ClPool3dKernel::configure(), ClActivationKernel::configure(), CLComputeAllAnchorsKernel::configure(), CPPDetectionPostProcessLayer::configure(), ClCastKernel::configure(), CLComparisonKernel::configure(), CpuMatMul::configure(), CLNormalizePlanarYUVLayerKernel::configure(), CLReductionOperationKernel::configure(), ClDirectConv2dKernel::configure(), CpuGemmDirectConv2d::configure(), ClDirectConv3dKernel::configure(), ClMulKernel::configure(), CLBoundingBoxTransformKernel::configure(), CLReduceMean::configure(), CLDepthwiseConvolutionLayerNativeKernel::configure(), NEDetectionPostProcessLayer::configure(), CLDepthwiseConvolutionLayer::configure(), error_on_mismatching_quantization_info(), needs_serialized_reduction(), operator<<(), QuantizationLayerNode::QuantizationLayerNode(), CpuAddMulAdd::run(), arm_compute::cpu::kernels::run_im2col(), arm_compute::test::validation::reference::space_to_batch(), CpuAddMulAdd::validate(), CpuMatMul::validate(), CpuDepthwiseConv2dAssemblyWrapperKernel::validate(), CpuFullyConnected::validate(), NEDetectionPostProcessLayer::validate(), ClFullyConnected::validate(), CLDepthwiseConvolutionLayer::validate(), NEDeconvolutionLayer::validate(), and NEConvolutionLayer::validate().

◆ is_data_type_quantized_asymmetric()

bool arm_compute::is_data_type_quantized_asymmetric ( DataType  dt)
inline

Check if a given data type is of asymmetric quantized type.

Parameters
[in]dtInput data type.
Returns
True if data type is of asymmetric quantized type, else false.

Definition at line 346 of file DataTypeUtils.h.

347 {
348  switch (dt)
349  {
350  case DataType::QASYMM8:
351  case DataType::QASYMM8_SIGNED:
352  case DataType::QASYMM16:
353  return true;
354  default:
355  return false;
356  }
357 }

References dt, QASYMM16, QASYMM8, and QASYMM8_SIGNED.

Referenced by GraphBuilder::add_convolution_node(), GraphBuilder::add_deconvolution_node(), GraphBuilder::add_depthwise_convolution_node(), GraphBuilder::add_fully_connected_layer(), ClDequantizeKernel::configure(), ClWidthConcatenate2TensorsKernel::configure(), ClPool2dKernel::configure(), ClPool3dKernel::configure(), ClWidthConcatenateKernel::configure(), ClHeightConcatenateKernel::configure(), ClQuantizeKernel::configure(), ClScaleKernel::configure(), ClWidthConcatenate4TensorsKernel::configure(), ClActivationKernel::configure(), CpuSoftmaxKernel::configure(), ClBatchConcatenateKernel::configure(), ClDepthConcatenateKernel::configure(), ClDirectConv2d::configure(), CpuSoftmaxGeneric::configure(), CLRangeKernel::configure(), ClMulKernel::configure(), CLROIPoolingLayerKernel::configure(), CLROIAlignLayerKernel::configure(), CpuFullyConnected::configure(), ClFullyConnected::configure(), CpuGemmConv2d::configure(), ClGemmConv2d::configure(), CpuGemmLowpMatrixMultiplyCore::configure(), CLGEMMDeconvolutionLayer::configure(), arm_compute::graph::backends::detail::create_concatenate_layer(), arm_compute::graph::backends::detail::create_convolution_layer(), arm_compute::graph::backends::detail::create_depthwise_convolution_layer(), arm_compute::graph::backends::detail::create_fully_connected_layer(), arm_compute::test::validation::reference::im2col_nchw(), arm_compute::test::validation::reference::im2col_nhwc(), arm_compute::cpu::roi_align(), CpuGemmLowpMatrixMultiplyCore::run(), CpuSoftmaxKernel::run_op(), set_quantization_info_if_empty(), ClSoftmaxKernel::validate(), CpuSoftmaxGeneric::validate(), CpuGemmDirectConv2d::validate(), ClGemmLowpMatrixMultiplyCore::validate(), ClGemmConv2d::validate(), CpuGemmConv2d::validate(), CpuGemmLowpMatrixMultiplyCore::validate(), NEDeconvolutionLayer::validate(), CLGEMMDeconvolutionLayer::validate(), CLDirectDeconvolutionLayer::validate(), and arm_compute::graph::backends::detail::validate_convolution_layer().

◆ is_data_type_quantized_asymmetric_char()

bool arm_compute::is_data_type_quantized_asymmetric_char ( DataType  dt)
inline

Check if a given data type is of 8-bit asymmetric quantized signed type.

Parameters
[in]dtInput data type.
Returns
True if data type is of 8-bit asymmetric quantized signed type, else false.

Definition at line 382 of file DataTypeUtils.h.

383 {
384  switch (dt)
385  {
386  case DataType::QASYMM8_SIGNED:
387  case DataType::QASYMM8:
388  return true;
389  default:
390  return false;
391  }
392 }

References dt, QASYMM8, and QASYMM8_SIGNED.

Referenced by CpuQuantizeKernel::configure().

◆ is_data_type_quantized_asymmetric_signed()

bool arm_compute::is_data_type_quantized_asymmetric_signed ( DataType  dt)
inline

Check if a given data type is of asymmetric quantized signed type.

Parameters
[in]dtInput data type.
Returns
True if data type is of asymmetric quantized signed type, else false.

Definition at line 365 of file DataTypeUtils.h.

366 {
367  switch (dt)
368  {
369  case DataType::QASYMM8_SIGNED:
370  return true;
371  default:
372  return false;
373  }
374 }

References dt, and QASYMM8_SIGNED.

Referenced by CpuDirectConv2dOutputStageKernel::configure(), get_quantized_activation_min_max(), get_softmax_output_quantization_info(), and arm_compute::cpu::roi_align_1x1_qasymm8().

◆ is_data_type_quantized_per_channel()

◆ is_data_type_quantized_symmetric()

bool arm_compute::is_data_type_quantized_symmetric ( DataType  dt)
inline

Check if a given data type is of symmetric quantized type.

Parameters
[in]dtInput data type.
Returns
True if data type is of symmetric quantized type, else false.

Definition at line 400 of file DataTypeUtils.h.

401 {
402  switch (dt)
403  {
404  case DataType::QSYMM8:
405  case DataType::QSYMM8_PER_CHANNEL:
406  case DataType::QSYMM16:
407  return true;
408  default:
409  return false;
410  }
411 }

References dt, QSYMM16, QSYMM8, and QSYMM8_PER_CHANNEL.

Referenced by ClGemmLowpMatrixMultiplyCore::configure(), and ClGemmLowpMatrixMultiplyCore::validate().

◆ is_fixed_format()

bool arm_compute::is_fixed_format ( const WeightFormat wf)
inline

Definition at line 1660 of file Types.h.

1661 {
1662  return wf != WeightFormat::UNSPECIFIED && wf != WeightFormat::ANY;
1663 }

References ANY, and UNSPECIFIED.

Referenced by CpuGemmDirectConv2d::validate(), and CpuGemmConv2d::validate().

◆ is_fixed_format_fast_math()

bool arm_compute::is_fixed_format_fast_math ( const WeightFormat wf)
inline

Definition at line 1664 of file Types.h.

1665 {
1666  return (static_cast<int>(wf) >> 4) & 0x1;
1667 }

Referenced by CpuMatMul::configure(), CpuFullyConnected::validate(), CpuGemm::validate(), and CpuGemmAssemblyDispatch::validate().

◆ is_pool_3d_region_entirely_outside_input()

bool is_pool_3d_region_entirely_outside_input ( const Pooling3dLayerInfo info)

Check if the 3d pool region is entirely outside the input tensor.

Parameters
[in]infoPooling3dLayerInfo to be checked.
Returns
True if the pool region is entirely outside the input tensor, False otherwise.

Definition at line 141 of file Utils.cpp.

142 {
143  if (info.is_global_pooling || info.pool_size.x() == 0 || info.pool_size.y() == 0 || info.pool_size.z() == 0)
144  {
145  return false;
146  }
147  const auto ps = info.padding;
148  const auto pool_le_padding_x = info.pool_size.x() <= std::max({ps.left, ps.right});
149  const auto pool_le_padding_y = info.pool_size.y() <= std::max({ps.top, ps.bottom});
150  const auto pool_le_padding_z = info.pool_size.z() <= std::max({ps.front, ps.back});
151  return pool_le_padding_x || pool_le_padding_y || pool_le_padding_z;
152 }

References arm_compute::test::validation::info.

◆ is_pool_region_entirely_outside_input()

bool is_pool_region_entirely_outside_input ( const PoolingLayerInfo info)

Check if the pool region is entirely outside the input tensor.

Parameters
[in]infoPoolingLayerInfo to be checked.
Returns
True if the pool region is entirely outside the input tensor, False otherwise.

Definition at line 129 of file Utils.cpp.

130 {
131  if (info.is_global_pooling || info.exclude_padding || info.pool_size.x() == 0 || info.pool_size.y() == 0)
132  {
133  return false;
134  }
135  const auto ps = info.pad_stride_info;
136  const auto pool_le_padding_x = info.pool_size.x() <= std::max({ps.pad_left(), ps.pad_right()});
137  const auto pool_le_padding_y = info.pool_size.y() <= std::max({ps.pad_top(), ps.pad_bottom()});
138  return pool_le_padding_x || pool_le_padding_y;
139 }

References arm_compute::test::validation::info.

Referenced by CpuPool2dAssemblyWrapperKernel::validate(), and ClComponentPool2d::validate().

◆ is_symmetric()

bool arm_compute::is_symmetric ( const Padding3D info)
inline

Check if the 3D padding is symmetric i.e.

padding in each opposite sides are euqal (left=right, top=bottom and front=back)

Parameters
[in]infoPadding3D input 3D padding object to check if it is symmetric
Returns
True if padding is symmetric

Definition at line 245 of file Utils.h.

246 {
247  return ((info.left == info.right) && (info.top == info.bottom) && (info.front == info.back));
248 }

References arm_compute::test::validation::info.

◆ join()

std::string join ( const std::vector< std::string >  strings,
const std::string &  sep 
)

Join a sequence of strings with separator sep.

Parameters
[in]stringsStrings to join
[in]sepSeparator to join consecutive strings in the sequence
Returns
std::string

Definition at line 66 of file StringUtils.cpp.

67 {
68  if (strings.empty())
69  {
70  return "";
71  }
72  return std::accumulate(std::next(strings.begin()), strings.end(), strings.at(0),
73  [&sep](const std::string &a, const std::string &b) { return a + sep + b; });
74 }

References arm_compute::test::validation::reference::accumulate(), and arm_compute::test::validation::b.

Referenced by GEMMParam::__str__(), NativeGEMMConfig::__str__(), ReshapedOnlyRHSGEMMConfig::__str__(), ReshapedGEMMConfig::__str__(), Measurement::__str__(), format_code::check_copyright(), format_code::check_license(), check_header_guards::find_expected_header_guard(), GpuCkwElementwiseBinary::get_name(), format_doxygen::process_comment(), format_code::run_fix_code_formatting(), and GEMMBenchmarkResultRecorder::summary().

◆ lower_string()

std::string lower_string ( const std::string &  val)

Lower a given string.

Parameters
[in]valGiven string to lower.
Returns
The lowered string

Definition at line 38 of file StringUtils.cpp.

39 {
40  std::string res = val;
41  std::transform(res.begin(), res.end(), res.begin(), ::tolower);
42  return res;
43 }

References arm_compute::utility::tolower().

Referenced by ClTransposedConvolutionKernel::configure(), ClMatMulLowpNativeMMULKernel::configure(), ClWidthConcatenate2TensorsKernel::configure(), ClPool2dKernel::configure(), ClPool3dKernel::configure(), ClScaleKernel::configure(), ClActivationKernel::configure(), ClWidthConcatenate4TensorsKernel::configure(), ClMatMulNativeKernel::configure(), CLStridedSliceKernel::configure(), ClMatMulLowpNativeKernel::configure(), ClGemmReshapeLhsMatrixKernel::configure(), CLMaxUnpoolingLayerKernel::configure(), ClGemmMatrixMultiplyNativeKernel::configure(), ClGemmMatrixMultiplyReshapedOnlyRhsMMULKernel::configure(), ClWinogradInputTransformKernel::configure(), CLChannelShuffleLayerKernel::configure(), ClWinogradFilterTransformKernel::configure(), ClIndirectConv2dKernel::configure(), ClWinogradOutputTransformKernel::configure(), CLQLSTMLayerNormalizationKernel::configure(), CLFFTScaleKernel::configure(), CLSpaceToDepthLayerKernel::configure(), ClSoftmaxKernel::configure(), CLDepthToSpaceLayerKernel::configure(), CLNormalizationLayerKernel::configure(), CLTileKernel::configure(), CLSpaceToBatchLayerKernel::configure(), CLComparisonKernel::configure(), ClCastKernel::configure(), CLFFTDigitReverseKernel::configure(), CLReorgLayerKernel::configure(), CLMeanStdDevNormalizationKernel::configure(), CLBatchToSpaceLayerKernel::configure(), CLNormalizePlanarYUVLayerKernel::configure(), CLRangeKernel::configure(), CLReverseKernel::configure(), CLFFTRadixStageKernel::configure(), ClCol2ImKernel::configure(), ClDirectConv2dKernel::configure(), ClDirectConv3dKernel::configure(), ClMatMulNativeMMULKernel::configure(), ClMulKernel::configure(), ClGemmMatrixMultiplyReshapedOnlyRhsKernel::configure(), CLDepthwiseConvolutionLayerNativeKernel::configure(), ClIm2ColKernel::configure(), CLFillBorderKernel::configure(), ClGemmMatrixMultiplyReshapedKernel::configure(), CLDeconvolutionReshapeOutputKernel::configure(), CLBatchNormalizationLayerKernel::configure(), ClComplexMulKernel::configure(), arm_compute::graph_utils::get_input_accessor(), and GpuCkwElementwiseBinary::get_name().

◆ manage_workspace() [1/2]

WorkspaceData<TensorType> arm_compute::manage_workspace ( const experimental::MemoryRequirements mem_reqs,
MemoryGroup mgroup,
ITensorPack run_pack 
)

Definition at line 56 of file MemoryHelpers.h.

57 {
58  ITensorPack dummy_pack = ITensorPack();
59  return manage_workspace<TensorType>(mem_reqs, mgroup, run_pack, dummy_pack);
60 }

◆ manage_workspace() [2/2]

WorkspaceData<TensorType> arm_compute::manage_workspace ( const experimental::MemoryRequirements mem_reqs,
MemoryGroup mgroup,
ITensorPack run_pack,
ITensorPack prep_pack 
)

Definition at line 63 of file MemoryHelpers.h.

67 {
68  WorkspaceData<TensorType> workspace_memory;
69  for (const auto &req : mem_reqs)
70  {
71  if (req.size == 0)
72  {
73  continue;
74  }
75 
76  const auto aux_info = TensorInfo{TensorShape(req.size), 1, DataType::U8};
77  workspace_memory.emplace_back(
78  WorkspaceDataElement<TensorType>{req.slot, req.lifetime, std::make_unique<TensorType>()});
79 
80  auto aux_tensor = workspace_memory.back().tensor.get();
81  ARM_COMPUTE_ERROR_ON_NULLPTR(aux_tensor);
82  aux_tensor->allocator()->init(aux_info, req.alignment);
83 
84  if (req.lifetime == experimental::MemoryLifetime::Temporary)
85  {
86  mgroup.manage(aux_tensor);
87  }
88  else
89  {
90  prep_pack.add_tensor(req.slot, aux_tensor);
91  }
92  run_pack.add_tensor(req.slot, aux_tensor);
93  }
94 
95  for (auto &mem : workspace_memory)
96  {
97  auto tensor = mem.tensor.get();
98  tensor->allocator()->allocate();
99  }
100 
101  return workspace_memory;
102 }

References ITensorPack::add_tensor(), CLTensorAllocator::allocate(), CLTensor::allocator(), ARM_COMPUTE_ERROR_ON_NULLPTR, MemoryGroup::manage(), WorkspaceDataElement< TensorType >::slot, arm_compute::experimental::Temporary, tensor, and U8.

◆ multiply_by_quantized_multiplier_2row()

int32x4x2_t arm_compute::multiply_by_quantized_multiplier_2row ( int32x4x2_t  input,
int32_t  qmul,
int32_t  shift 
)
inline

Multiply a neon vector using quantized multiplier and shift.

Parameters
[in]inputInput vector to mutiply values to be quantized.
[in]qmulQuantized multipler
[in]shiftLeft bit shift
Returns
A neon vector holding the multiplied value

Definition at line 225 of file NESymm.h.

226 {
227  const auto left_shift = shift > 0 ? shift : 0;
228  const auto right_shift = shift > 0 ? 0 : -shift;
229  const auto one_shifted = 1 << left_shift;
230 
231  int32x4x2_t result;
232  result.val[0] = rounding_divide_by_pow2(vqrdmulhq_n_s32(vmulq_n_s32(input.val[0], one_shifted), qmul), right_shift);
233  result.val[1] = rounding_divide_by_pow2(vqrdmulhq_n_s32(vmulq_n_s32(input.val[1], one_shifted), qmul), right_shift);
234 
235  return result;
236 }

References arm_compute::test::validation::input, and rounding_divide_by_pow2().

◆ needs_serialized_reduction()

bool needs_serialized_reduction ( ReductionOperation  op,
DataType  dt,
unsigned int  axis 
)

Check if the given reduction operation should be handled in a serial way.

Parameters
[in]opReduction operation to perform
[in]dtData type
[in]axisAxis along which to reduce
Returns
True if the given reduction operation should be handled in a serial way.

Definition at line 412 of file Utils.cpp.

413 {
414  const bool is_min_max = (op == ReductionOperation::MAX || op == ReductionOperation::MIN);
415  const bool is_quantized_type = is_data_type_quantized(dt);
416  const bool is_first_dim = (axis == 0);
417 
418  return !is_first_dim || (is_quantized_type && !is_min_max);
419 }

References dt, is_data_type_quantized(), MAX, and MIN.

Referenced by CLReductionOperationKernel::configure(), and CLReductionOperationKernel::run().

◆ normalize_float()

void arm_compute::normalize_float ( const Window window,
const ITensor in,
const ITensor in_squared,
ITensor out,
NormalizationLayerInfo  ninfo 
)

Function to perform normalization depending on the given template dimension.

The second template parameter specifies whether the normalization has to be 1D or 2D.

Note
Only supported normalizations are:
  • 1D over X or Z
  • 2D over X and Y
Parameters
[in]windowRegion on which to execute the kernel.
[in]inSource tensor. 3 lower dims represent a single input with dimensions [width, height, IFM], and an optional 4th dimension for batch of inputs. Data types supported: FP16/F32. Data layouts supported: NCHW/NHWC.
[in]in_squaredSource with each element has been squared. 3 lower dims represent a single input with dimensions [width, height, IFM], Data type and layout supported: same as input.
[in]outDestination tensor. Output will have the same number of dimensions as input. Data type and layout supported: same as input.
[in]ninfoNormalization layer information like the normalization type, normalization size and other parameters.

SIMD vector tag type.

Definition at line 58 of file impl.h.

60 {
61  /** SIMD vector tag type. */
62  using ExactTagType = typename wrapper::traits::neon_vector<T, S>::tag_type;
63 
64  Window win(window);
65  win.set(Window::DimX, Window::Dimension(0, 1, 1));
66 
67  const auto window_start_x = static_cast<int>(window.x().start());
68  const auto window_end_x = static_cast<int>(window.x().end());
69  const int window_step_x = S;
70 
71  Iterator input(in, win);
72  Iterator input_squared(in_squared, win);
73  Iterator output(out, win);
74 
75  const int dim_y = in->info()->data_layout() == DataLayout::NCHW ? 1 : 2;
76  const int radius = ninfo.norm_size() / 2;
77  const int input_squared_stride_x = in_squared->info()->strides_in_bytes()[0];
78  const int input_squared_stride_slice = in_squared->info()->strides_in_bytes()[dim];
79  const int input_squared_stride_row = in_squared->info()->strides_in_bytes()[dim_y];
80 
81  const int max_right = in->info()->dimension(dim) - 1;
82  const int max_bottom = in->info()->dimension(dim_y) - 1;
83 
84  const auto coeff_vec = wrapper::vdup_n(static_cast<T>(ninfo.scale_coeff()), ExactTagType{});
85  const auto beta_vec = wrapper::vdup_n(static_cast<T>(ninfo.beta()), ExactTagType{});
86  const auto kappa_vec = wrapper::vdup_n(static_cast<T>(ninfo.kappa()), ExactTagType{});
87 
88  auto sequential_normalization = [&](const int x, const Coordinates &id, const int current_row, const int first_row,
89  const int last_row, const T *input_ptr, const uint8_t *input_squared_start_ptr,
90  T *output_ptr)
91  {
92  const int current_slice = dim == 0 ? x : id[dim];
93  const int first_slice = std::max(current_slice - radius, 0);
94  const int last_slice = std::min(current_slice + radius, max_right);
95 
96  const uint8_t *const input_squared_x_ptr = input_squared_start_ptr + x * input_squared_stride_x;
97  // Accumulate 2D In-Map values
98  auto accu = static_cast<T>(0.f);
99  for (int j = first_row; j <= last_row; ++j)
100  {
101  // Compute row displacement
102  const uint8_t *const input_squared_ptr = input_squared_x_ptr + (j - current_row) * input_squared_stride_row;
103  for (int i = first_slice; i <= last_slice; ++i)
104  {
105  accu +=
106  *reinterpret_cast<const T *>(input_squared_ptr + (i - current_slice) * input_squared_stride_slice);
107  }
108  }
109 
110  // Normalize
111  const auto normalized =
112  std::pow(accu * static_cast<T>(ninfo.scale_coeff()) + static_cast<T>(ninfo.kappa()), ninfo.beta());
113  const auto normalized_pixel = (*(input_ptr + x)) / normalized;
114  *(output_ptr + x) = normalized_pixel;
115  };
116 
118  win,
119  [&](const Coordinates &id)
120  {
121  const auto input_ptr = reinterpret_cast<const T *>(input.ptr());
122  auto output_ptr = reinterpret_cast<T *>(output.ptr());
123 
124  // Get range to normalize
125  const int current_row = do_2D_norm ? id[dim_y] : 0;
126  const int first_row = do_2D_norm ? std::max(current_row - radius, 0) : 0;
127  const int last_row = do_2D_norm ? std::min(current_row + radius, max_bottom) : 0;
128 
129  int x = window_start_x;
130  // Compute serially starting elements for the case x dimension is width
131  for (; x < radius && x < window_end_x && dim == 0; ++x)
132  {
133  sequential_normalization(x, id, current_row, first_row, last_row, input_ptr, input_squared.ptr(),
134  output_ptr);
135  }
136 
137  // Compute vectorized
138  for (; x <= window_end_x - window_step_x - radius; x += window_step_x)
139  {
140  const int current_slice = dim == 0 ? x : id[dim];
141  const int first_slice = std::max(current_slice - radius, 0);
142  const int last_slice = std::min(current_slice + radius, max_right);
143 
144  const uint8_t *const input_squared_x_ptr = input_squared.ptr() + x * input_squared_stride_x;
145  // Accumulate 2D In-Map values
146  auto accu = wrapper::vdup_n(static_cast<T>(0.f), ExactTagType{});
147  for (int j = first_row; j <= last_row; ++j)
148  {
149  // Compute row displacement
150  const uint8_t *const input_squared_ptr =
151  input_squared_x_ptr + (j - current_row) * input_squared_stride_row;
152  for (int i = first_slice; i <= last_slice; ++i)
153  {
154  accu = wrapper::vadd(
155  accu, wrapper::vloadq(reinterpret_cast<const T *>(
156  input_squared_ptr + (i - current_slice) * input_squared_stride_slice)));
157  }
158  }
159 
160  // Normalize
161  const auto normalized = wrapper::vpow(wrapper::vmla(kappa_vec, coeff_vec, accu), beta_vec);
162  const auto normalized_pixel = wrapper::vmul(wrapper::vloadq(input_ptr + x), wrapper::vinv(normalized));
163  wrapper::vstore(reinterpret_cast<T *>(output_ptr + x), normalized_pixel);
164  }
165 
166  // Compute left-over elements
167  for (; x < window_end_x; ++x)
168  {
169  sequential_normalization(x, id, current_row, first_row, last_row, input_ptr, input_squared.ptr(),
170  output_ptr);
171  }
172  },
173  input, input_squared, output);
174 }

References NormalizationLayerInfo::beta(), ITensorInfo::data_layout(), ITensorInfo::dimension(), Window::DimX, Window::Dimension::end(), execute_window_loop(), ITensor::info(), arm_compute::test::validation::input, NormalizationLayerInfo::kappa(), NCHW, NormalizationLayerInfo::norm_size(), Iterator::ptr(), NormalizationLayerInfo::scale_coeff(), Window::set(), Window::Dimension::start(), ITensorInfo::strides_in_bytes(), arm_compute::wrapper::vadd(), arm_compute::wrapper::vdup_n(), arm_compute::wrapper::vinv(), arm_compute::wrapper::vloadq(), arm_compute::wrapper::vmla(), arm_compute::wrapper::vmul(), arm_compute::wrapper::vpow(), arm_compute::wrapper::vstore(), and Window::x().

◆ num_channels_from_format()

size_t arm_compute::num_channels_from_format ( Format  format)
inline

Return the number of channels for a given single-planar pixel format.

Parameters
[in]formatInput format
Returns
The number of channels for a given image format.

Definition at line 302 of file FormatUtils.h.

303 {
304  switch (format)
305  {
306  case Format::U8:
307  case Format::U16:
308  case Format::S16:
309  case Format::U32:
310  case Format::S32:
311  case Format::BFLOAT16:
312  case Format::F16:
313  case Format::F32:
314  return 1;
315  // Because the U and V channels are subsampled
316  // these formats appear like having only 2 channels:
317  case Format::YUYV422:
318  case Format::UYVY422:
319  return 2;
320  case Format::UV88:
321  return 2;
322  case Format::RGB888:
323  return 3;
324  case Format::RGBA8888:
325  return 4;
326  //Doesn't make sense for planar formats:
327  case Format::NV12:
328  case Format::NV21:
329  case Format::IYUV:
330  case Format::YUV444:
331  default:
332  return 0;
333  }
334 }

References BFLOAT16, F16, F32, update_supported_ops::format, IYUV, NV12, NV21, RGB888, RGBA8888, S16, S32, U16, U32, U8, UV88, UYVY422, YUV444, and YUYV422.

Referenced by TensorInfo::init(), TensorInfo::init_auto_padding(), and TensorInfo::set_format().

◆ num_of_elements_in_range()

size_t arm_compute::num_of_elements_in_range ( const float  start,
const float  end,
const float  step 
)
inline

Returns the number of elements required to go from start to end with the wanted step.

Parameters
[in]startstart value
[in]endend value
[in]stepstep value between each number in the wanted sequence
Returns
number of elements to go from start value to end value using the wanted step

Definition at line 295 of file Utils.h.

296 {
297  ARM_COMPUTE_ERROR_ON_MSG(step == 0, "Range Step cannot be 0");
298  return size_t(std::ceil((end - start) / step));
299 }

References ARM_COMPUTE_ERROR_ON_MSG, arm_compute::mlgo::parser::end(), and arm_compute::cpu::step.

Referenced by NERangeKernel::configure().

◆ num_planes_from_format()

size_t arm_compute::num_planes_from_format ( Format  format)
inline

Return the number of planes for a given format.

Parameters
[in]formatInput format
Returns
The number of planes for a given image format.

Definition at line 267 of file FormatUtils.h.

268 {
269  switch (format)
270  {
271  case Format::U8:
272  case Format::S16:
273  case Format::U16:
274  case Format::S32:
275  case Format::U32:
276  case Format::BFLOAT16:
277  case Format::F16:
278  case Format::F32:
279  case Format::RGB888:
280  case Format::RGBA8888:
281  case Format::YUYV422:
282  case Format::UYVY422:
283  return 1;
284  case Format::NV12:
285  case Format::NV21:
286  return 2;
287  case Format::IYUV:
288  case Format::YUV444:
289  return 3;
290  default:
291  ARM_COMPUTE_ERROR("Not supported format");
292  return 0;
293  }
294 }

References ARM_COMPUTE_ERROR, BFLOAT16, F16, F32, update_supported_ops::format, IYUV, NV12, NV21, RGB888, RGBA8888, S16, S32, U16, U32, U8, UYVY422, YUV444, and YUYV422.

◆ offset_int_vec()

◆ opencl_is_available()

bool opencl_is_available ( )

Check if OpenCL is available.

Returns
True if OpenCL is available.

Definition at line 236 of file OpenCL.cpp.

237 {
238  CLSymbols::get().load_default();
239 
240  // Using static objects that rely on OpenCL in their constructor or
241  // destructor is implementation defined according to the OpenCL API
242  // Specification. These objects include CLScheduler.
243  //
244  // For compatibility with OpenCL runtimes that also use static objects to
245  // hold their state, we call a harmless OpenCL function (clGetPlatformIDs
246  // with invalid parameters must result in CL_INVALID_VALUE) to ensure the
247  // runtimes have a chance to initialize their static objects first. Thanks
248  // to C++11 rules about normal program completion (cf [basic.start]), this
249  // ensures their static objects are destroyed last, i.e. after the
250  // singleton CLScheduler is destroyed.
251  //
252  // When OpenCL is not available, this call results in CL_OUT_OF_RESOURCES,
253  // which is equally harmless.
254  (void)clGetPlatformIDs(0, nullptr, nullptr);
255 
256  return CLSymbols::get().clBuildProgram_ptr != nullptr;
257 }

References CLSymbols::clBuildProgram_ptr, clGetPlatformIDs(), CLSymbols::get(), and CLSymbols::load_default().

Referenced by create_opencl_context_and_device(), CLScheduler::get(), CLDeviceBackend::is_backend_supported(), main(), Framework::run(), and arm_compute::test::sync_if_necessary().

◆ operator!=() [1/3]

bool arm_compute::operator!= ( const Dimensions< T > &  lhs,
const Dimensions< T > &  rhs 
)
inline

Check that given dimensions are not equal.

Parameters
[in]lhsLeft-hand side Dimensions.
[in]rhsRight-hand side Dimensions.
Returns
True if the given dimensions are not equal.

Definition at line 287 of file Dimensions.h.

288 {
289  return !(lhs == rhs);
290 }

◆ operator!=() [2/3]

bool arm_compute::operator!= ( const QuantizationInfo lhs,
const QuantizationInfo rhs 
)
inline

Check whether two quantization info are not equal.

Parameters
[in]lhsRHS quantization info.
[in]rhsLHS quantization info.
Returns
True if the given quantization info is the same.

Definition at line 187 of file QuantizationInfo.h.

188 {
189  return !(operator==(lhs, rhs));
190 }

References operator==().

◆ operator!=() [3/3]

bool arm_compute::operator!= ( const UniformQuantizationInfo lhs,
const UniformQuantizationInfo rhs 
)
inline

Check whether two quantization info are not equal.

Parameters
[in]lhsRHS quantization info.
[in]rhsLHS quantization info.
Returns
True if the given quantization info is the same.

Definition at line 211 of file QuantizationInfo.h.

212 {
213  return !(operator==(lhs, rhs));
214 }

References operator==().

◆ operator<<() [1/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const ActivationLayerInfo info 
)

Formatted output of the activation function info.

Parameters
[out]osOutput stream.
[in]infoActivationLayerInfo to output.
Returns
Formatted string.

Definition at line 544 of file TypePrinter.h.

545 {
546  if (info != nullptr)
547  {
548  if (info->enabled())
549  {
550  os << info->activation();
551  os << "(";
552  os << "VAL_A=" << info->a() << ",";
553  os << "VAL_B=" << info->b();
554  os << ")";
555  }
556  else
557  {
558  os << "disabled";
559  }
560  }
561  else
562  {
563  os << "nullptr";
564  }
565  return os;
566 }

References arm_compute::test::validation::info.

◆ operator<<() [2/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const ActivationLayerInfo::ActivationFunction act_function 
)

Formatted output of the activation function type.

Parameters
[out]osOutput stream.
[in]act_functionType to output.
Returns
Modified output stream.

Definition at line 461 of file TypePrinter.h.

462 {
463  switch (act_function)
464  {
465  case ActivationLayerInfo::ActivationFunction::ABS:
466  os << "ABS";
467  break;
468  case ActivationLayerInfo::ActivationFunction::LINEAR:
469  os << "LINEAR";
470  break;
471  case ActivationLayerInfo::ActivationFunction::LOGISTIC:
472  os << "LOGISTIC";
473  break;
474  case ActivationLayerInfo::ActivationFunction::RELU:
475  os << "RELU";
476  break;
477  case ActivationLayerInfo::ActivationFunction::BOUNDED_RELU:
478  os << "BOUNDED_RELU";
479  break;
480  case ActivationLayerInfo::ActivationFunction::LEAKY_RELU:
481  os << "LEAKY_RELU";
482  break;
483  case ActivationLayerInfo::ActivationFunction::SOFT_RELU:
484  os << "SOFT_RELU";
485  break;
486  case ActivationLayerInfo::ActivationFunction::SQRT:
487  os << "SQRT";
488  break;
489  case ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU:
490  os << "LU_BOUNDED_RELU";
491  break;
492  case ActivationLayerInfo::ActivationFunction::ELU:
493  os << "ELU";
494  break;
495  case ActivationLayerInfo::ActivationFunction::SQUARE:
496  os << "SQUARE";
497  break;
498  case ActivationLayerInfo::ActivationFunction::TANH:
499  os << "TANH";
500  break;
501  case ActivationLayerInfo::ActivationFunction::IDENTITY:
502  os << "IDENTITY";
503  break;
504  case ActivationLayerInfo::ActivationFunction::HARD_SWISH:
505  os << "HARD_SWISH";
506  break;
507  case ActivationLayerInfo::ActivationFunction::SWISH:
508  os << "SWISH";
509  break;
510  case ActivationLayerInfo::ActivationFunction::GELU:
511  os << "GELU";
512  break;
513 
514  default:
515  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
516  }
517 
518  return os;
519 }

References ARM_COMPUTE_ERROR.

◆ operator<<() [3/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const ArithmeticOperation op 
)

Formatted output of the ArithmeticOperation type.

Parameters
[out]osOutput stream.
[in]opOperation to output.
Returns
Modified output stream.

Definition at line 1747 of file TypePrinter.h.

1748 {
1749  switch (op)
1750  {
1752  os << "ADD";
1753  break;
1755  os << "SUB";
1756  break;
1758  os << "DIV";
1759  break;
1761  os << "MAX";
1762  break;
1764  os << "MIN";
1765  break;
1767  os << "SQUARED_DIFF";
1768  break;
1769  case ArithmeticOperation::POWER:
1770  os << "POWER";
1771  break;
1773  os << "PRELU";
1774  break;
1775  default:
1776  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1777  }
1778 
1779  return os;
1780 }

References ADD, ARM_COMPUTE_ERROR, DIV, MAX, MIN, POWER, PRELU, SQUARED_DIFF, and SUB.

◆ operator<<() [4/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const arm_compute::CpuMatMulSettings settings 
)

Formatted output of the arm_compute::CpuMatMulSettings type.

Parameters
[out]osOutput stream.
[in]settingsarm_compute::CpuMatMulSettings type to output.
Returns
Modified output stream.

Definition at line 3601 of file TypePrinter.h.

3602 {
3603  os << "CpuMatMulSettings="
3604  << "["
3605  << "fast_math=" << settings.fast_math() << ",fixed_format=" << settings.fixed_format() << "]";
3606 
3607  return os;
3608 }

References CpuMatMulSettings::fast_math(), and CpuMatMulSettings::fixed_format().

◆ operator<<() [5/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const arm_compute::MatMulInfo matmul_info 
)

Formatted output of the arm_compute::MatMulInfo type.

Parameters
[out]osOutput stream.
[in]matmul_infoarm_compute::MatMulInfo type to output.
Returns
Modified output stream.

Definition at line 3540 of file TypePrinter.h.

3541 {
3542  os << "MatMulKernelInfo="
3543  << "["
3544  << "adj_lhs=" << matmul_info.adj_lhs() << ", "
3545  << "adj_rhs=" << matmul_info.adj_rhs() << "] ";
3546  return os;
3547 }

References MatMulInfo::adj_lhs(), and MatMulInfo::adj_rhs().

◆ operator<<() [6/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const arm_compute::MatMulKernelInfo matmul_info 
)

Formatted output of the arm_compute::MatMulKernelInfo type.

Parameters
[out]osOutput stream.
[in]matmul_infoarm_compute::MatMulKernelInfo type to output.
Returns
Modified output stream.

Definition at line 3568 of file TypePrinter.h.

3569 {
3570  os << "MatMulKernelInfo="
3571  << "["
3572  << "adj_lhs=" << matmul_info.adj_lhs << ", "
3573  << "adj_rhs=" << matmul_info.adj_rhs << ", "
3574  << "M0=" << matmul_info.m0 << ", "
3575  << "N0=" << matmul_info.n0 << ", "
3576  << "K0=" << matmul_info.k0 << ", "
3577  << "export_rhs_to_cl_image=" << matmul_info.export_rhs_to_cl_image << "]";
3578 
3579  return os;
3580 }

References MatMulKernelInfo::adj_lhs, MatMulKernelInfo::adj_rhs, MatMulKernelInfo::export_rhs_to_cl_image, MatMulKernelInfo::k0, MatMulKernelInfo::m0, and MatMulKernelInfo::n0.

◆ operator<<() [7/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const arm_compute::ScatterInfo info 
)

Formatted output of the arm_compute::ScatterInfo type.

Parameters
[out]osOutput stream.
[in]infoarm_compute::ScatterInfo type to output.
Returns
Modified output stream.

Definition at line 3672 of file TypePrinter.h.

3673 {
3674  os << "ScatterInfo="
3675  << "["
3676  << "Function=" << info.func << ", "
3677  << "InitialiseZero=" << info.zero_initialization << "] ";
3678  return os;
3679 }

References arm_compute::test::validation::info.

◆ operator<<() [8/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const arm_compute::WeightFormat wf 
)

Formatted output of the arm_compute::WeightFormat type.

Parameters
[out]osOutput stream.
[in]wfWeightFormat to output.
Returns
Modified output stream.

Definition at line 3242 of file TypePrinter.h.

3243 {
3244  os << to_string(wf);
3245  return os;
3246 }

References to_string().

◆ operator<<() [9/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const BorderMode mode 
)

Formatted output of the BorderMode type.

Parameters
[out]osOutput stream.
[in]modeType to output.
Returns
Modified output stream.

Definition at line 1015 of file TypePrinter.h.

1016 {
1017  switch (mode)
1018  {
1019  case BorderMode::UNDEFINED:
1020  os << "UNDEFINED";
1021  break;
1022  case BorderMode::CONSTANT:
1023  os << "CONSTANT";
1024  break;
1025  case BorderMode::REPLICATE:
1026  os << "REPLICATE";
1027  break;
1028  default:
1029  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1030  }
1031 
1032  return os;
1033 }

References ARM_COMPUTE_ERROR, CONSTANT, clang_tidy_rules::mode, REPLICATE, and UNDEFINED.

◆ operator<<() [10/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const BorderSize border 
)

Formatted output of the BorderSize type.

Parameters
[out]osOutput stream.
[in]borderType to output.
Returns
Modified output stream.

Definition at line 1042 of file TypePrinter.h.

1043 {
1044  os << border.top << "," << border.right << "," << border.bottom << "," << border.left;
1045 
1046  return os;
1047 }

References BorderSize::bottom, BorderSize::left, BorderSize::right, and BorderSize::top.

◆ operator<<() [11/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const BoundingBoxTransformInfo bbox_info 
)

Formatted output of the BoundingBoxTransformInfo type.

Parameters
[out]osOutput stream.
[in]bbox_infoType to output.
Returns
Modified output stream.

Definition at line 346 of file TypePrinter.h.

347 {
348  auto weights = bbox_info.weights();
349  os << "(" << bbox_info.img_width() << "x" << bbox_info.img_height() << ")~" << bbox_info.scale() << "(weights={"
350  << weights[0] << ", " << weights[1] << ", " << weights[2] << ", " << weights[3] << "})";
351  return os;
352 }

References BoundingBoxTransformInfo::img_height(), BoundingBoxTransformInfo::img_width(), BoundingBoxTransformInfo::scale(), and BoundingBoxTransformInfo::weights().

◆ operator<<() [12/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const BoxNMSLimitInfo info 
)

Formatted output of the BoxNMSLimitInfo type.

Parameters
[out]osOutput stream.
[in]infoBoxNMSLimitInfo to output.
Returns
Modified output stream.

Definition at line 3103 of file TypePrinter.h.

3104 {
3105  os << "{score_thresh=" << info.score_thresh() << ", "
3106  << "nms=" << info.nms() << ", "
3107  << "detections_per_im=" << info.detections_per_im() << ", "
3108  << "soft_nms_enabled=" << info.soft_nms_enabled() << ", "
3109  << "soft_nms_min_score_thres=" << info.soft_nms_min_score_thres() << ", "
3110  << "suppress_size=" << info.suppress_size() << ", "
3111  << "min_size=" << info.min_size() << ", "
3112  << "im_width=" << info.im_width() << ", "
3113  << "im_height=" << info.im_height() << "}";
3114  return os;
3115 }

References arm_compute::test::validation::info.

◆ operator<<() [13/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const Channel channel 
)

Formatted output of the Channel type.

Parameters
[out]osOutput stream.
[in]channelType to output.
Returns
Modified output stream.

Definition at line 948 of file TypePrinter.h.

949 {
950  switch (channel)
951  {
952  case Channel::UNKNOWN:
953  os << "UNKNOWN";
954  break;
955  case Channel::C0:
956  os << "C0";
957  break;
958  case Channel::C1:
959  os << "C1";
960  break;
961  case Channel::C2:
962  os << "C2";
963  break;
964  case Channel::C3:
965  os << "C3";
966  break;
967  case Channel::R:
968  os << "R";
969  break;
970  case Channel::G:
971  os << "G";
972  break;
973  case Channel::B:
974  os << "B";
975  break;
976  case Channel::A:
977  os << "A";
978  break;
979  case Channel::Y:
980  os << "Y";
981  break;
982  case Channel::U:
983  os << "U";
984  break;
985  case Channel::V:
986  os << "V";
987  break;
988  default:
989  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
990  }
991 
992  return os;
993 }

References A, ARM_COMPUTE_ERROR, B, C0, C1, C2, C3, G, R, U, UNKNOWN, V, and Y.

◆ operator<<() [14/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const ClComponentElementwiseBinary::Attributes::ElementwiseOp op 
)

Formatted output of the pute::experimental::dynamic_fusion::ClComponentElementwiseBinary::Attributes::ElementwiseOp type.

Parameters
[out]osOutput stream.
[in]oparm_compute::experimental::dynamic_fusion::ClComponentElementwiseBinary::Attributes::ElementwiseOp type to output.
Returns
Modified output stream.

Definition at line 47 of file ElementwiseBinary.h.

48 {
49  const std::map<ClComponentElementwiseBinary::Attributes::ElementwiseOp, std::string> op_name = {
50  {ClComponentElementwiseBinary::Attributes::ElementwiseOp::Add, "add"},
51  {ClComponentElementwiseBinary::Attributes::ElementwiseOp::Div, "div"},
52  {ClComponentElementwiseBinary::Attributes::ElementwiseOp::Max, "max"},
53  {ClComponentElementwiseBinary::Attributes::ElementwiseOp::Min, "min"},
54  {ClComponentElementwiseBinary::Attributes::ElementwiseOp::Mul, "mul"},
55  {ClComponentElementwiseBinary::Attributes::ElementwiseOp::Power, "power"},
56  {ClComponentElementwiseBinary::Attributes::ElementwiseOp::Prelu, "prelu"},
57  {ClComponentElementwiseBinary::Attributes::ElementwiseOp::SquaredDiff, "squareddiff"},
58  {ClComponentElementwiseBinary::Attributes::ElementwiseOp::Sub, "sub"}};
59  os << op_name.at(op);
60  return os;
61 }

References ElementwiseBinaryCommonAttributes::Add, ElementwiseBinaryCommonAttributes::Div, ElementwiseBinaryCommonAttributes::Max, ElementwiseBinaryCommonAttributes::Min, ElementwiseBinaryCommonAttributes::Mul, ElementwiseBinaryCommonAttributes::Power, ElementwiseBinaryCommonAttributes::Prelu, ElementwiseBinaryCommonAttributes::SquaredDiff, and ElementwiseBinaryCommonAttributes::Sub.

◆ operator<<() [15/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const CLTunerMode val 
)

[Print CLTunerMode type]

Formatted output of the CLTunerMode type.

Parameters
[out]osOutput stream.
[in]valCLTunerMode to output.
Returns
Modified output stream.

Definition at line 2578 of file TypePrinter.h.

2579 {
2580  os << to_string(val);
2581  return os;
2582 }

References to_string().

◆ operator<<() [16/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const ComparisonOperation op 
)

Formatted output of the Comparison Operations.

Parameters
[out]osOutput stream.
[in]opType to output.
Returns
Modified output stream.

Definition at line 1857 of file TypePrinter.h.

1858 {
1859  switch (op)
1860  {
1861  case ComparisonOperation::Equal:
1862  os << "Equal";
1863  break;
1864  case ComparisonOperation::NotEqual:
1865  os << "NotEqual";
1866  break;
1867  case ComparisonOperation::Greater:
1868  os << "Greater";
1869  break;
1870  case ComparisonOperation::GreaterEqual:
1871  os << "GreaterEqual";
1872  break;
1873  case ComparisonOperation::Less:
1874  os << "Less";
1875  break;
1876  case ComparisonOperation::LessEqual:
1877  os << "LessEqual";
1878  break;
1879  default:
1880  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1881  }
1882 
1883  return os;
1884 }

References ARM_COMPUTE_ERROR, Equal, Greater, GreaterEqual, Less, LessEqual, and NotEqual.

◆ operator<<() [17/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const ComputeAnchorsInfo anchors_info 
)

Formatted output of the ComputeAnchorsInfo type.

Parameters
[out]osOutput stream.
[in]anchors_infoType to output.
Returns
Modified output stream.

Definition at line 381 of file TypePrinter.h.

382 {
383  os << "(" << anchors_info.feat_width() << "x" << anchors_info.feat_height() << ")~" << anchors_info.spatial_scale();
384  return os;
385 }

References ComputeAnchorsInfo::feat_height(), ComputeAnchorsInfo::feat_width(), and ComputeAnchorsInfo::spatial_scale().

◆ operator<<() [18/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const Conv2dInfo conv_info 
)

Formatted output of the Conv2dInfo type.

Parameters
[out]osOutput stream.
[in]conv_infoConv2dInfo to output.
Returns
Modified output stream.

Definition at line 2729 of file TypePrinter.h.

2730 {
2731  os << "{conv_info=" << conv_info.conv_info << ", "
2732  << "dilation=" << conv_info.dilation << ", "
2733  << "act_info=" << to_string(conv_info.act_info) << ", "
2734  << "enable_fast_math=" << conv_info.enable_fast_math << ", "
2735  << "num_groups=" << conv_info.num_groups << ","
2736  << "}";
2737  return os;
2738 }

References arm_compute::test::validation::conv_info, and to_string().

◆ operator<<() [19/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const Conv3dInfo conv3d_info 
)

Formatted output of the Conv3dInfo type.

Parameters
[out]osOutput stream.
[in]conv3d_infoType to output.
Returns
Modified output stream.

Definition at line 3150 of file TypePrinter.h.

3151 {
3152  os << conv3d_info.stride;
3153  os << ";";
3154  os << conv3d_info.padding;
3155  os << ";";
3156  os << to_string(conv3d_info.act_info);
3157  os << ";";
3158  os << conv3d_info.dilation;
3159  os << ";";
3160  os << conv3d_info.round_type;
3161  os << ";";
3162  os << conv3d_info.enable_fast_math;
3163 
3164  return os;
3165 }

References Conv3dInfo::act_info, Conv3dInfo::dilation, Conv3dInfo::enable_fast_math, Conv3dInfo::padding, Conv3dInfo::round_type, Conv3dInfo::stride, and to_string().

◆ operator<<() [20/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const ConvertPolicy policy 
)

Formatted output of the ConvertPolicy type.

Parameters
[out]osOutput stream.
[in]policyType to output.
Returns
Modified output stream.

Definition at line 1716 of file TypePrinter.h.

1717 {
1718  switch (policy)
1719  {
1720  case ConvertPolicy::WRAP:
1721  os << "WRAP";
1722  break;
1723  case ConvertPolicy::SATURATE:
1724  os << "SATURATE";
1725  break;
1726  default:
1727  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1728  }
1729 
1730  return os;
1731 }

References ARM_COMPUTE_ERROR, SATURATE, and WRAP.

◆ operator<<() [21/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const ConvolutionInfo conv_info 
)

Formatted output of the ConvolutionInfo type.

Parameters
[out]osOutput stream.
[in]conv_infoConvolutionInfo to output.
Returns
Modified output stream.

Definition at line 2591 of file TypePrinter.h.

2592 {
2593  os << "{PadStrideInfo=" << conv_info.pad_stride_info << ", "
2594  << "depth_multiplier=" << conv_info.depth_multiplier << ", "
2595  << "act_info=" << to_string(conv_info.act_info) << ", "
2596  << "dilation=" << conv_info.dilation << "}";
2597  return os;
2598 }

References arm_compute::test::validation::conv_info, and to_string().

◆ operator<<() [22/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const ConvolutionMethod conv_method 
)

Formatted output of the ConvolutionMethod type.

Parameters
[out]osOutput stream
[in]conv_methodType to output
Returns
Modified output stream.

Definition at line 2169 of file TypePrinter.h.

2170 {
2171  switch (conv_method)
2172  {
2174  os << "GEMM";
2175  break;
2177  os << "DIRECT";
2178  break;
2180  os << "WINOGRAD";
2181  break;
2182  case ConvolutionMethod::FFT:
2183  os << "FFT";
2184  break;
2185  case ConvolutionMethod::GEMM_CONV2D:
2186  os << "GEMM_CONV2D";
2187  break;
2188  default:
2189  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
2190  }
2191 
2192  return os;
2193 }

References ARM_COMPUTE_ERROR, DIRECT, FFT, GEMM, GEMM_CONV2D, and WINOGRAD.

◆ operator<<() [23/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const Coordinates2D coord_2d 
)

Formatted output of the Coordinates2D type.

Parameters
[out]osOutput stream.
[in]coord_2dCoordinates2D to output.
Returns
Modified output stream.

Definition at line 2909 of file TypePrinter.h.

2910 {
2911  os << "{x=" << coord_2d.x << ", "
2912  << "y=" << coord_2d.y << "}";
2913  return os;
2914 }

References Coordinates2D::x, and Coordinates2D::y.

◆ operator<<() [24/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const DataLayout data_layout 
)

[Print DataLayout type]

Formatted output of the DataLayout type.

Parameters
[out]osOutput stream.
[in]data_layoutType to output.
Returns
Modified output stream.

Definition at line 696 of file TypePrinter.h.

697 {
698  switch (data_layout)
699  {
700  case DataLayout::UNKNOWN:
701  os << "UNKNOWN";
702  break;
703  case DataLayout::NHWC:
704  os << "NHWC";
705  break;
706  case DataLayout::NCHW:
707  os << "NCHW";
708  break;
709  case DataLayout::NDHWC:
710  os << "NDHWC";
711  break;
712  case DataLayout::NCDHW:
713  os << "NCDHW";
714  break;
715  default:
716  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
717  }
718 
719  return os;
720 }

References ARM_COMPUTE_ERROR, arm_compute::cpu::data_layout, NCDHW, NCHW, NDHWC, NHWC, and UNKNOWN.

◆ operator<<() [25/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const DataLayoutDimension data_layout_dim 
)

[Print DataLayout type]

Formatted output of the DataLayoutDimension type.

Parameters
[out]osOutput stream.
[in]data_layout_dimData layout dimension to print.
Returns
Modified output stream.

Definition at line 743 of file TypePrinter.h.

744 {
745  switch (data_layout_dim)
746  {
747  case DataLayoutDimension::WIDTH:
748  os << "WIDTH";
749  break;
750  case DataLayoutDimension::HEIGHT:
751  os << "HEIGHT";
752  break;
753  case DataLayoutDimension::CHANNEL:
754  os << "CHANNEL";
755  break;
756  case DataLayoutDimension::DEPTH:
757  os << "DEPTH";
758  break;
759  case DataLayoutDimension::BATCHES:
760  os << "BATCHES";
761  break;
762  default:
763  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
764  }
765  return os;
766 }

References ARM_COMPUTE_ERROR, BATCHES, CHANNEL, DEPTH, HEIGHT, and WIDTH.

◆ operator<<() [26/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const DataType data_type 
)

Formatted output of the DataType type.

Parameters
[out]osOutput stream.
[in]data_typeType to output.
Returns
Modified output stream.

Definition at line 775 of file TypePrinter.h.

776 {
777  switch (data_type)
778  {
779  case DataType::UNKNOWN:
780  os << "UNKNOWN";
781  break;
782  case DataType::U8:
783  os << "U8";
784  break;
785  case DataType::QSYMM8:
786  os << "QSYMM8";
787  break;
788  case DataType::QASYMM8:
789  os << "QASYMM8";
790  break;
791  case DataType::QASYMM8_SIGNED:
792  os << "QASYMM8_SIGNED";
793  break;
794  case DataType::QSYMM8_PER_CHANNEL:
795  os << "QSYMM8_PER_CHANNEL";
796  break;
797  case DataType::S8:
798  os << "S8";
799  break;
800  case DataType::U16:
801  os << "U16";
802  break;
803  case DataType::S16:
804  os << "S16";
805  break;
806  case DataType::QSYMM16:
807  os << "QSYMM16";
808  break;
809  case DataType::QASYMM16:
810  os << "QASYMM16";
811  break;
812  case DataType::U32:
813  os << "U32";
814  break;
815  case DataType::S32:
816  os << "S32";
817  break;
818  case DataType::U64:
819  os << "U64";
820  break;
821  case DataType::S64:
822  os << "S64";
823  break;
824  case DataType::BFLOAT16:
825  os << "BFLOAT16";
826  break;
827  case DataType::F16:
828  os << "F16";
829  break;
830  case DataType::F32:
831  os << "F32";
832  break;
833  case DataType::F64:
834  os << "F64";
835  break;
836  case DataType::SIZET:
837  os << "SIZET";
838  break;
839  default:
840  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
841  }
842 
843  return os;
844 }

References ARM_COMPUTE_ERROR, BFLOAT16, arm_compute::test::validation::data_type, F16, F32, F64, QASYMM16, QASYMM8, QASYMM8_SIGNED, QSYMM16, QSYMM8, QSYMM8_PER_CHANNEL, S16, S32, S64, S8, SIZET, U16, U32, U64, U8, and UNKNOWN.

◆ operator<<() [27/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const DetectionOutputLayerCodeType detection_code 
)

Formatted output of the DetectionOutputLayerCodeType type.

Parameters
[out]osOutput stream
[in]detection_codeType to output
Returns
Modified output stream.

Definition at line 2358 of file TypePrinter.h.

2359 {
2360  switch (detection_code)
2361  {
2362  case DetectionOutputLayerCodeType::CENTER_SIZE:
2363  os << "CENTER_SIZE";
2364  break;
2365  case DetectionOutputLayerCodeType::CORNER:
2366  os << "CORNER";
2367  break;
2368  case DetectionOutputLayerCodeType::CORNER_SIZE:
2369  os << "CORNER_SIZE";
2370  break;
2371  case DetectionOutputLayerCodeType::TF_CENTER:
2372  os << "TF_CENTER";
2373  break;
2374  default:
2375  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
2376  }
2377 
2378  return os;
2379 }

References ARM_COMPUTE_ERROR, CENTER_SIZE, CORNER, CORNER_SIZE, and TF_CENTER.

◆ operator<<() [28/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const DetectionOutputLayerInfo detection_info 
)

Formatted output of the DetectionOutputLayerInfo type.

Parameters
[out]osOutput stream
[in]detection_infoType to output
Returns
Modified output stream.

Definition at line 2400 of file TypePrinter.h.

2401 {
2402  os << "{Classes=" << detection_info.num_classes() << ","
2403  << "ShareLocation=" << detection_info.share_location() << ","
2404  << "CodeType=" << detection_info.code_type() << ","
2405  << "VarianceEncodedInTarget=" << detection_info.variance_encoded_in_target() << ","
2406  << "KeepTopK=" << detection_info.keep_top_k() << ","
2407  << "NMSThreshold=" << detection_info.nms_threshold() << ","
2408  << "Eta=" << detection_info.eta() << ","
2409  << "BackgroundLabelId=" << detection_info.background_label_id() << ","
2410  << "ConfidenceThreshold=" << detection_info.confidence_threshold() << ","
2411  << "TopK=" << detection_info.top_k() << ","
2412  << "NumLocClasses=" << detection_info.num_loc_classes() << "}";
2413 
2414  return os;
2415 }

References DetectionOutputLayerInfo::background_label_id(), DetectionOutputLayerInfo::code_type(), DetectionOutputLayerInfo::confidence_threshold(), DetectionOutputLayerInfo::eta(), DetectionOutputLayerInfo::keep_top_k(), DetectionOutputLayerInfo::nms_threshold(), DetectionOutputLayerInfo::num_classes(), DetectionOutputLayerInfo::num_loc_classes(), DetectionOutputLayerInfo::share_location(), DetectionOutputLayerInfo::top_k(), and DetectionOutputLayerInfo::variance_encoded_in_target().

◆ operator<<() [29/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const DetectionPostProcessLayerInfo detection_info 
)

Formatted output of the DetectionPostProcessLayerInfo type.

Parameters
[out]osOutput stream
[in]detection_infoType to output
Returns
Modified output stream.

Definition at line 2436 of file TypePrinter.h.

2437 {
2438  os << "{MaxDetections=" << detection_info.max_detections() << ","
2439  << "MaxClassesPerDetection=" << detection_info.max_classes_per_detection() << ","
2440  << "NmsScoreThreshold=" << detection_info.nms_score_threshold() << ","
2441  << "NmsIouThreshold=" << detection_info.iou_threshold() << ","
2442  << "NumClasses=" << detection_info.num_classes() << ","
2443  << "ScaleValue_y=" << detection_info.scale_value_y() << ","
2444  << "ScaleValue_x=" << detection_info.scale_value_x() << ","
2445  << "ScaleValue_h=" << detection_info.scale_value_h() << ","
2446  << "ScaleValue_w=" << detection_info.scale_value_w() << ","
2447  << "UseRegularNms=" << detection_info.use_regular_nms() << ","
2448  << "DetectionPerClass=" << detection_info.detection_per_class() << "}";
2449 
2450  return os;
2451 }

References DetectionPostProcessLayerInfo::detection_per_class(), DetectionPostProcessLayerInfo::iou_threshold(), DetectionPostProcessLayerInfo::max_classes_per_detection(), DetectionPostProcessLayerInfo::max_detections(), DetectionPostProcessLayerInfo::nms_score_threshold(), DetectionPostProcessLayerInfo::num_classes(), DetectionPostProcessLayerInfo::scale_value_h(), DetectionPostProcessLayerInfo::scale_value_w(), DetectionPostProcessLayerInfo::scale_value_x(), DetectionPostProcessLayerInfo::scale_value_y(), and DetectionPostProcessLayerInfo::use_regular_nms().

◆ operator<<() [30/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const DetectionWindow detection_window 
)

Formatted output of the DetectionWindow type.

Parameters
[out]osOutput stream
[in]detection_windowType to output
Returns
Modified output stream.

Definition at line 2339 of file TypePrinter.h.

2340 {
2341  os << "{x=" << detection_window.x << ","
2342  << "y=" << detection_window.y << ","
2343  << "width=" << detection_window.width << ","
2344  << "height=" << detection_window.height << ","
2345  << "idx_class=" << detection_window.idx_class << ","
2346  << "score=" << detection_window.score << "}";
2347 
2348  return os;
2349 }

References DetectionWindow::height, DetectionWindow::idx_class, DetectionWindow::score, DetectionWindow::width, DetectionWindow::x, and DetectionWindow::y.

◆ operator<<() [31/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const DimensionRoundingType rounding_type 
)

Formatted output of the DimensionRoundingType type.

Parameters
[out]osOutput stream.
[in]rounding_typeDimensionRoundingType Dimension rounding type when down-scaling, or compute output shape of pooling(2D or 3D).
Returns
Modified output stream.

Definition at line 2063 of file TypePrinter.h.

2064 {
2065  switch (rounding_type)
2066  {
2067  case DimensionRoundingType::CEIL:
2068  os << "CEIL";
2069  break;
2070  case DimensionRoundingType::FLOOR:
2071  os << "FLOOR";
2072  break;
2073  default:
2074  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
2075  }
2076  return os;
2077 }

References ARM_COMPUTE_ERROR, CEIL, and FLOOR.

◆ operator<<() [32/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const Dimensions< T > &  dimensions 
)

Formatted output of the Dimensions type.

Parameters
[out]osOutput stream.
[in]dimensionsType to output.
Returns
Modified output stream.

Definition at line 163 of file TypePrinter.h.

164 {
165  if (dimensions.num_dimensions() > 0)
166  {
167  os << dimensions[0];
168 
169  for (unsigned int d = 1; d < dimensions.num_dimensions(); ++d)
170  {
171  os << "," << dimensions[d];
172  }
173  }
174 
175  return os;
176 }

References Dimensions< T >::num_dimensions().

◆ operator<<() [33/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const ElementWiseUnary op 
)

Formatted output of the Elementwise unary Operations.

Parameters
[out]osOutput stream.
[in]opType to output.
Returns
Modified output stream.

Definition at line 1893 of file TypePrinter.h.

1894 {
1895  switch (op)
1896  {
1897  case ElementWiseUnary::RSQRT:
1898  os << "RSQRT";
1899  break;
1900  case ElementWiseUnary::EXP:
1901  os << "EXP";
1902  break;
1903  case ElementWiseUnary::NEG:
1904  os << "NEG";
1905  break;
1906  case ElementWiseUnary::LOG:
1907  os << "LOG";
1908  break;
1909  case ElementWiseUnary::SIN:
1910  os << "SIN";
1911  break;
1912  case ElementWiseUnary::ABS:
1913  os << "ABS";
1914  break;
1915  case ElementWiseUnary::ROUND:
1916  os << "ROUND";
1917  break;
1918  case ElementWiseUnary::LOGICAL_NOT:
1919  os << "LOGICAL_NOT";
1920  break;
1921  default:
1922  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1923  }
1924 
1925  return os;
1926 }

References ABS, ARM_COMPUTE_ERROR, EXP, LOG, LOGICAL_NOT, NEG, ROUND, RSQRT, and SIN.

◆ operator<<() [34/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const experimental::dynamic_fusion::CastAttributes cast_attr 
)

Formatted output of the arm_compute::experimental::dynamic_fusion::CastAttributes type.

Parameters
[out]osOutput stream.
[in]cast_attrarm_compute::experimental::dynamic_fusion::CastAttributes type to output.
Returns
Modified output stream.

Definition at line 3389 of file TypePrinter.h.

3390 {
3391  os << "CastAttributes="
3392  << "["
3393  << "Data Type=" << cast_attr.data_type() << ", "
3394  << "Convert Policy=" << cast_attr.convert_policy() << "]";
3395 
3396  return os;
3397 }

References CastAttributes::convert_policy(), and CastAttributes::data_type().

◆ operator<<() [35/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const experimental::dynamic_fusion::ClampAttributes clamp_attr 
)

Formatted output of the arm_compute::experimental::dynamic_fusion::ClampAttributes type.

Parameters
[out]osOutput stream.
[in]clamp_attrarm_compute::experimental::dynamic_fusion::ClampAttributes type to output.
Returns
Modified output stream.

Definition at line 3451 of file TypePrinter.h.

3452 {
3453  os << "ClampAttributes="
3454  << "["
3455  << "Min value=" << clamp_attr.min_val() << ", "
3456  << "Max value=" << clamp_attr.max_val() << "]";
3457  return os;
3458 }

References ClampAttributes::max_val(), and ClampAttributes::min_val().

◆ operator<<() [36/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const experimental::dynamic_fusion::Conv2dAttributes conv2d_attr 
)

Formatted output of the arm_compute::experimental::dynamic_fusion::Conv2dAttributes type.

Parameters
[out]osOutput stream.
[in]conv2d_attrarm_compute::experimental::dynamic_fusion::Conv2dAttributes type to output.
Returns
Modified output stream.

Definition at line 3358 of file TypePrinter.h.

3359 {
3360  os << "Conv2dAttributes="
3361  << "["
3362  << "Padding=" << conv2d_attr.pad() << ", "
3363  << "Size2D=" << conv2d_attr.stride() << ", "
3364  << "Dialation=" << conv2d_attr.dilation() << "]";
3365 
3366  return os;
3367 }

References Conv2dAttributes::dilation(), Conv2dAttributes::pad(), and Conv2dAttributes::stride().

◆ operator<<() [37/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const experimental::dynamic_fusion::DepthwiseConv2dAttributes dw_conv2d_attr 
)

Formatted output of the arm_compute::experimental::dynamic_fusion::DepthwiseConv2dAttributes type.

Parameters
[out]osOutput stream.
[in]dw_conv2d_attrarm_compute::experimental::dynamic_fusion::DepthwiseConv2dAttributes type to output.
Returns
Modified output stream.

Definition at line 3418 of file TypePrinter.h.

3420 {
3421  os << "DepthwiseConv2dAttributes="
3422  << "["
3423  << "Padding=" << dw_conv2d_attr.pad() << ", "
3424  << "Size2D=" << dw_conv2d_attr.stride() << ", "
3425  << "Depth Multiplier=" << dw_conv2d_attr.depth_multiplier() << ", "
3426  << "Dilation=" << dw_conv2d_attr.dilation() << ","
3427  << "DimensionRoundingType: " << dw_conv2d_attr.dimension_rounding_type() << "]";
3428 
3429  return os;
3430 }

References DepthwiseConv2dAttributes::depth_multiplier(), DepthwiseConv2dAttributes::dilation(), DepthwiseConv2dAttributes::dimension_rounding_type(), DepthwiseConv2dAttributes::pad(), and DepthwiseConv2dAttributes::stride().

◆ operator<<() [38/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const experimental::dynamic_fusion::GpuPool2dSettings settings 
)

Formatted output of the arm_compute::experimental::dynamic_fusion::GpuPool2dSettings type.

Parameters
[out]osOutput stream
[in]settingsarm_compute::dynamic_fusion::GpuPool2dSettings type to output

Definition at line 3330 of file TypePrinter.h.

3331 {
3332  os << "Settings="
3333  << "["
3334  << "UseInfAsLimit=" << settings.use_inf_as_limit() << "]";
3335  return os;
3336 }

References GpuPool2dSettings::use_inf_as_limit().

◆ operator<<() [39/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const experimental::dynamic_fusion::Pool2dAttributes pool2d_attr 
)

Formatted output of the arm_compute::experimental::dynamic_fusion::Pool2dAttributes type.

Parameters
[out]osOutput stream.
[in]pool2d_attrarm_compute::experimental::dynamic_fusion::Pool2dAttributes type to output.
Returns
Modified output stream.

Definition at line 3299 of file TypePrinter.h.

3300 {
3301  os << "Pool2dAttributes="
3302  << "["
3303  << "PoolingType=" << pool2d_attr.pool_type() << ","
3304  << "PoolSize=" << pool2d_attr.pool_size() << ","
3305  << "Padding=" << pool2d_attr.pad() << ","
3306  << "Stride=" << pool2d_attr.stride() << ","
3307  << "ExcludePadding" << pool2d_attr.exclude_padding() << "]";
3308 
3309  return os;
3310 }

References Pool2dAttributes::exclude_padding(), Pool2dAttributes::pad(), Pool2dAttributes::pool_size(), Pool2dAttributes::pool_type(), and Pool2dAttributes::stride().

◆ operator<<() [40/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const experimental::dynamic_fusion::ResizeAttributes resize_attr 
)

Formatted output of the arm_compute::experimental::dynamic_fusion::ResizeAttributes type.

Parameters
[out]osOutput stream.
[in]resize_attrarm_compute::experimental::dynamic_fusion::ResizeAttributes type to output.
Returns
Modified output stream.

Definition at line 3479 of file TypePrinter.h.

3480 {
3481  os << "ResizeAttributes="
3482  << "["
3483  << "AlignCorners=" << resize_attr.align_corners() << ", "
3484  << "InterpolationPolicy=" << resize_attr.interpolation_policy() << ", "
3485  << "OutputHeight=" << resize_attr.output_height() << ", "
3486  << "OutputWidth=" << resize_attr.output_width() << ", "
3487  << "SamplingPolicy=" << resize_attr.sampling_policy() << "]";
3488  return os;
3489 }

References ResizeAttributes::align_corners(), ResizeAttributes::interpolation_policy(), ResizeAttributes::output_height(), ResizeAttributes::output_width(), and ResizeAttributes::sampling_policy().

◆ operator<<() [41/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const experimental::dynamic_fusion::SoftmaxAttributes softmax_attr 
)

Formatted output of the arm_compute::experimental::dynamic_fusion::SoftmaxAttributes type.

Parameters
[out]osOutput stream.
[in]softmax_attrarm_compute::experimental::dynamic_fusion::SoftmaxAttributes type to output.
Returns
Modified output stream.

Definition at line 3511 of file TypePrinter.h.

3513 {
3514  os << "SoftmaxAttributes="
3515  << "["
3516  << "Beta=" << softmax_attr.beta() << ", "
3517  << "Is Log Softmax=" << softmax_attr.is_log_softmax() << ", "
3518  << "Axis=" << softmax_attr.axis() << "]";
3519  return os;
3520 }

References SoftmaxAttributes::axis(), SoftmaxAttributes::beta(), and SoftmaxAttributes::is_log_softmax().

◆ operator<<() [42/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const FFT1DInfo fft1d_info 
)

Formatted output of the FFT1DInfo type.

Parameters
[out]osOutput stream.
[in]fft1d_infoFFT1DInfo to output.
Returns
Modified output stream.

Definition at line 2854 of file TypePrinter.h.

2855 {
2856  os << "{axis=" << fft1d_info.axis << ", "
2857  << "direction=" << fft1d_info.direction << "}";
2858  return os;
2859 }

References FFT1DInfo::axis, and FFT1DInfo::direction.

◆ operator<<() [43/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const FFT2DInfo fft2d_info 
)

Formatted output of the FFT2DInfo type.

Parameters
[out]osOutput stream.
[in]fft2d_infoFFT2DInfo to output.
Returns
Modified output stream.

Definition at line 2881 of file TypePrinter.h.

2882 {
2883  os << "{axis=" << fft2d_info.axis0 << ", "
2884  << "axis=" << fft2d_info.axis1 << ", "
2885  << "direction=" << fft2d_info.direction << "}";
2886  return os;
2887 }

References FFT2DInfo::axis0, FFT2DInfo::axis1, and FFT2DInfo::direction.

◆ operator<<() [44/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const FFTDirection fft_dir 
)

Formatted output of the FFTDirection type.

Parameters
[out]osOutput stream.
[in]fft_dirFFTDirection to output.
Returns
Modified output stream.

Definition at line 2818 of file TypePrinter.h.

2819 {
2820  switch (fft_dir)
2821  {
2822  case FFTDirection::Forward:
2823  os << "Forward";
2824  break;
2825  case FFTDirection::Inverse:
2826  os << "Inverse";
2827  break;
2828  default:
2829  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
2830  }
2831  return os;
2832 }

References ARM_COMPUTE_ERROR, Forward, and Inverse.

◆ operator<<() [45/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const Format format 
)

Formatted output of the Format type.

Parameters
[out]osOutput stream.
[in]formatType to output.
Returns
Modified output stream.

Definition at line 866 of file TypePrinter.h.

867 {
868  switch (format)
869  {
870  case Format::UNKNOWN:
871  os << "UNKNOWN";
872  break;
873  case Format::U8:
874  os << "U8";
875  break;
876  case Format::S16:
877  os << "S16";
878  break;
879  case Format::U16:
880  os << "U16";
881  break;
882  case Format::S32:
883  os << "S32";
884  break;
885  case Format::U32:
886  os << "U32";
887  break;
888  case Format::F16:
889  os << "F16";
890  break;
891  case Format::F32:
892  os << "F32";
893  break;
894  case Format::UV88:
895  os << "UV88";
896  break;
897  case Format::RGB888:
898  os << "RGB888";
899  break;
900  case Format::RGBA8888:
901  os << "RGBA8888";
902  break;
903  case Format::YUV444:
904  os << "YUV444";
905  break;
906  case Format::YUYV422:
907  os << "YUYV422";
908  break;
909  case Format::NV12:
910  os << "NV12";
911  break;
912  case Format::NV21:
913  os << "NV21";
914  break;
915  case Format::IYUV:
916  os << "IYUV";
917  break;
918  case Format::UYVY422:
919  os << "UYVY422";
920  break;
921  default:
922  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
923  }
924 
925  return os;
926 }

References ARM_COMPUTE_ERROR, F16, F32, update_supported_ops::format, IYUV, NV12, NV21, RGB888, RGBA8888, S16, S32, U16, U32, U8, UNKNOWN, UV88, UYVY422, YUV444, and YUYV422.

◆ operator<<() [46/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const FullyConnectedLayerInfo layer_info 
)

Formatted output of the FullyConnectedLayerInfo type.

Parameters
[out]osOutput stream.
[in]layer_infoFullyConnectedLayerInfo to output.
Returns
Modified output stream.

Definition at line 2620 of file TypePrinter.h.

2621 {
2622  os << "{activation_info=" << to_string(layer_info.activation_info) << ", "
2623  << "weights_trained_layout=" << layer_info.weights_trained_layout << ", "
2624  << "transpose_weights=" << layer_info.transpose_weights << ", "
2625  << "are_weights_reshaped=" << layer_info.are_weights_reshaped << ", "
2626  << "retain_internal_weights=" << layer_info.retain_internal_weights << ", "
2627  << "fp_mixed_precision=" << layer_info.fp_mixed_precision << "}";
2628  return os;
2629 }

References FullyConnectedLayerInfo::activation_info, FullyConnectedLayerInfo::are_weights_reshaped, FullyConnectedLayerInfo::fp_mixed_precision, FullyConnectedLayerInfo::retain_internal_weights, to_string(), FullyConnectedLayerInfo::transpose_weights, and FullyConnectedLayerInfo::weights_trained_layout.

◆ operator<<() [47/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const FuseBatchNormalizationType fuse_type 
)

Formatted output of the FuseBatchNormalizationType type.

Parameters
[out]osOutput stream.
[in]fuse_typeFuseBatchNormalizationType to output.
Returns
Modified output stream.

Definition at line 2936 of file TypePrinter.h.

2937 {
2938  switch (fuse_type)
2939  {
2940  case FuseBatchNormalizationType::CONVOLUTION:
2941  os << "CONVOLUTION";
2942  break;
2943  case FuseBatchNormalizationType::DEPTHWISECONVOLUTION:
2944  os << "DEPTHWISECONVOLUTION";
2945  break;
2946  default:
2947  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
2948  }
2949  return os;
2950 }

References ARM_COMPUTE_ERROR, CONVOLUTION, and DEPTHWISECONVOLUTION.

◆ operator<<() [48/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const GEMMInfo info 
)

Formatted output of the GEMMInfo type.

Parameters
[out]osOutput stream.
[in]infoType to output.
Returns
Modified output stream.

Definition at line 1412 of file TypePrinter.h.

1413 {
1414  os << "{is_a_reshaped=" << info.is_a_reshaped() << ",";
1415  os << "is_b_reshaped=" << info.is_b_reshaped() << ",";
1416  os << "reshape_b_only_on_first_run=" << info.reshape_b_only_on_first_run() << ",";
1417  os << "depth_output_gemm3d=" << info.depth_output_gemm3d() << ",";
1418  os << "reinterpret_input_as_3d=" << info.reinterpret_input_as_3d() << ",";
1419  os << "retain_internal_weights=" << info.retain_internal_weights() << ",";
1420  os << "fp_mixed_precision=" << info.fp_mixed_precision() << ",";
1421  os << "broadcast_bias=" << info.broadcast_bias() << ",";
1422  os << "pretranspose_B=" << info.pretranspose_B() << ",";
1423  os << "}";
1424 
1425  return os;
1426 }

References arm_compute::test::validation::info.

◆ operator<<() [49/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const GEMMKernelInfo gemm_info 
)

Formatted output of the GEMMKernelInfo type.

Parameters
[out]osOutput stream.
[in]gemm_infoType to output.
Returns
Modified output stream.

Definition at line 254 of file TypePrinter.h.

255 {
256  os << "( m=" << gemm_info.m;
257  os << " n=" << gemm_info.n;
258  os << " k=" << gemm_info.k;
259  os << " depth_output_gemm3d=" << gemm_info.depth_output_gemm3d;
260  os << " reinterpret_input_as_3d=" << gemm_info.reinterpret_input_as_3d;
261  os << " broadcast_bias=" << gemm_info.broadcast_bias;
262  os << " fp_mixed_precision=" << gemm_info.fp_mixed_precision;
263  os << " mult_transpose1xW_width=" << gemm_info.mult_transpose1xW_width;
264  os << " mult_interleave4x4_height=" << gemm_info.mult_interleave4x4_height;
265  os << " a_offset=" << gemm_info.a_offset;
266  os << " b_offset=" << gemm_info.b_offset;
267  os << ")";
268  return os;
269 }

References GEMMKernelInfo::a_offset, GEMMKernelInfo::b_offset, GEMMKernelInfo::broadcast_bias, GEMMKernelInfo::depth_output_gemm3d, GEMMKernelInfo::fp_mixed_precision, GEMMKernelInfo::k, GEMMKernelInfo::m, GEMMKernelInfo::mult_interleave4x4_height, GEMMKernelInfo::mult_transpose1xW_width, GEMMKernelInfo::n, and GEMMKernelInfo::reinterpret_input_as_3d.

◆ operator<<() [50/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const GEMMLHSMatrixInfo gemm_info 
)

Formatted output of the GEMMLHSMatrixInfo type.

Parameters
[out]osOutput stream.
[in]gemm_infoType to output.
Returns
Modified output stream.

Definition at line 278 of file TypePrinter.h.

279 {
280  os << "( m0=" << (unsigned int)gemm_info.m0 << " k0=" << gemm_info.k0 << " v0=" << gemm_info.v0
281  << " trans=" << gemm_info.transpose << " inter=" << gemm_info.interleave << "})";
282  return os;
283 }

References GEMMLHSMatrixInfo::interleave, GEMMLHSMatrixInfo::k0, GEMMLHSMatrixInfo::m0, GEMMLHSMatrixInfo::transpose, and GEMMLHSMatrixInfo::v0.

◆ operator<<() [51/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const GEMMLowpOutputStageInfo gemm_info 
)

Formatted output of the GEMMLowpOutputStageInfo type.

Parameters
[out]osOutput stream.
[in]gemm_infoGEMMLowpOutputStageInfo to output.
Returns
Modified output stream.

Definition at line 2693 of file TypePrinter.h.

2694 {
2695  os << "{type=" << gemm_info.type << ", "
2696  << "gemlowp_offset=" << gemm_info.gemmlowp_offset << ", "
2697  << "gemmlowp_multiplier=" << gemm_info.gemmlowp_multiplier << ", "
2698  << "gemmlowp_shift=" << gemm_info.gemmlowp_shift << ", "
2699  << "gemmlowp_min_bound=" << gemm_info.gemmlowp_min_bound << ", "
2700  << "gemmlowp_max_bound=" << gemm_info.gemmlowp_max_bound << ", "
2701  << "gemmlowp_multipliers=" << gemm_info.gemmlowp_multiplier << ", "
2702  << "gemmlowp_shifts=" << gemm_info.gemmlowp_shift << ", "
2703  << "gemmlowp_real_multiplier=" << gemm_info.gemmlowp_real_multiplier << ", "
2704  << "is_quantized_per_channel=" << gemm_info.is_quantized_per_channel << ", "
2705  << "output_data_type=" << gemm_info.output_data_type << "}";
2706  return os;
2707 }

References GEMMLowpOutputStageInfo::gemmlowp_max_bound, GEMMLowpOutputStageInfo::gemmlowp_min_bound, GEMMLowpOutputStageInfo::gemmlowp_multiplier, GEMMLowpOutputStageInfo::gemmlowp_offset, GEMMLowpOutputStageInfo::gemmlowp_real_multiplier, GEMMLowpOutputStageInfo::gemmlowp_shift, GEMMLowpOutputStageInfo::is_quantized_per_channel, GEMMLowpOutputStageInfo::output_data_type, and GEMMLowpOutputStageInfo::type.

◆ operator<<() [52/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const GEMMLowpOutputStageType gemm_type 
)

Formatted output of the GEMMLowpOutputStageType type.

Parameters
[out]osOutput stream.
[in]gemm_typeGEMMLowpOutputStageType to output.
Returns
Modified output stream.

Definition at line 2651 of file TypePrinter.h.

2652 {
2653  switch (gemm_type)
2654  {
2655  case GEMMLowpOutputStageType::NONE:
2656  os << "NONE";
2657  break;
2658  case GEMMLowpOutputStageType::QUANTIZE_DOWN:
2659  os << "QUANTIZE_DOWN";
2660  break;
2661  case GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT:
2662  os << "QUANTIZE_DOWN_FIXEDPOINT";
2663  break;
2664  case GEMMLowpOutputStageType::QUANTIZE_DOWN_FLOAT:
2665  os << "QUANTIZE_DOWN_FLOAT";
2666  break;
2667  default:
2668  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
2669  }
2670  return os;
2671 }

References ARM_COMPUTE_ERROR, arm_compute::mlgo::parser::gemm_type(), NONE, QUANTIZE_DOWN, QUANTIZE_DOWN_FIXEDPOINT, and QUANTIZE_DOWN_FLOAT.

◆ operator<<() [53/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const GEMMReshapeInfo info 
)

Formatted output of the GEMMReshapeInfo type.

Parameters
[out]osOutput stream.
[in]infoType to output.
Returns
Modified output stream.

Definition at line 1393 of file TypePrinter.h.

1394 {
1395  os << "{m=" << info.m() << ",";
1396  os << "n=" << info.n() << ",";
1397  os << "k=" << info.k() << ",";
1398  os << "mult_transpose1xW_width=" << info.mult_transpose1xW_width() << ",";
1399  os << "mult_interleave4x4_height=" << info.mult_interleave4x4_height();
1400  os << "}";
1401 
1402  return os;
1403 }

References arm_compute::test::validation::info.

◆ operator<<() [54/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const GEMMRHSMatrixInfo gemm_info 
)

Formatted output of the GEMMRHSMatrixInfo type.

Parameters
[out]osOutput stream.
[in]gemm_infoType to output.
Returns
Modified output stream.

Definition at line 292 of file TypePrinter.h.

293 {
294  os << "( n0=" << (unsigned int)gemm_info.n0 << " k0=" << gemm_info.k0 << " h0=" << gemm_info.h0
295  << " trans=" << gemm_info.transpose << " inter=" << gemm_info.interleave
296  << " exp_img=" << gemm_info.export_to_cl_image << "})";
297  return os;
298 }

References GEMMRHSMatrixInfo::export_to_cl_image, GEMMRHSMatrixInfo::h0, GEMMRHSMatrixInfo::interleave, GEMMRHSMatrixInfo::k0, GEMMRHSMatrixInfo::n0, and GEMMRHSMatrixInfo::transpose.

◆ operator<<() [55/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const GenerateProposalsInfo proposals_info 
)

Formatted output of the GenerateProposalsInfo type.

Parameters
[out]osOutput stream.
[in]proposals_infoType to output.
Returns
Modified output stream.

Definition at line 407 of file TypePrinter.h.

408 {
409  os << "(" << proposals_info.im_width() << "x" << proposals_info.im_height() << ")~" << proposals_info.im_scale();
410  return os;
411 }

References GenerateProposalsInfo::im_height(), GenerateProposalsInfo::im_scale(), and GenerateProposalsInfo::im_width().

◆ operator<<() [56/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const GPUTarget gpu_target 
)

Formatted output of the GPUTarget type.

Parameters
[out]osOutput stream
[in]gpu_targetType to output
Returns
Modified output stream.

Definition at line 2215 of file TypePrinter.h.

2216 {
2217  switch (gpu_target)
2218  {
2219  case GPUTarget::GPU_ARCH_MASK:
2220  os << "GPU_ARCH_MASK";
2221  break;
2222  case GPUTarget::GPU_GENERATION_MASK:
2223  os << "GPU_GENERATION_MASK";
2224  break;
2225  case GPUTarget::MIDGARD:
2226  os << "MIDGARD";
2227  break;
2228  case GPUTarget::BIFROST:
2229  os << "BIFROST";
2230  break;
2231  case GPUTarget::VALHALL:
2232  os << "VALHALL";
2233  break;
2234  case GPUTarget::FIFTHGEN:
2235  os << "FIFTHGEN";
2236  break;
2237  case GPUTarget::T600:
2238  os << "T600";
2239  break;
2240  case GPUTarget::T700:
2241  os << "T700";
2242  break;
2243  case GPUTarget::T800:
2244  os << "T800";
2245  break;
2246  case GPUTarget::G71:
2247  os << "G71";
2248  break;
2249  case GPUTarget::G72:
2250  os << "G72";
2251  break;
2252  case GPUTarget::G51:
2253  os << "G51";
2254  break;
2255  case GPUTarget::G51BIG:
2256  os << "G51BIG";
2257  break;
2258  case GPUTarget::G51LIT:
2259  os << "G51LIT";
2260  break;
2261  case GPUTarget::G31:
2262  os << "G31";
2263  break;
2264  case GPUTarget::G76:
2265  os << "G76";
2266  break;
2267  case GPUTarget::G52:
2268  os << "G52";
2269  break;
2270  case GPUTarget::G52LIT:
2271  os << "G52LIT";
2272  break;
2273  case GPUTarget::G77:
2274  os << "G77";
2275  break;
2276  case GPUTarget::G57:
2277  os << "G57";
2278  break;
2279  case GPUTarget::G78:
2280  os << "G78";
2281  break;
2282  case GPUTarget::G68:
2283  os << "G68";
2284  break;
2285  case GPUTarget::G78AE:
2286  os << "G78AE";
2287  break;
2288  case GPUTarget::G710:
2289  os << "G710";
2290  break;
2291  case GPUTarget::G610:
2292  os << "G610";
2293  break;
2294  case GPUTarget::G510:
2295  os << "G510";
2296  break;
2297  case GPUTarget::G310:
2298  os << "G310";
2299  break;
2300  case GPUTarget::G715:
2301  os << "G715";
2302  break;
2303  case GPUTarget::G615:
2304  os << "G615";
2305  break;
2306  case GPUTarget::G720:
2307  os << "G720";
2308  break;
2309  case GPUTarget::G620:
2310  os << "G620";
2311  break;
2312  default:
2313  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
2314  }
2315 
2316  return os;
2317 }

References ARM_COMPUTE_ERROR, BIFROST, FIFTHGEN, G31, G310, G51, G510, G51BIG, G51LIT, G52, G52LIT, G57, G610, G615, G620, G68, G71, G710, G715, G72, G720, G76, G77, G78, G78AE, GPU_ARCH_MASK, GPU_GENERATION_MASK, MIDGARD, T600, T700, T800, and VALHALL.

◆ operator<<() [57/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const InterpolationPolicy policy 
)

Formatted output of the InterpolationPolicy type.

Parameters
[out]osOutput stream.
[in]policyType to output.
Returns
Modified output stream.

Definition at line 1092 of file TypePrinter.h.

1093 {
1094  switch (policy)
1095  {
1096  case InterpolationPolicy::NEAREST_NEIGHBOR:
1097  os << "NEAREST_NEIGHBOR";
1098  break;
1099  case InterpolationPolicy::BILINEAR:
1100  os << "BILINEAR";
1101  break;
1102  case InterpolationPolicy::AREA:
1103  os << "AREA";
1104  break;
1105  default:
1106  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1107  }
1108 
1109  return os;
1110 }

References AREA, ARM_COMPUTE_ERROR, BILINEAR, and NEAREST_NEIGHBOR.

◆ operator<<() [58/90]

::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const LSTMParams< T > &  lstm_params 
)

Formatted output of the ScaleKernelInfo type.

Parameters
[out]osOutput stream.
[in]lstm_paramsLSTMParams to output.
Returns
Modified output stream.

Definition at line 3002 of file TypePrinter.h.

3003 {
3004  os << "{input_to_input_weights=" << to_string(lstm_params.input_to_input_weights()) << ", "
3005  << "recurrent_to_input_weights=" << to_string(lstm_params.recurrent_to_input_weights()) << ", "
3006  << "cell_to_input_weights=" << to_string(lstm_params.cell_to_input_weights()) << ", "
3007  << "input_gate_bias=" << to_string(lstm_params.input_gate_bias()) << ", "
3008  << "cell_to_forget_weights=" << to_string(lstm_params.cell_to_forget_weights()) << ", "
3009  << "cell_to_output_weights=" << to_string(lstm_params.cell_to_output_weights()) << ", "
3010  << "projection_weights=" << to_string(lstm_params.projection_weights()) << ", "
3011  << "projection_bias=" << to_string(lstm_params.projection_bias()) << ", "
3012  << "input_layer_norm_weights=" << to_string(lstm_params.input_layer_norm_weights()) << ", "
3013  << "forget_layer_norm_weights=" << to_string(lstm_params.forget_layer_norm_weights()) << ", "
3014  << "cell_layer_norm_weights=" << to_string(lstm_params.cell_layer_norm_weights()) << ", "
3015  << "output_layer_norm_weights=" << to_string(lstm_params.output_layer_norm_weights()) << ", "
3016  << "cell_clip=" << lstm_params.cell_clip() << ", "
3017  << "projection_clip=" << lstm_params.projection_clip() << ", "
3018  << "input_intermediate_scale=" << lstm_params.input_intermediate_scale() << ", "
3019  << "forget_intermediate_scale=" << lstm_params.forget_intermediate_scale() << ", "
3020  << "cell_intermediate_scale=" << lstm_params.cell_intermediate_scale() << ", "
3021  << "hidden_state_zero=" << lstm_params.hidden_state_zero() << ", "
3022  << "hidden_state_scale=" << lstm_params.hidden_state_scale() << ", "
3023  << "has_peephole_opt=" << lstm_params.has_peephole_opt() << ", "
3024  << "has_projection=" << lstm_params.has_projection() << ", "
3025  << "has_cifg_opt=" << lstm_params.has_cifg_opt() << ", "
3026  << "use_layer_norm=" << lstm_params.use_layer_norm() << "}";
3027  return os;
3028 }

References LSTMParams< T >::cell_clip(), LSTMParams< T >::cell_intermediate_scale(), LSTMParams< T >::cell_layer_norm_weights(), LSTMParams< T >::cell_to_forget_weights(), LSTMParams< T >::cell_to_input_weights(), LSTMParams< T >::cell_to_output_weights(), LSTMParams< T >::forget_intermediate_scale(), LSTMParams< T >::forget_layer_norm_weights(), LSTMParams< T >::has_cifg_opt(), LSTMParams< T >::has_peephole_opt(), LSTMParams< T >::has_projection(), LSTMParams< T >::hidden_state_scale(), LSTMParams< T >::hidden_state_zero(), LSTMParams< T >::input_gate_bias(), LSTMParams< T >::input_intermediate_scale(), LSTMParams< T >::input_layer_norm_weights(), LSTMParams< T >::input_to_input_weights(), LSTMParams< T >::output_layer_norm_weights(), LSTMParams< T >::projection_bias(), LSTMParams< T >::projection_clip(), LSTMParams< T >::projection_weights(), LSTMParams< T >::recurrent_to_input_weights(), to_string(), and LSTMParams< T >::use_layer_norm().

◆ operator<<() [59/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const Multiples multiples 
)

Formatted output of the Multiples type.

Parameters
[out]osOutput stream.
[in]multiplesType to output.
Returns
Modified output stream.

Definition at line 1074 of file TypePrinter.h.

1075 {
1076  os << "(";
1077  for (size_t i = 0; i < multiples.size() - 1; i++)
1078  {
1079  os << multiples[i] << ", ";
1080  }
1081  os << multiples.back() << ")";
1082  return os;
1083 }

◆ operator<<() [60/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const NMSType nms_type 
)

Available non maxima suppression types.

Formatted output of the NMSType type.

Parameters
[out]osOutput stream.
[in]nms_typeNMSType to output.
Returns
Modified output stream.

Definition at line 3064 of file TypePrinter.h.

3065 {
3066  switch (nms_type)
3067  {
3068  case NMSType::LINEAR:
3069  os << "LINEAR";
3070  break;
3071  case NMSType::GAUSSIAN:
3072  os << "GAUSSIAN";
3073  break;
3074  case NMSType::ORIGINAL:
3075  os << "ORIGINAL";
3076  break;
3077  default:
3078  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
3079  }
3080  return os;
3081 }

References ARM_COMPUTE_ERROR, GAUSSIAN, LINEAR, and ORIGINAL.

◆ operator<<() [61/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const NormalizationLayerInfo info 
)

Formatted output of NormalizationLayerInfo.

Parameters
[out]osOutput stream.
[in]infoType to output.
Returns
Modified output stream.

Definition at line 628 of file TypePrinter.h.

629 {
630  os << info.type() << ":NormSize=" << info.norm_size();
631  return os;
632 }

References arm_compute::test::validation::info.

◆ operator<<() [62/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const NormType norm_type 
)

Formatted output of the NormType type.

Parameters
[out]osOutput stream.
[in]norm_typeType to output.
Returns
Modified output stream.

Definition at line 588 of file TypePrinter.h.

589 {
590  switch (norm_type)
591  {
592  case NormType::CROSS_MAP:
593  os << "CROSS_MAP";
594  break;
595  case NormType::IN_MAP_1D:
596  os << "IN_MAP_1D";
597  break;
598  case NormType::IN_MAP_2D:
599  os << "IN_MAP_2D";
600  break;
601  default:
602  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
603  }
604 
605  return os;
606 }

References ARM_COMPUTE_ERROR, CROSS_MAP, IN_MAP_1D, and IN_MAP_2D.

◆ operator<<() [63/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const Padding2D padding2d 
)

Formatted output of the Padding2D type.

Parameters
[out]osOutput stream.
[in]padding2dPadding info for 2D dimension shape.
Returns
Modified output stream.

Definition at line 3273 of file TypePrinter.h.

3274 {
3275  os << padding2d.left << "," << padding2d.right << "," << padding2d.top << "," << padding2d.bottom;
3276  return os;
3277 }

References Padding2D::bottom, Padding2D::left, Padding2D::right, and Padding2D::top.

◆ operator<<() [64/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const Padding3D padding3d 
)

Formatted output of the Padding3D type.

Parameters
[out]osOutput stream.
[in]padding3dPadding info for 3D spatial dimension shape.
Returns
Modified output stream.

Definition at line 2036 of file TypePrinter.h.

2037 {
2038  os << padding3d.left << "," << padding3d.right << "," << padding3d.top << "," << padding3d.bottom << ","
2039  << padding3d.front << "," << padding3d.back;
2040  return os;
2041 }

References Padding3D::back, Padding3D::bottom, Padding3D::front, Padding3D::left, Padding3D::right, and Padding3D::top.

◆ operator<<() [65/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const PaddingList padding 
)

Formatted output of the PaddingList type.

Parameters
[out]osOutput stream.
[in]paddingType to output.
Returns
Modified output stream.

Definition at line 1056 of file TypePrinter.h.

1057 {
1058  os << "{";
1059  for (auto const &p : padding)
1060  {
1061  os << "{" << p.first << "," << p.second << "}";
1062  }
1063  os << "}";
1064  return os;
1065 }

◆ operator<<() [66/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const PaddingMode mode 
)

Formatted output of the PaddingMode type.

Parameters
[out]osOutput stream.
[in]modeType to output.
Returns
Modified output stream.

Definition at line 1568 of file TypePrinter.h.

1569 {
1570  switch (mode)
1571  {
1572  case PaddingMode::CONSTANT:
1573  os << "CONSTANT";
1574  break;
1575  case PaddingMode::REFLECT:
1576  os << "REFLECT";
1577  break;
1578  case PaddingMode::SYMMETRIC:
1579  os << "SYMMETRIC";
1580  break;
1581  default:
1582  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1583  }
1584 
1585  return os;
1586 }

References ARM_COMPUTE_ERROR, CONSTANT, clang_tidy_rules::mode, REFLECT, and SYMMETRIC.

◆ operator<<() [67/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const PadStrideInfo pad_stride_info 
)

Formatted output of the PadStrideInfo type.

Parameters
[out]osOutput stream.
[in]pad_stride_infoType to output.
Returns
Modified output stream.

Definition at line 1608 of file TypePrinter.h.

1609 {
1610  os << pad_stride_info.stride().first << "," << pad_stride_info.stride().second;
1611  os << ";";
1612  os << pad_stride_info.pad_left() << "," << pad_stride_info.pad_right() << "," << pad_stride_info.pad_top() << ","
1613  << pad_stride_info.pad_bottom();
1614 
1615  return os;
1616 }

References PadStrideInfo::pad_bottom(), PadStrideInfo::pad_left(), PadStrideInfo::pad_right(), PadStrideInfo::pad_top(), and PadStrideInfo::stride().

◆ operator<<() [68/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const PixelValue pixel_value 
)

Formatted output of the PixelValue type.

Parameters
[out]osOutput stream.
[in]pixel_valuePixelValue to output.
Returns
Modified output stream.

Definition at line 2760 of file TypePrinter.h.

2761 {
2762  os << "{value.u64=" << pixel_value.get<uint64_t>() << "}";
2763  return os;
2764 }

References PixelValue::get().

◆ operator<<() [69/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const Pooling3dLayerInfo info 
)

Formatted output of the Pooling 3d Layer Info.

Parameters
[out]osOutput stream.
[in]infoPooling 3D layer info to print to output stream.
Returns
Modified output stream.

Definition at line 2086 of file TypePrinter.h.

2087 {
2088  os << "{Type=" << info.pool_type << ","
2089  << "IsGlobalPooling=" << info.is_global_pooling;
2090  if (!info.is_global_pooling)
2091  {
2092  os << ","
2093  << "PoolSize=" << info.pool_size << ", "
2094  << "Stride=" << info.stride << ", "
2095  << "Padding=" << info.padding << ", "
2096  << "Exclude Padding=" << info.exclude_padding << ", "
2097  << "fp_mixed_precision=" << info.fp_mixed_precision << ", "
2098  << "DimensionRoundingType=" << info.round_type;
2099  }
2100  os << "}";
2101  return os;
2102 }

References arm_compute::test::validation::info.

◆ operator<<() [70/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const PoolingLayerInfo info 
)

Formatted output of PoolingLayerInfo.

Parameters
[out]osOutput stream.
[in]infoType to output.
Returns
Modified output stream.

Definition at line 668 of file TypePrinter.h.

669 {
670  os << info.pool_type;
671 
672  return os;
673 }

References arm_compute::test::validation::info.

◆ operator<<() [71/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const PoolingType pool_type 
)

Formatted output of the PoolingType type.

Parameters
[out]osOutput stream.
[in]pool_typeType to output.
Returns
Modified output stream.

Definition at line 641 of file TypePrinter.h.

642 {
643  switch (pool_type)
644  {
645  case PoolingType::AVG:
646  os << "AVG";
647  break;
648  case PoolingType::MAX:
649  os << "MAX";
650  break;
651  case PoolingType::L2:
652  os << "L2";
653  break;
654  default:
655  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
656  }
657 
658  return os;
659 }

References ARM_COMPUTE_ERROR, AVG, L2, and MAX.

◆ operator<<() [72/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const PriorBoxLayerInfo info 
)

Formatted output of PriorBoxLayerInfo.

Parameters
[out]osOutput stream.
[in]infoType to output.
Returns
Modified output stream.

Definition at line 2486 of file TypePrinter.h.

2487 {
2488  os << "Clip:" << info.clip() << "Flip:" << info.flip() << "StepX:" << info.steps()[0] << "StepY:" << info.steps()[1]
2489  << "MinSizes:" << info.min_sizes() << "MaxSizes:" << info.max_sizes() << "ImgSizeX:" << info.img_size().x
2490  << "ImgSizeY:" << info.img_size().y << "Offset:" << info.offset() << "Variances:" << info.variances();
2491 
2492  return os;
2493 }

References arm_compute::test::validation::info.

◆ operator<<() [73/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const QuantizationInfo qinfo 
)

Formatted output of the QuantizationInfo type.

Parameters
[out]osOutput stream.
[in]qinfoType to output.
Returns
Modified output stream.

Definition at line 433 of file TypePrinter.h.

434 {
435  const UniformQuantizationInfo uqinfo = qinfo.uniform();
436  os << "Scale:" << uqinfo.scale << "~";
437  os << "Offset:" << uqinfo.offset;
438  return os;
439 }

References UniformQuantizationInfo::offset, arm_compute::test::validation::qinfo, UniformQuantizationInfo::scale, and QuantizationInfo::uniform().

◆ operator<<() [74/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const Rectangle rect 
)

Formatted output of the Rectangle type.

Parameters
[out]osOutput stream.
[in]rectType to output.
Returns
Modified output stream.

Definition at line 1553 of file TypePrinter.h.

1554 {
1555  os << rect.width << "x" << rect.height;
1556  os << "+" << rect.x << "+" << rect.y;
1557 
1558  return os;
1559 }

References Rectangle::height, Rectangle::width, Rectangle::x, and Rectangle::y.

◆ operator<<() [75/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const ReductionOperation op 
)

Formatted output of the Reduction Operations.

Parameters
[out]osOutput stream.
[in]opType to output.
Returns
Modified output stream.

Definition at line 1802 of file TypePrinter.h.

1803 {
1804  switch (op)
1805  {
1806  case ReductionOperation::SUM:
1807  os << "SUM";
1808  break;
1809  case ReductionOperation::SUM_SQUARE:
1810  os << "SUM_SQUARE";
1811  break;
1812  case ReductionOperation::MEAN_SUM:
1813  os << "MEAN_SUM";
1814  break;
1815  case ReductionOperation::ARG_IDX_MAX:
1816  os << "ARG_IDX_MAX";
1817  break;
1818  case ReductionOperation::ARG_IDX_MIN:
1819  os << "ARG_IDX_MIN";
1820  break;
1821  case ReductionOperation::PROD:
1822  os << "PROD";
1823  break;
1825  os << "MIN";
1826  break;
1828  os << "MAX";
1829  break;
1830  default:
1831  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1832  }
1833 
1834  return os;
1835 }

References ARG_IDX_MAX, ARG_IDX_MIN, ARM_COMPUTE_ERROR, MAX, MEAN_SUM, MIN, PROD, SUM, and SUM_SQUARE.

◆ operator<<() [76/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const ROIPoolingLayerInfo pool_info 
)

Formatted output of the ROIPoolingInfo type.

Parameters
[out]osOutput stream.
[in]pool_infoType to output.
Returns
Modified output stream.

Definition at line 228 of file TypePrinter.h.

229 {
230  os << pool_info.pooled_width() << "x" << pool_info.pooled_height() << "~" << pool_info.spatial_scale();
231  return os;
232 }

References ROIPoolingLayerInfo::pooled_height(), ROIPoolingLayerInfo::pooled_width(), and ROIPoolingLayerInfo::spatial_scale().

◆ operator<<() [77/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const RoundingPolicy rounding_policy 
)

Formatted output of the RoundingPolicy type.

Parameters
[out]osOutput stream.
[in]rounding_policyType to output.
Returns
Modified output stream.

Definition at line 185 of file TypePrinter.h.

186 {
187  switch (rounding_policy)
188  {
189  case RoundingPolicy::TO_ZERO:
190  os << "TO_ZERO";
191  break;
192  case RoundingPolicy::TO_NEAREST_UP:
193  os << "TO_NEAREST_UP";
194  break;
195  case RoundingPolicy::TO_NEAREST_EVEN:
196  os << "TO_NEAREST_EVEN";
197  break;
198  default:
199  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
200  }
201 
202  return os;
203 }

References ARM_COMPUTE_ERROR, TO_NEAREST_EVEN, TO_NEAREST_UP, and TO_ZERO.

◆ operator<<() [78/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const SamplingPolicy policy 
)

Formatted output of the SamplingPolicy type.

Parameters
[out]osOutput stream.
[in]policyType to output.
Returns
Modified output stream.

Definition at line 1119 of file TypePrinter.h.

1120 {
1121  switch (policy)
1122  {
1123  case SamplingPolicy::CENTER:
1124  os << "CENTER";
1125  break;
1126  case SamplingPolicy::TOP_LEFT:
1127  os << "TOP_LEFT";
1128  break;
1129  default:
1130  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
1131  }
1132 
1133  return os;
1134 }

References ARM_COMPUTE_ERROR, CENTER, and TOP_LEFT.

◆ operator<<() [79/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const ScaleKernelInfo scale_info 
)

Formatted output of the ScaleKernelInfo type.

Parameters
[out]osOutput stream.
[in]scale_infoScaleKernelInfo to output.
Returns
Modified output stream.

Definition at line 2786 of file TypePrinter.h.

2787 {
2788  os << "{interpolation_policy=" << scale_info.interpolation_policy << ", "
2789  << "BorderMode=" << scale_info.border_mode << ", "
2790  << "PixelValue=" << scale_info.constant_border_value << ", "
2791  << "SamplingPolicy=" << scale_info.sampling_policy << ", "
2792  << "use_padding=" << scale_info.use_padding << ", "
2793  << "align_corners=" << scale_info.align_corners << ", "
2794  << "data_layout=" << scale_info.data_layout << "}";
2795  return os;
2796 }

References ScaleKernelInfo::align_corners, ScaleKernelInfo::border_mode, ScaleKernelInfo::constant_border_value, ScaleKernelInfo::data_layout, ScaleKernelInfo::interpolation_policy, ScaleKernelInfo::sampling_policy, and ScaleKernelInfo::use_padding.

◆ operator<<() [80/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const ScatterFunction function 
)

Formatted output of the scatter function type.

Parameters
[out]osOutput stream.
[in]functionarm_compute::ScatterFunction type to output.
Returns
Modified output stream.

Definition at line 3629 of file TypePrinter.h.

3630 {
3631  switch (function)
3632  {
3633  case ScatterFunction::Update:
3634  os << "UPDATE";
3635  break;
3636  case ScatterFunction::Add:
3637  os << "ADD";
3638  break;
3639  case ScatterFunction::Sub:
3640  os << "SUB";
3641  break;
3642  case ScatterFunction::Max:
3643  os << "MAX";
3644  break;
3645  case ScatterFunction::Min:
3646  os << "MIN";
3647  break;
3648  default:
3649  ARM_COMPUTE_ERROR("NOT_SUPPORTED!");
3650  }
3651  return os;
3652 }

References Add, ARM_COMPUTE_ERROR, Max, Min, Sub, and Update.

◆ operator<<() [81/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const Size2D size 
)

Formatted output of the Size2D type.

Parameters
[out]osOutput stream
[in]sizeType to output
Returns
Modified output stream.

Definition at line 2142 of file TypePrinter.h.

2143 {
2144  os << size.width << "x" << size.height;
2145 
2146  return os;
2147 }

References Size2D::height, and Size2D::width.

◆ operator<<() [82/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const Size3D size 
)

Formatted output of the Size3D type.

Parameters
[out]osOutput stream
[in]sizeType to output
Returns
Modified output stream.

Definition at line 2009 of file TypePrinter.h.

2010 {
2011  os << size.width << "x" << size.height << "x" << size.depth;
2012 
2013  return os;
2014 }

References Size3D::depth, Size3D::height, and Size3D::width.

◆ operator<<() [83/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const SoftmaxKernelInfo info 
)

Formatted output of the SoftmaxKernelInfo type.

Parameters
[out]osOutput stream.
[in]infoSoftmaxKernelInfo to output.
Returns
Modified output stream.

Definition at line 2972 of file TypePrinter.h.

2973 {
2974  os << "{beta=" << info.beta << ", "
2975  << "is_log=" << info.is_log << ", "
2976  << "input_data_type=" << info.input_data_type << ", "
2977  << "axis=" << info.axis << "}";
2978  return os;
2979 }

References arm_compute::test::validation::info.

◆ operator<<() [84/90]

::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const std::vector< T > &  args 
)

Formatted output of a vector of objects.

Note
: Using the overloaded to_string() instead of overloaded operator<<(), because to_string() functions are overloaded for all types, where two or more of them can use the same operator<<(), ITensor is an example.
Parameters
[out]osOutput stream
[in]argsVector of objects to print
Returns
Modified output stream.

Definition at line 110 of file TypePrinter.h.

111 {
112  const size_t max_print_size = 5U;
113 
114  os << "[";
115  bool first = true;
116  size_t i;
117  for (i = 0; i < args.size(); ++i)
118  {
119  if (i == max_print_size)
120  {
121  break;
122  }
123  if (first)
124  {
125  first = false;
126  }
127  else
128  {
129  os << ", ";
130  }
131  os << to_string(args[i]);
132  }
133  if (i < args.size())
134  {
135  os << ", ...";
136  }
137  os << "]";
138  return os;
139 }

References GemmTuner::args, to_string(), and arm_compute::utils::cast::U.

◆ operator<<() [85/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const TensorInfo info 
)

Formatted output of the const TensorInfo& type.

Parameters
[out]osOutput stream.
[in]infoType to output.
Returns
Modified output stream.

Definition at line 1173 of file TypePrinter.h.

1174 {
1175  os << &info;
1176  return os;
1177 }

References arm_compute::test::validation::info.

◆ operator<<() [86/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const WeightsInfo weights_info 
)

Formatted output of the WeightsInfo type.

Parameters
[out]osOutput stream.
[in]weights_infoType to output.
Returns
Modified output stream.

Definition at line 212 of file TypePrinter.h.

213 {
214  os << weights_info.are_reshaped() << ";";
215  os << weights_info.num_kernels() << ";" << weights_info.kernel_size().first << ","
216  << weights_info.kernel_size().second;
217 
218  return os;
219 }

References arm_compute::test::validation::weights_info.

◆ operator<<() [87/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const Window win 
)

Formatted output of the Window type.

Parameters
[out]osOutput stream.
[in]winType to output.
Returns
Modified output stream.

Definition at line 1448 of file TypePrinter.h.

1449 {
1450  os << "{";
1451  for (unsigned int i = 0; i < Coordinates::num_max_dimensions; i++)
1452  {
1453  if (i > 0)
1454  {
1455  os << ", ";
1456  }
1457  os << win[i];
1458  }
1459  os << "}";
1460 
1461  return os;
1462 }

References Dimensions< int >::num_max_dimensions.

◆ operator<<() [88/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const Window::Dimension dim 
)

Formatted output of the Window::Dimension type.

Parameters
[out]osOutput stream.
[in]dimType to output.
Returns
Modified output stream.

Definition at line 1435 of file TypePrinter.h.

1436 {
1437  os << "{start=" << dim.start() << ", end=" << dim.end() << ", step=" << dim.step() << "}";
1438 
1439  return os;
1440 }

References Window::Dimension::end(), Window::Dimension::start(), and Window::Dimension::step().

◆ operator<<() [89/90]

inline ::std::ostream& arm_compute::operator<< ( ::std::ostream &  os,
const WinogradInfo info 
)

Formatted output of the WinogradInfo type.

Definition at line 2496 of file TypePrinter.h.

2497 {
2498  os << "{OutputTileSize=" << info.output_tile_size << ","
2499  << "KernelSize=" << info.kernel_size << ","
2500  << "PadStride=" << info.convolution_info << ","
2501  << "OutputDataLayout=" << info.output_data_layout << "}";
2502 
2503  return os;
2504 }

References arm_compute::test::validation::info.

◆ operator<<() [90/90]

inline ::std::ostream& arm_compute::operator<< ( std::ostream &  os,
const ITensorInfo info 
)

Formatted output of the ITensorInfo type.

Parameters
[out]osOutput stream.
[in]infoTensor information.
Returns
Modified output stream.

Definition at line 1143 of file TypePrinter.h.

1144 {
1145  const DataType data_type = info->data_type();
1147 
1148  os << "Shape=" << info->tensor_shape() << ","
1149  << "DataLayout=" << string_from_data_layout(data_layout) << ","
1150  << "DataType=" << string_from_data_type(data_type);
1151 
1153  {
1154  const QuantizationInfo qinfo = info->quantization_info();
1155  const auto scales = qinfo.scale();
1156  const auto offsets = qinfo.offset();
1157 
1158  os << ", QuantizationInfo={"
1159  << "scales.size=" << scales.size() << ", scale(s)=" << scales << ", ";
1160 
1161  os << "offsets.size=" << offsets.size() << ", offset(s)=" << offsets << "}";
1162  }
1163  return os;
1164 }

References arm_compute::cpu::data_layout, ScaleKernelInfo::data_layout, arm_compute::test::validation::data_type, arm_compute::test::validation::info, is_data_type_quantized(), QuantizationInfo::offset(), arm_compute::test::validation::qinfo, QuantizationInfo::scale(), string_from_data_layout(), and string_from_data_type().

◆ operator==() [1/6]

bool arm_compute::operator== ( const Dimensions< T > &  lhs,
const Dimensions< T > &  rhs 
)
inline

Check that given dimensions are equal.

Parameters
[in]lhsLeft-hand side Dimensions.
[in]rhsRight-hand side Dimensions.
Returns
True if the given dimensions are equal.

Definition at line 275 of file Dimensions.h.

276 {
277  return ((lhs.num_dimensions() == rhs.num_dimensions()) && std::equal(lhs.cbegin(), lhs.cend(), rhs.cbegin()));
278 }

References Dimensions< T >::cbegin(), Dimensions< T >::cend(), and Dimensions< T >::num_dimensions().

Referenced by operator!=().

◆ operator==() [2/6]

bool arm_compute::operator== ( const QuantizationInfo lhs,
const QuantizationInfo rhs 
)
inline

Check whether two quantization info are equal.

Parameters
[in]lhsRHS quantization info.
[in]rhsLHS quantization info.
Returns
True if the given quantization info is the same.

Definition at line 175 of file QuantizationInfo.h.

176 {
177  return (lhs.scale() == rhs.scale()) && (lhs.offset() == rhs.offset());
178 }

References QuantizationInfo::offset(), and QuantizationInfo::scale().

◆ operator==() [3/6]

bool arm_compute::operator== ( const TensorInfo lhs,
const TensorInfo rhs 
)
inline

Check whether two tensor info are equal.

Parameters
[in]lhsLHS tensor info.
[in]rhsRHS tensor info.
Returns
True if the given tensor infos are the same.

Definition at line 355 of file TensorInfo.h.

356 {
357  return (lhs._total_size == rhs._total_size) &&
358  (lhs._offset_first_element_in_bytes == rhs._offset_first_element_in_bytes) &&
359  (lhs._strides_in_bytes == rhs._strides_in_bytes) && (lhs._num_channels == rhs._num_channels) &&
360  (lhs._tensor_shape == rhs._tensor_shape) && (lhs._dims_state == rhs._dims_state) &&
361  (lhs._data_type == rhs._data_type) && (lhs._format == rhs._format) &&
362  (lhs._is_resizable == rhs._is_resizable) && (lhs._valid_region == rhs._valid_region) &&
363  (lhs._padding == rhs._padding) && (lhs._quantization_info == rhs._quantization_info) &&
364  (lhs._data_layout == rhs._data_layout) && (lhs._are_values_constant == rhs._are_values_constant) &&
365  (lhs._id == rhs._id);
366 }

◆ operator==() [4/6]

bool arm_compute::operator== ( const UniformQuantizationInfo lhs,
const UniformQuantizationInfo rhs 
)
inline

Check whether two quantization info are equal.

Parameters
[in]lhsRHS quantization info.
[in]rhsLHS quantization info.
Returns
True if the given quantization info is the same.

Definition at line 199 of file QuantizationInfo.h.

200 {
201  return (lhs.scale == rhs.scale) && (lhs.offset == rhs.offset);
202 }

References UniformQuantizationInfo::offset, and UniformQuantizationInfo::scale.

◆ operator==() [5/6]

bool arm_compute::operator== ( const ValidRegion lhs,
const ValidRegion rhs 
)
inline
Parameters
[in]lhsLHS valid region
[in]rhsRHS valid region
Returns
True if the valid regions are the same.

Definition at line 225 of file Types.h.

226 {
227  return (lhs.anchor == rhs.anchor) && (lhs.shape == rhs.shape);
228 }

References ValidRegion::anchor, and ValidRegion::shape.

◆ operator==() [6/6]

bool arm_compute::operator== ( const Window lhs,
const Window rhs 
)
inline
Parameters
[in]lhsLHS window
[in]rhsRHS window
Returns
True if the given windows are the same.

Definition at line 323 of file Window.inl.

324 {
325  return (lhs._dims == rhs._dims) && (lhs._is_broadcasted == rhs._is_broadcasted);
326 }

◆ operator>>() [1/4]

inline ::std::istream& arm_compute::operator>> ( ::std::istream &  is,
BorderMode mode 
)

Formatted input of the BorderMode type.

Parameters
[out]isInput stream.
[in]modeBorder mode.
Returns
the modified input stream.

Definition at line 42 of file TypeReader.h.

43 {
44  std::string value;
45 
46  is >> value;
47 
48  std::transform(value.begin(), value.end(), value.begin(), [](unsigned char c)
49  {
50  return std::toupper(c);
51  });
52 
53  if(value == "UNDEFINED")
54  {
55  mode = BorderMode::UNDEFINED;
56  }
57  else if(value == "CONSTANT")
58  {
59  mode = BorderMode::CONSTANT;
60  }
61  else if(value == "REPLICATE")
62  {
63  mode = BorderMode::REPLICATE;
64  }
65  else
66  {
67  throw std::invalid_argument("Unsupported value '" + value + "' for border mode");
68  }
69 
70  return is;
71 }

References CONSTANT, clang_tidy_rules::mode, REPLICATE, and UNDEFINED.

◆ operator>>() [2/4]

inline ::std::istream& arm_compute::operator>> ( ::std::istream &  stream,
arm_compute::DataLayout data_layout 
)

Input Stream operator for DataLayout.

Parameters
[in]streamStream to parse
[out]data_layoutOutput data layout
Returns
Updated stream

Definition at line 48 of file TypeLoader.h.

49 {
50  std::string value;
51  stream >> value;
53  return stream;
54 }

References arm_compute::cpu::data_layout, and data_layout_from_name().

◆ operator>>() [3/4]

inline ::std::istream& arm_compute::operator>> ( ::std::istream &  stream,
CLTunerMode tuner_mode 
)

Input Stream operator for CLTunerMode.

Parameters
[in]streamStream to parse
[out]tuner_modeOutput tuner mode
Returns
Updated stream

Definition at line 87 of file CLTunerTypes.h.

88 {
89  std::string value;
90  stream >> value;
91  tuner_mode = tuner_mode_from_name(value);
92  return stream;
93 }

References tuner_mode_from_name().

◆ operator>>() [4/4]

inline ::std::istream& arm_compute::operator>> ( ::std::istream &  stream,
DataType data_type 
)

Input Stream operator for DataType.

Parameters
[in]streamStream to parse
[out]data_typeOutput data type
Returns
Updated stream

Definition at line 290 of file DataTypeUtils.h.

291 {
292  std::string value;
293  stream >> value;
295  return stream;
296 }

References arm_compute::test::validation::data_type, and data_type_from_name().

◆ permute() [1/2]

void arm_compute::permute ( Dimensions< T > &  dimensions,
const PermutationVector perm 
)
inline

Permutes given Dimensions according to a permutation vector.

Warning
Validity of permutation is not checked
Parameters
[in,out]dimensionsDimensions to permute
[in]permPermutation vector

Definition at line 144 of file Helpers.h.

145 {
146  auto dimensions_copy = utility::make_array<Dimensions<T>::num_max_dimensions>(dimensions.begin(), dimensions.end());
147  for (unsigned int i = 0; i < perm.num_dimensions(); ++i)
148  {
149  T dimension_val = (perm[i] < dimensions.num_dimensions()) ? dimensions_copy[perm[i]] : 0;
150  dimensions.set(i, dimension_val);
151  }
152 }

References Dimensions< T >::begin(), Dimensions< T >::end(), Dimensions< T >::num_dimensions(), and Dimensions< T >::set().

Referenced by arm_compute::misc::shape_calculator::compute_permutation_output_shape(), PermuteLayerNode::configure_output(), NPYLoader::fill_tensor(), AssetsLibrary::fill_with_generator(), arm_compute::graph_utils::permute_shape(), arm_compute::test::validation::TEST_CASE(), CLDepthwiseConvolutionLayer::validate(), CLGEMMDeconvolutionLayer::validate(), arm_compute::test::validation::validate(), and arm_compute::test::validation::validate_wrap().

◆ permute() [2/2]

void arm_compute::permute ( TensorShape shape,
const PermutationVector perm 
)
inline

Permutes given TensorShape according to a permutation vector.

Warning
Validity of permutation is not checked
Parameters
[in,out]shapeShape to permute
[in]permPermutation vector

Definition at line 161 of file Helpers.h.

162 {
163  TensorShape shape_copy = shape;
164  for (unsigned int i = 0; i < perm.num_dimensions(); ++i)
165  {
166  size_t dimension_val = (perm[i] < shape.num_dimensions()) ? shape_copy[perm[i]] : 1;
167  shape.set(i, dimension_val, false, false); // Avoid changes in _num_dimension
168  }
169 }

References Dimensions< T >::num_dimensions(), and arm_compute::test::validation::shape.

◆ permute_strides()

void arm_compute::permute_strides ( Dimensions< T > &  dimensions,
const PermutationVector perm 
)
inline

Permutes the given dimensions according the permutation vector.

Parameters
[in,out]dimensionsDimensions to be permuted.
[in]permVector describing the permutation.

Definition at line 69 of file Utils.h.

70 {
71  const auto old_dim = utility::make_array<Dimensions<T>::num_max_dimensions>(dimensions.begin(), dimensions.end());
72  for (unsigned int i = 0; i < perm.num_dimensions(); ++i)
73  {
74  T dimension_val = old_dim[i];
75  dimensions.set(perm[i], dimension_val);
76  }
77 }

References Dimensions< T >::begin(), Dimensions< T >::end(), Dimensions< T >::num_dimensions(), and Dimensions< T >::set().

◆ pixel_size_from_format()

size_t arm_compute::pixel_size_from_format ( Format  format)
inline

The size in bytes of the pixel format.

Parameters
[in]formatInput format
Returns
The size in bytes of the pixel format

Definition at line 38 of file FormatUtils.h.

39 {
40  switch (format)
41  {
42  case Format::U8:
43  return 1;
44  case Format::U16:
45  case Format::S16:
46  case Format::BFLOAT16:
47  case Format::F16:
48  case Format::UV88:
49  case Format::YUYV422:
50  case Format::UYVY422:
51  return 2;
52  case Format::RGB888:
53  return 3;
54  case Format::RGBA8888:
55  return 4;
56  case Format::U32:
57  case Format::S32:
58  case Format::F32:
59  return 4;
60  //Doesn't make sense for planar formats:
61  case Format::NV12:
62  case Format::NV21:
63  case Format::IYUV:
64  case Format::YUV444:
65  default:
66  ARM_COMPUTE_ERROR("Undefined pixel size for given format");
67  return 0;
68  }
69 }

References ARM_COMPUTE_ERROR, BFLOAT16, F16, F32, update_supported_ops::format, IYUV, NV12, NV21, RGB888, RGBA8888, S16, S32, U16, U32, U8, UV88, UYVY422, YUV444, and YUYV422.

◆ plane_idx_from_channel()

int arm_compute::plane_idx_from_channel ( Format  format,
Channel  channel 
)
inline

Return the plane index of a given channel given an input format.

Parameters
[in]formatInput format
[in]channelInput channel
Returns
The plane index of the specific channel of the specific format

Definition at line 78 of file FormatUtils.h.

79 {
80  switch (format)
81  {
82  // Single planar formats have a single plane
83  case Format::U8:
84  case Format::U16:
85  case Format::S16:
86  case Format::U32:
87  case Format::S32:
88  case Format::BFLOAT16:
89  case Format::F16:
90  case Format::F32:
91  case Format::UV88:
92  case Format::RGB888:
93  case Format::RGBA8888:
94  case Format::YUYV422:
95  case Format::UYVY422:
96  return 0;
97  // Multi planar formats
98  case Format::NV12:
99  case Format::NV21:
100  {
101  // Channel U and V share the same plane of format UV88
102  switch (channel)
103  {
104  case Channel::Y:
105  return 0;
106  case Channel::U:
107  case Channel::V:
108  return 1;
109  default:
110  ARM_COMPUTE_ERROR("Not supported channel");
111  return 0;
112  }
113  }
114  case Format::IYUV:
115  case Format::YUV444:
116  {
117  switch (channel)
118  {
119  case Channel::Y:
120  return 0;
121  case Channel::U:
122  return 1;
123  case Channel::V:
124  return 2;
125  default:
126  ARM_COMPUTE_ERROR("Not supported channel");
127  return 0;
128  }
129  }
130  default:
131  ARM_COMPUTE_ERROR("Not supported format");
132  return 0;
133  }
134 }

References ARM_COMPUTE_ERROR, BFLOAT16, F16, F32, update_supported_ops::format, IYUV, NV12, NV21, RGB888, RGBA8888, S16, S32, U, U16, U32, U8, UV88, UYVY422, V, Y, YUV444, and YUYV422.

◆ preferred_dummy_work_items_support()

bool preferred_dummy_work_items_support ( const cl::Device &  device)

Helper function to check if "dummy work-items" are preferred to have a power of two NDRange In case dummy work-items is enabled, it is OpenCL kernel responsibility to check if the work-item is out-of range or not.

Parameters
[in]deviceA CL device
Returns
True if dummy work-items should be preferred to dispatch the NDRange

Definition at line 370 of file CLHelpers.cpp.

371 {
372  ARM_COMPUTE_UNUSED(device);
373  // TODO (COMPMID-2044)
374  return true;
375 }

References ARM_COMPUTE_UNUSED.

Referenced by ClGemmLowpMatrixMultiplyNativeKernel::configure(), ClGemmMatrixMultiplyNativeKernel::configure(), ClGemmLowpMatrixMultiplyReshapedKernel::configure(), ClGemmLowpMatrixMultiplyReshapedOnlyRhsKernel::configure(), ClGemmMatrixMultiplyReshapedOnlyRhsKernel::configure(), and ClGemmMatrixMultiplyReshapedKernel::configure().

◆ preferred_vector_width()

size_t preferred_vector_width ( const cl::Device &  device,
DataType  dt 
)

Helper function to get the preferred native vector width size for built-in scalar types that can be put into vectors.

Parameters
[in]deviceA CL device
[in]dtdata type
Returns
preferred vector width

Definition at line 340 of file CLHelpers.cpp.

341 {
342  switch (dt)
343  {
344  case DataType::U8:
345  case DataType::S8:
346  case DataType::QASYMM8:
347  case DataType::QASYMM8_SIGNED:
348  case DataType::QSYMM8:
349  case DataType::QSYMM8_PER_CHANNEL:
350  return device.getInfo<CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR>();
351  case DataType::U16:
352  case DataType::S16:
353  case DataType::QSYMM16:
354  case DataType::QASYMM16:
355  return device.getInfo<CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT>();
356  case DataType::U32:
357  case DataType::S32:
358  return device.getInfo<CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT>();
359  case DataType::F16:
360  case DataType::F32:
361  return device.getInfo<CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT>();
362  case DataType::U64:
363  case DataType::S64:
364  return device.getInfo<CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG>();
365  default:
366  return 1;
367  }
368 }

References dt, F16, F32, QASYMM16, QASYMM8, QASYMM8_SIGNED, QSYMM16, QSYMM8, QSYMM8_PER_CHANNEL, S16, S32, S64, S8, U16, U32, U64, and U8.

◆ quantize_qasymm16() [1/2]

uint16_t arm_compute::quantize_qasymm16 ( float  value,
const QuantizationInfo qinfo 
)
inline

Quantize a value given a 16-bit asymmetric quantization scheme.

Parameters
[in]valueValue to quantize
[in]qinfoQuantization information to use for quantizing
Returns
Quantized value

Definition at line 549 of file QuantizationInfo.h.

550 {
551  return quantize_qasymm16(value, qinfo.uniform());
552 }

References arm_compute::test::validation::qinfo, quantize_qasymm16(), and QuantizationInfo::uniform().

◆ quantize_qasymm16() [2/2]

uint16_t arm_compute::quantize_qasymm16 ( float  value,
const UniformQuantizationInfo qinfo,
RoundingPolicy  rounding_policy = RoundingPolicy::TO_NEAREST_UP 
)
inline

Quantize a value given a 16-bit asymmetric quantization scheme.

Parameters
[in]valueValue to quantize
[in]qinfoQuantization information to use for quantizing
[in]rounding_policy(Optional) Rounding policy to use. Default: nearest up
Returns
Quantized value

Definition at line 521 of file QuantizationInfo.h.

524 {
525  int quantized = arm_compute::round(value / qinfo.scale, rounding_policy) + qinfo.offset;
526  quantized = arm_compute::utility::clamp<int, uint16_t>(quantized);
527  return quantized;
528 }

References QuantizationInfo::offset(), arm_compute::test::validation::qinfo, round(), and QuantizationInfo::scale().

Referenced by arm_compute::cpu::bounding_box_transform_qsymm16(), PixelValue::PixelValue(), arm_compute::test::validation::reference::quantization_layer(), and quantize_qasymm16().

◆ quantize_qasymm8()

uint8_t arm_compute::quantize_qasymm8 ( float  value,
const INFO_TYPE &  qinfo,
RoundingPolicy  rounding_policy = RoundingPolicy::TO_NEAREST_UP 
)
inline

◆ quantize_qasymm8_signed()

◆ quantize_qsymm16() [1/2]

int16_t arm_compute::quantize_qsymm16 ( float  value,
const QuantizationInfo qinfo 
)
inline

Quantize a value given a 16-bit symmetric quantization scheme.

Parameters
[in]valueValue to quantize
[in]qinfoQuantization information to use for quantizing
Returns
Quantized value

Definition at line 496 of file QuantizationInfo.h.

497 {
498  return quantize_qsymm16(value, qinfo.uniform());
499 }

References arm_compute::test::validation::qinfo, quantize_qsymm16(), and QuantizationInfo::uniform().

◆ quantize_qsymm16() [2/2]

int16_t arm_compute::quantize_qsymm16 ( float  value,
const UniformQuantizationInfo qinfo,
RoundingPolicy  rounding_policy = RoundingPolicy::TO_NEAREST_UP 
)
inline

Quantize a value given a 16-bit symmetric quantization scheme.

Parameters
[in]valueValue to quantize
[in]qinfoQuantization information to use for quantizing
[in]rounding_policy(Optional) Rounding policy to use. Default: nearest up
Returns
Quantized value

Definition at line 468 of file QuantizationInfo.h.

471 {
472  int quantized = arm_compute::round(value / qinfo.scale, rounding_policy);
473  quantized = arm_compute::utility::clamp<int, int16_t>(quantized);
474  return quantized;
475 }

References arm_compute::test::validation::qinfo, round(), and QuantizationInfo::scale().

Referenced by arm_compute::cpu::add_qsymm16_neon(), arm_compute::cpu::compute_all_anchors_qasymm16(), ClActivationKernel::configure(), NEQLSTMLayer::configure(), CLQLSTMLayer::configure(), arm_compute::test::validation::convert_to_symmetric(), arm_compute::cpu::neon_qsymm16_activation(), PixelValue::PixelValue(), quantize_qsymm16(), arm_compute::cpu::sub_qsymm16_neon(), NEQLSTMLayer::validate(), and CLQLSTMLayer::validate().

◆ quantize_qsymm8()

int8_t arm_compute::quantize_qsymm8 ( float  value,
const QuantizationInfo qinfo 
)
inline

Quantize a value given a 8-bit symmetric quantization scheme.

Parameters
[in]valueValue to quantize
[in]qinfoQuantization information to use for quantizing
Returns
Quantized value

Definition at line 337 of file QuantizationInfo.h.

338 {
339  int quantized = arm_compute::round(value / qinfo.uniform().scale, RoundingPolicy::TO_NEAREST_UP);
340  quantized = std::max(-128, std::min(quantized, 127));
341  return quantized;
342 }

References arm_compute::test::validation::qinfo, round(), UniformQuantizationInfo::scale, TO_NEAREST_UP, and QuantizationInfo::uniform().

Referenced by PixelValue::PixelValue().

◆ quantize_qsymm8_per_channel()

int8_t arm_compute::quantize_qsymm8_per_channel ( float  value,
const QuantizationInfo qinfo,
size_t  channel_id = 0 
)
inline

Quantize a value given a 8-bit symmetric per channel quantization scheme.

Parameters
[in]valueValue to quantize
[in]qinfoQuantization information to use for quantizing
[in]channel_idchannel index into the scale vector of quantization info
Returns
Quantized value

Definition at line 352 of file QuantizationInfo.h.

353 {
354  int quantized = arm_compute::round(value / qinfo.scale()[channel_id], RoundingPolicy::TO_NEAREST_UP);
355  quantized = std::max(-128, std::min(quantized, 127));
356  return quantized;
357 }

References arm_compute::test::validation::qinfo, round(), QuantizationInfo::scale(), and TO_NEAREST_UP.

Referenced by arm_compute::test::validation::get_symm_quantized_per_channel_bounds().

◆ read_file()

std::string read_file ( const std::string &  filename,
bool  binary 
)

Load an entire file in memory.

Parameters
[in]filenameName of the file to read.
[in]binaryIs it a binary file ?
Returns
The content of the file.

Definition at line 40 of file Utils.cpp.

41 {
42  std::string out;
43  std::ifstream fs;
44 
45 #ifndef ARM_COMPUTE_EXCEPTIONS_DISABLED
46  try
47  {
48 #endif /* ARM_COMPUTE_EXCEPTIONS_DISABLED */
49  fs.exceptions(std::ifstream::failbit | std::ifstream::badbit);
50  std::ios_base::openmode mode = std::ios::in;
51 
52  if (binary)
53  {
54  mode |= std::ios::binary;
55  }
56 
57  fs.open(filename, mode);
58 
59  // Go to the end of the file
60  fs.seekg(0, std::ios::end);
61  // Reserve the memory required to store the file's content
62  out.reserve(fs.tellg());
63  // Go back to the beginning of the file
64  fs.seekg(0, std::ios::beg);
65  // Copy the content of the file
66  out.assign(std::istreambuf_iterator<char>(fs), std::istreambuf_iterator<char>());
67 #ifndef ARM_COMPUTE_EXCEPTIONS_DISABLED
68  }
69  catch (const std::ifstream::failure &e)
70  {
71  ARM_COMPUTE_ERROR_VAR("Accessing %s: %s", filename.c_str(), e.what());
72  }
73 #endif /* ARM_COMPUTE_EXCEPTIONS_DISABLED */
74 
75  return out;
76 }

References ARM_COMPUTE_ERROR_VAR, arm_compute::mlgo::parser::end(), and clang_tidy_rules::mode.

Referenced by ClKernelLibrary::program().

◆ release_prepare_tensors()

void arm_compute::release_prepare_tensors ( WorkspaceData< TensorType > &  workspace,
ITensorPack prep_pack 
)

Definition at line 105 of file MemoryHelpers.h.

106 {
107  workspace.erase(std::remove_if(workspace.begin(), workspace.end(),
108  [&prep_pack](auto &wk)
109  {
110  const bool to_erase = wk.lifetime == experimental::MemoryLifetime::Prepare;
111  if (to_erase)
112  {
113  prep_pack.remove_tensor(wk.slot);
114  }
115  return to_erase;
116  }),
117  workspace.end());
118 }

Referenced by CLWinogradConvolutionLayer::prepare().

◆ release_temporaries()

void arm_compute::release_temporaries ( const experimental::MemoryRequirements mem_reqs,
WorkspaceData< TensorType > &  workspace 
)

Utility function to release tensors with lifetime marked as Prepare.

Definition at line 122 of file MemoryHelpers.h.

123 {
124  for (auto &ws : workspace)
125  {
126  const int slot = ws.slot;
127  for (auto &m : mem_reqs)
128  {
129  if (m.slot == slot && m.lifetime == experimental::MemoryLifetime::Prepare)
130  {
131  auto tensor = ws.tensor.get();
132  tensor->allocator()->free();
133  break;
134  }
135  }
136  }
137 }

References tensor.

Referenced by CLGEMMLowpMatrixMultiplyCore::prepare(), CLGEMMConvolutionLayer::prepare(), and CLConvolutionLayer::prepare().

◆ restore_program_cache_from_file()

void restore_program_cache_from_file ( const std::string &  filename = "cache.bin")

This function loads prebuilt opencl kernels from a file.

Parameters
[in]filenameName of the file to be used to load the kernels

Definition at line 35 of file Utils.cpp.

36 {
37  std::ifstream cache_file(filename, std::ios::binary);
38  if (cache_file.is_open())
39  {
40  if (!CLScheduler::get().is_initialised())
41  {
43  }
44 
45  while (!cache_file.eof())
46  {
47  size_t name_len = 0;
48  size_t binary_len = 0;
49  cache_file.read(reinterpret_cast<char *>(&name_len), sizeof(size_t));
50  cache_file.read(reinterpret_cast<char *>(&binary_len), sizeof(size_t));
51  if (name_len == 0 || binary_len == 0)
52  {
53  break;
54  }
55  std::vector<char> tmp(name_len);
56  std::vector<unsigned char> binary(binary_len);
57  std::string name;
58  cache_file.read(tmp.data(), name_len);
59  name.assign(tmp.data(), name_len);
60  tmp.resize(binary_len);
61  cache_file.read(reinterpret_cast<char *>(binary.data()), binary_len);
63  cl::Program::Binaries binaries{binary};
64  std::vector<cl::Device> devices = context.getInfo<CL_CONTEXT_DEVICES>();
65  cl::Program program(context, devices, binaries);
66  program.build();
67  CLKernelLibrary::get().add_built_program(name, program);
68  }
69  cache_file.close();
70  }
71 }

References CLKernelLibrary::add_built_program(), CLScheduler::context(), arm_compute::test::validation::context, CLScheduler::default_init(), CLKernelLibrary::get(), CLScheduler::get(), and name.

◆ round()

int round ( float  x,
RoundingPolicy  rounding_policy 
)

Return a rounded value of x.

Rounding is done according to the rounding_policy.

Parameters
[in]xFloat value to be rounded.
[in]rounding_policyPolicy determining how rounding is done.
Returns
Rounded value of the argument x.

Definition at line 36 of file Rounding.cpp.

37 {
38  using namespace std;
39  int rounded = 0;
40  switch (rounding_policy)
41  {
42  case RoundingPolicy::TO_ZERO:
43  {
44  rounded = static_cast<int>(x);
45  break;
46  }
47  case RoundingPolicy::TO_NEAREST_UP:
48  {
49  rounded = static_cast<int>(support::cpp11::round(x));
50  break;
51  }
52  case RoundingPolicy::TO_NEAREST_EVEN:
53  {
54 #ifdef __aarch64__
55  asm("fcvtns %x[res], %s[value]" : [res] "=r"(rounded) : [value] "w"(x));
56 #else // __aarch64__
57  ARM_COMPUTE_ERROR("TO_NEAREST_EVEN rounding policy is not supported.");
58 #endif // __aarch64__
59  break;
60  }
61  default:
62  {
63  ARM_COMPUTE_ERROR("Unsupported rounding policy.");
64  break;
65  }
66  }
67 
68  return rounded;
69 }

References ARM_COMPUTE_ERROR, arm_compute::support::cpp11::round(), TO_NEAREST_EVEN, TO_NEAREST_UP, and TO_ZERO.

Referenced by quantize(), Qasymm8QuantizationHelper< QUANTIZED_TYPE >::quantize(), quantize_qasymm16(), quantize_qsymm16(), quantize_qsymm8(), quantize_qsymm8_per_channel(), roi_pooling_layer(), scale_nearest_neighbour_nchw(), arm_compute::scheduler_utils::split_2d(), arm_compute::cpu::sve2_qasymm8_activation(), and arm_compute::cpu::sve2_qasymm8_signed_activation().

◆ rounding_divide_by_pow2() [1/3]

int32_t rounding_divide_by_pow2 ( int32_t  x,
int  exponent 
)
inline

Round to the nearest division by a power-of-two using exponent.

Note
This function calculates the following expression: (x + 2^n -1 ) / 2^n where n = exponent
Parameters
[in]xElement to divide.
[in]exponentInteger value used to round to nearest division by a power-of-two
Returns
the nearest division by a power-of-two using exponent

Definition at line 441 of file NEMath.inl.

442 {
443  const int32_t mask = (1 << exponent) - 1;
444  const int32_t threshold = (mask >> 1) + (x < 0 ? 1 : 0);
445  return (x >> exponent) + ((x & mask) > threshold ? 1 : 0);
446 }

◆ rounding_divide_by_pow2() [2/3]

int32x4_t rounding_divide_by_pow2 ( int32x4_t  x,
int  exponent 
)
inline

Round to the nearest division by a power-of-two using exponent.

Note
This function calculates the following expression: (x + 2^n -1 ) / 2^n where n = exponent
Parameters
[in]xVector of 4 elements
[in]exponentInteger value used to round to nearest division by a power-of-two
Returns
the nearest division by a power-of-two using exponent

Definition at line 433 of file NEMath.inl.

434 {
435  const int32x4_t shift_vec = vdupq_n_s32(-exponent);
436  const int32x4_t fixup = vshrq_n_s32(vandq_s32(x, shift_vec), 31);
437  const int32x4_t fixed_up_x = vqaddq_s32(x, fixup);
438  return vrshlq_s32(fixed_up_x, shift_vec);
439 }

◆ rounding_divide_by_pow2() [3/3]

int32x4_t rounding_divide_by_pow2 ( int32x4_t  x,
int32x4_t  exponent 
)
inline

Round to the nearest division by a power-of-two using exponent.

Note
This function calculates the following expression: (x + 2^n -1 ) / 2^n where n = exponent
Parameters
[in]xVector of 4 elements
[in]exponentVector of 4 elements with integer value used to round to nearest division by a power-of-two
Returns
the nearest division by a power-of-two using exponent

Definition at line 425 of file NEMath.inl.

426 {
427  const int32x4_t shift_vec = vnegq_s32(exponent);
428  const int32x4_t fixup = vshrq_n_s32(vandq_s32(x, shift_vec), 31);
429  const int32x4_t fixed_up_x = vqaddq_s32(x, fixup);
430  return vrshlq_s32(fixed_up_x, shift_vec);
431 }

Referenced by finalize_quantization(), finalize_quantization_int16(), finalize_quantization_symm(), and multiply_by_quantized_multiplier_2row().

◆ run_reverse()

void arm_compute::run_reverse ( const Window window,
const ITensor input,
const ITensor axis,
ITensor output,
bool  use_inverted_axis 
)

Definition at line 96 of file NEReverseKernel.cpp.

98 {
99  unsigned int axis_bit = 0;
100  const int rank = input->info()->num_dimensions();
101 
102  for (unsigned int i = 0; i < axis->info()->dimension(0); ++i)
103  {
104  int axis_i = *(reinterpret_cast<const int *>(axis->buffer()) + i);
105 
106  // The values of axis tensor must be between [-rank, rank-1].
107  if ((axis_i < -rank) || (axis_i >= rank))
108  {
109  ARM_COMPUTE_ERROR("the values of the axis tensor must be within [-rank, rank-1].");
110  }
111 
112  // In case of negative axis value i.e targeted axis(i) = rank + axis(i)
113  if (axis_i < 0)
114  {
115  axis_i = rank + axis_i;
116  }
117 
118  // Reverse ACL axis indices convention i.e. (inverted)axis = (tensor_rank - 1) - axis
119  if (use_inverted_axis)
120  {
121  axis_i = (rank - 1) - axis_i;
122  }
123 
124  axis_bit |= 1 << axis_i;
125  }
126 
127  // Check if we need a left-over loop for the y dimension
128  const int window_step_x = 16 / input->info()->element_size();
129  const int window_start_x = window.x().start();
130  const int window_end_x = window.x().end();
131 
132  Window win(window);
133  win.set(Window::DimX, Window::Dimension(0, 1, 1));
134 
135  Iterator input_it(input, win);
137  win,
138  [&](const Coordinates &id)
139  {
140  int x = window_start_x;
141  for (; x <= (window_end_x - window_step_x); x += window_step_x)
142  {
143  auto in = wrapper::vloadq(reinterpret_cast<T *>(input_it.ptr()) + x);
144 
145  // Reverse 0 axis
146  if (axis_bit & 0x1)
147  {
148  in = wrapper::vrev64(in);
150  }
151 
152  const int offset_x = (axis_bit & 0x1) ? output->info()->dimension(0) - x - window_step_x : x;
153  const int offset_y = (axis_bit & 0x2) ? output->info()->dimension(1) - id.y() - 1 : id.y();
154  const int offset_z = (axis_bit & 0x4) ? output->info()->dimension(2) - id.z() - 1 : id.z();
155  const int offset_w = (axis_bit & 0x8) ? output->info()->dimension(3) - id[3] - 1 : id[3];
156 
157  auto out_ptr =
158  reinterpret_cast<T *>(output->ptr_to_element(Coordinates(offset_x, offset_y, offset_z, offset_w)));
159  wrapper::vstore(out_ptr, in);
160  }
161 
162  // Compute left-over elements
163  for (; x < window_end_x; ++x)
164  {
165  const auto in = *(reinterpret_cast<T *>(input_it.ptr()) + x);
166 
167  const int offset_x = (axis_bit & 0x1) ? output->info()->dimension(0) - x - 1 : x;
168  const int offset_y = (axis_bit & 0x2) ? output->info()->dimension(1) - id.y() - 1 : id.y();
169  const int offset_z = (axis_bit & 0x4) ? output->info()->dimension(2) - id.z() - 1 : id.z();
170  const int offset_w = (axis_bit & 0x8) ? output->info()->dimension(3) - id[3] - 1 : id[3];
171 
172  *reinterpret_cast<T *>(output->ptr_to_element(Coordinates(offset_x, offset_y, offset_z, offset_w))) =
173  in;
174  }
175  },
176  input_it);
177 }

References ARM_COMPUTE_ERROR, ITensor::buffer(), ITensorInfo::dimension(), Window::DimX, Window::Dimension::end(), execute_window_loop(), ITensor::info(), arm_compute::test::validation::input, Iterator::ptr(), ITensor::ptr_to_element(), Window::set(), Window::Dimension::start(), arm_compute::wrapper::vcombine(), arm_compute::wrapper::vgethigh(), arm_compute::wrapper::vgetlow(), arm_compute::wrapper::vloadq(), arm_compute::wrapper::vrev64(), arm_compute::wrapper::vstore(), and Window::x().

◆ save_program_cache_to_file()

void save_program_cache_to_file ( const std::string &  filename = "cache.bin")

This function saves opencl kernels library to a file.

Parameters
[in]filenameName of the file to be used to save the library

Definition at line 73 of file Utils.cpp.

74 {
75  if (CLScheduler::get().is_initialised())
76  {
77  std::ofstream cache_file(filename, std::ios::binary);
78  if (cache_file.is_open())
79  {
80  for (const auto &it : CLKernelLibrary::get().get_built_programs())
81  {
82  std::vector<std::vector<unsigned char>> binaries = it.second.getInfo<CL_PROGRAM_BINARIES>();
83  ARM_COMPUTE_ERROR_ON(binaries.size() != 1);
84  const std::string kernel_name = it.first;
85  size_t kernel_name_size = kernel_name.length();
86  size_t binary_size = binaries[0].size();
87  cache_file.write(reinterpret_cast<char *>(&kernel_name_size), sizeof(size_t));
88  cache_file.write(reinterpret_cast<char *>(&binary_size), sizeof(size_t));
89  cache_file.write(kernel_name.c_str(), kernel_name_size);
90  cache_file.write(reinterpret_cast<const char *>(binaries[0].data()), binaries[0].size());
91  }
92  cache_file.close();
93  }
94  else
95  {
96  ARM_COMPUTE_ERROR("Cannot open cache file");
97  }
98  }
99 }

References ARM_COMPUTE_ERROR, ARM_COMPUTE_ERROR_ON, CLKernelLibrary::get(), CLScheduler::get(), and kernel_name.

◆ scaled_3d_dimensions_signed()

std::tuple< int, int, int > scaled_3d_dimensions_signed ( int  width,
int  height,
int  depth,
int  kernel_width,
int  kernel_height,
int  kernel_depth,
const Pooling3dLayerInfo pool3d_info 
)

Returns calculated width, height and depth of output scaled tensor depending on dimensions rounding mode.

Parameters
[in]widthWidth of input tensor
[in]heightHeight of input tensor
[in]depthDepth of input tensor
[in]kernel_widthKernel width.
[in]kernel_heightKernel height.
[in]kernel_depthKernel depth.
[in]pool3d_infoPad and stride and round information for 3d pooling
Returns
A tuple with the new width in the first position, the new height in the second, and the new depth in the third. Returned values can be < 1

Definition at line 366 of file Utils.cpp.

373 {
374  const int pad_left = pool3d_info.padding.left;
375  const int pad_top = pool3d_info.padding.top;
376  const int pad_right = pool3d_info.padding.right;
377  const int pad_bottom = pool3d_info.padding.bottom;
378  const int pad_front = pool3d_info.padding.front;
379  const int pad_back = pool3d_info.padding.back;
380  const int stride_x = pool3d_info.stride.x();
381  const int stride_y = pool3d_info.stride.y();
382  const int stride_z = pool3d_info.stride.z();
383  int w = 0;
384  int h = 0;
385  int d = 0;
386 
387  switch (pool3d_info.round_type)
388  {
389  case DimensionRoundingType::FLOOR:
390  w = static_cast<int>(
391  std::floor((static_cast<float>(width + pad_left + pad_right - kernel_width) / stride_x) + 1));
392  h = static_cast<int>(
393  std::floor((static_cast<float>(height + pad_top + pad_bottom - kernel_height) / stride_y) + 1));
394  d = static_cast<int>(
395  std::floor((static_cast<float>(depth + pad_front + pad_back - kernel_depth) / stride_z) + 1));
396  break;
397  case DimensionRoundingType::CEIL:
398  w = static_cast<int>(
399  std::ceil((static_cast<float>(width + pad_left + pad_right - kernel_width) / stride_x) + 1));
400  h = static_cast<int>(
401  std::ceil((static_cast<float>(height + pad_top + pad_bottom - kernel_height) / stride_y) + 1));
402  d = static_cast<int>(
403  std::ceil((static_cast<float>(depth + pad_front + pad_back - kernel_depth) / stride_z) + 1));
404  break;
405  default:
406  ARM_COMPUTE_ERROR("Unsupported rounding type");
407  }
408 
409  return std::make_tuple(static_cast<int>(w), static_cast<int>(h), static_cast<int>(d));
410 }

References ARM_COMPUTE_ERROR, Padding3D::back, Padding3D::bottom, CEIL, FLOOR, Padding3D::front, Padding3D::left, Pooling3dLayerInfo::padding, Padding3D::right, Pooling3dLayerInfo::round_type, Pooling3dLayerInfo::stride, Padding3D::top, arm_compute::test::validation::w, Size3D::x(), Size3D::y(), and Size3D::z().

Referenced by arm_compute::misc::shape_calculator::compute_pool3d_shape().

◆ scaled_dimensions()

std::pair< unsigned int, unsigned int > scaled_dimensions ( int  width,
int  height,
int  kernel_width,
int  kernel_height,
const PadStrideInfo pad_stride_info,
const Size2D dilation = Size2D(1U, 1U) 
)

Returns expected width and height of output scaled tensor depending on dimensions rounding mode.

Parameters
[in]widthWidth of input tensor (Number of columns)
[in]heightHeight of input tensor (Number of rows)
[in]kernel_widthKernel width.
[in]kernel_heightKernel height.
[in]pad_stride_infoPad and stride information.
[in]dilation(Optional) Dilation, in elements, across x and y. Defaults to (1, 1).
Returns
A pair with the new width in the first position and the new height in the second.

Definition at line 288 of file Utils.cpp.

294 {
295  const int dilation_x = dilation.x();
296  const int dilation_y = dilation.y();
297  const int pad_left = pad_stride_info.pad_left();
298  const int pad_top = pad_stride_info.pad_top();
299  const int pad_right = pad_stride_info.pad_right();
300  const int pad_bottom = pad_stride_info.pad_bottom();
301  const int stride_x = pad_stride_info.stride().first;
302  const int stride_y = pad_stride_info.stride().second;
303  int w = 0;
304  int h = 0;
305  switch (pad_stride_info.round())
306  {
307  case DimensionRoundingType::FLOOR:
308  w = static_cast<int>(std::floor(
309  (static_cast<float>(width + pad_left + pad_right - (dilation_x * (kernel_width - 1) + 1)) / stride_x) +
310  1));
311  h = static_cast<int>(
312  std::floor((static_cast<float>(height + pad_top + pad_bottom - (dilation_y * (kernel_height - 1) + 1)) /
313  stride_y) +
314  1));
315  break;
316  case DimensionRoundingType::CEIL:
317  w = static_cast<int>(std::ceil(
318  (static_cast<float>(width + pad_left + pad_right - (dilation_x * (kernel_width - 1) + 1)) / stride_x) +
319  1));
320  h = static_cast<int>(
321  std::ceil((static_cast<float>(height + pad_top + pad_bottom - (dilation_y * (kernel_height - 1) + 1)) /
322  stride_y) +
323  1));
324  break;
325  default:
326  ARM_COMPUTE_ERROR("Unsupported rounding type");
327  }
328 
329  w = std::max(1, w);
330  h = std::max(1, h);
331  return std::make_pair(static_cast<unsigned int>(w), static_cast<unsigned int>(h));
332 }

References ARM_COMPUTE_ERROR, CEIL, FLOOR, PadStrideInfo::pad_bottom(), PadStrideInfo::pad_left(), PadStrideInfo::pad_right(), PadStrideInfo::pad_top(), PadStrideInfo::round(), PadStrideInfo::stride(), arm_compute::test::validation::w, Size2D::x(), and Size2D::y().

Referenced by calculate_same_pad(), arm_compute::misc::shape_calculator::compute_deep_convolution_shape(), arm_compute::misc::shape_calculator::compute_depthwise_convolution_shape(), arm_compute::misc::shape_calculator::compute_im2col_conv_shape(), PoolingLayerNode::compute_output_descriptor(), FusedConvolutionBatchNormalizationNode::compute_output_descriptor(), FusedDepthwiseConvolutionBatchNormalizationNode::compute_output_descriptor(), DepthwiseConvolutionLayerNode::compute_output_descriptor(), ConvolutionLayerNode::compute_output_descriptor(), arm_compute::misc::shape_calculator::compute_winograd_output_transform_shape(), ClIm2ColKernel::configure(), CpuIm2ColKernel::configure(), CpuGemmConv2d::configure(), ClGemmConv2d::configure(), arm_compute::test::validation::reference::convolution_layer_nchw(), CpuGemmConv2d::has_opt_impl(), arm_compute::test::validation::reference::im2col_nchw(), arm_compute::test::validation::reference::im2col_nhwc(), ClGemmConv2d::validate(), and CpuGemmConv2d::validate().

◆ scaled_dimensions_signed()

std::pair< int, int > scaled_dimensions_signed ( int  width,
int  height,
int  kernel_width,
int  kernel_height,
const PadStrideInfo pad_stride_info 
)

Returns calculated width and height of output scaled tensor depending on dimensions rounding mode.

Parameters
[in]widthWidth of input tensor (Number of columns)
[in]heightHeight of input tensor (Number of rows)
[in]kernel_widthKernel width.
[in]kernel_heightKernel height.
[in]pad_stride_infoPad and stride information.
Returns
A pair with the new width in the first position and the new height in the second, returned values can be < 1

Definition at line 334 of file Utils.cpp.

336 {
337  const int pad_left = pad_stride_info.pad_left();
338  const int pad_top = pad_stride_info.pad_top();
339  const int pad_right = pad_stride_info.pad_right();
340  const int pad_bottom = pad_stride_info.pad_bottom();
341  const int stride_x = pad_stride_info.stride().first;
342  const int stride_y = pad_stride_info.stride().second;
343  int w = 0;
344  int h = 0;
345  switch (pad_stride_info.round())
346  {
347  case DimensionRoundingType::FLOOR:
348  w = static_cast<int>(
349  std::floor((static_cast<float>(width + pad_left + pad_right - kernel_width) / stride_x) + 1));
350  h = static_cast<int>(
351  std::floor((static_cast<float>(height + pad_top + pad_bottom - kernel_height) / stride_y) + 1));
352  break;
353  case DimensionRoundingType::CEIL:
354  w = static_cast<int>(
355  std::ceil((static_cast<float>(width + pad_left + pad_right - kernel_width) / stride_x) + 1));
356  h = static_cast<int>(
357  std::ceil((static_cast<float>(height + pad_top + pad_bottom - kernel_height) / stride_y) + 1));
358  break;
359  default:
360  ARM_COMPUTE_ERROR("Unsupported rounding type");
361  }
362 
363  return std::make_pair(static_cast<int>(w), static_cast<int>(h));
364 }

References ARM_COMPUTE_ERROR, CEIL, FLOOR, PadStrideInfo::pad_bottom(), PadStrideInfo::pad_left(), PadStrideInfo::pad_right(), PadStrideInfo::pad_top(), PadStrideInfo::round(), PadStrideInfo::stride(), and arm_compute::test::validation::w.

Referenced by arm_compute::misc::shape_calculator::compute_pool_shape().

◆ schedule_kernel_on_ctx()

void schedule_kernel_on_ctx ( CLRuntimeContext ctx,
ICLKernel kernel,
bool  flush = true 
)

Schedules a kernel using the context if not nullptr else uses the legacy scheduling flow.

Parameters
[in]ctxContext to use.
[in]kernelKernel to schedule.
[in]flush(Optional) Specifies if the command queue will be flushed after running the kernel.

Definition at line 138 of file CLHelpers.cpp.

139 {
141  if (ctx)
142  {
143  ARM_COMPUTE_ERROR_ON(ctx->gpu_scheduler() == nullptr);
144  ctx->gpu_scheduler()->enqueue(*kernel, flush);
145  }
146  else
147  {
148  CLScheduler::get().enqueue(*kernel, flush);
149  }
150 }

References ARM_COMPUTE_ERROR_ON, ARM_COMPUTE_ERROR_ON_NULLPTR, CLScheduler::enqueue(), CLScheduler::get(), and CLRuntimeContext::gpu_scheduler().

Referenced by ICLSimpleFunction::run(), and CLInstanceNormalizationLayer::run().

◆ select_preferable_platform()

cl::Platform select_preferable_platform ( CLBackendType  cl_backend_type)

This function selects the OpenCL platform based on the backend type.

Parameters
[in]cl_backend_typeThe OpenCL backend type to use.
Returns
A cl::Platform object.

Definition at line 84 of file CLHelpers.cpp.

85 {
86  std::vector<cl::Platform> platforms;
87  cl::Platform::get(&platforms);
88  ARM_COMPUTE_ERROR_ON_MSG(platforms.size() == 0, "Couldn't find any OpenCL platform");
89 
90  cl::Platform selected_platform{nullptr};
91 
92  // If the user has selected the Native platform, return the first available.
93  switch (cl_backend_type)
94  {
95  case CLBackendType::Native:
96  selected_platform = platforms[0];
97  break;
98  case CLBackendType::Clvk:
99  for (auto p : platforms)
100  {
101  std::string res = p.getInfo<CL_PLATFORM_NAME>();
102  if (res.find("clvk") != std::string::npos)
103  {
104  selected_platform = p;
105  break;
106  }
107  }
108  break;
109  default:
110  ARM_COMPUTE_ERROR("Unsupported backend type");
111  }
112 
113  if (!selected_platform())
114  {
115  ARM_COMPUTE_ERROR("No valid platform found");
116  }
117 
118  return selected_platform;
119 }

References ARM_COMPUTE_ERROR, ARM_COMPUTE_ERROR_ON_MSG, Clvk, and Native.

Referenced by create_opencl_context_and_device().

◆ set_data_layout_if_unknown()

bool arm_compute::set_data_layout_if_unknown ( ITensorInfo info,
DataLayout  data_layout 
)
inline

Set the data layout to the specified value if the current data layout is unknown.

Parameters
[in,out]infoTensor info used to check and assign.
[in]data_layoutNew data layout.
Returns
True if the data type has been changed.

Definition at line 152 of file AutoConfiguration.h.

153 {
155  {
156  info.set_data_layout(data_layout);
157  return true;
158  }
159 
160  return false;
161 }

References arm_compute::cpu::data_layout, ScaleKernelInfo::data_layout, arm_compute::test::validation::info, and UNKNOWN.

◆ set_data_type_if_unknown()

bool arm_compute::set_data_type_if_unknown ( ITensorInfo info,
DataType  data_type 
)
inline

Set the data type and number of channels to the specified value if the current data type is unknown.

Parameters
[in,out]infoTensor info used to check and assign.
[in]data_typeNew data type.
Returns
True if the data type has been changed.

Definition at line 133 of file AutoConfiguration.h.

134 {
135  if (info.data_type() == DataType::UNKNOWN)
136  {
137  info.set_data_type(data_type);
138  return true;
139  }
140 
141  return false;
142 }

References arm_compute::test::validation::data_type, arm_compute::test::validation::info, and UNKNOWN.

Referenced by NELogicalKernel::configure(), CpuSubKernel::configure(), CpuAddMulAddKernel::configure(), and CpuAddKernel::configure().

◆ set_format_if_unknown()

bool arm_compute::set_format_if_unknown ( ITensorInfo info,
Format  format 
)
inline

Set the format, data type and number of channels to the specified value if the current data type is unknown.

Parameters
[in,out]infoTensor info used to check and assign.
[in]formatNew format.
Returns
True if the format has been changed.

Definition at line 114 of file AutoConfiguration.h.

115 {
116  if (info.data_type() == DataType::UNKNOWN)
117  {
118  info.set_format(format);
119  return true;
120  }
121 
122  return false;
123 }

References update_supported_ops::format, arm_compute::test::validation::info, and UNKNOWN.

Referenced by NEBitwiseNotKernel::configure(), NEBitwiseXorKernel::configure(), NEBitwiseOrKernel::configure(), and NEBitwiseAndKernel::configure().

◆ set_quantization_info_if_empty()

bool arm_compute::set_quantization_info_if_empty ( ITensorInfo info,
QuantizationInfo  quantization_info 
)
inline

Set the quantization info to the specified value if the current quantization info is empty and the data type of asymmetric quantized type.

Parameters
[in,out]infoTensor info used to check and assign.
[in]quantization_infoQuantization info
Returns
True if the quantization info has been changed.

Definition at line 171 of file AutoConfiguration.h.

172 {
173  if (info.quantization_info().empty() && (is_data_type_quantized_asymmetric(info.data_type())))
174  {
175  info.set_quantization_info(quantization_info);
176  return true;
177  }
178 
179  return false;
180 }

References arm_compute::test::validation::info, and is_data_type_quantized_asymmetric().

◆ set_shape_if_empty()

bool arm_compute::set_shape_if_empty ( ITensorInfo info,
const TensorShape shape 
)
inline

Set the shape to the specified value if the current assignment is empty.

Parameters
[in,out]infoTensor info used to check and assign.
[in]shapeNew shape.
Returns
True if the shape has been changed.

Definition at line 95 of file AutoConfiguration.h.

96 {
97  if (info.tensor_shape().total_size() == 0)
98  {
99  info.set_tensor_shape(shape);
100  return true;
101  }
102 
103  return false;
104 }

References arm_compute::test::validation::info, and arm_compute::test::validation::shape.

Referenced by NELogicalKernel::configure(), NEBitwiseNotKernel::configure(), NEBitwiseXorKernel::configure(), NEBitwiseAndKernel::configure(), NEBitwiseOrKernel::configure(), CpuSubKernel::configure(), ClCastKernel::configure(), CpuAddMulAddKernel::configure(), CpuCastKernel::configure(), CpuAddKernel::configure(), and CpuMulKernel::configure().

◆ set_unroll_with_pragma()

void set_unroll_with_pragma ( CLBuildOptions built_opts,
std::initializer_list< int >  values 
)

Definition at line 487 of file CLHelpers.cpp.

488 {
489  for (const int value : values)
490  {
491  if (value > max_manual_loop_unrolling)
492  {
493  built_opts.add_option("-DUNROLL_WITH_PRAGMA");
494  return;
495  }
496  }
497 }

References CLBuildOptions::add_option().

Referenced by CLDepthwiseConvolutionLayerNativeKernel::configure().

◆ set_wbsm()

void set_wbsm ( cl::Kernel &  kernel,
cl_int  wbsm_hint 
)

Definition at line 441 of file CLHelpers.cpp.

442 {
443  cl_int err = clSetKernelExecInfo(kernel.get(), CL_KERNEL_EXEC_INFO_WORKGROUP_BATCH_SIZE_MODIFIER_ARM,
444  sizeof(cl_int), &wbsm_hint);
445  ARM_COMPUTE_UNUSED(err);
446  ARM_COMPUTE_ERROR_ON(err != CL_SUCCESS);
447 }

References ARM_COMPUTE_ERROR_ON, ARM_COMPUTE_UNUSED, and clSetKernelExecInfo().

Referenced by enqueue().

◆ string_from_activation_func()

const std::string & string_from_activation_func ( const ActivationFunction act)

Translates a given activation function to a string.

Parameters
[in]actActivationLayerInfo::ActivationFunction to be translated to string.
Returns
The string describing the activation function.

Definition at line 31 of file ActivationFunctionUtils.cpp.

32 {
33  static std::map<ActivationFunction, const std::string> act_map = {{ActivationFunction::ABS, "ABS"},
34  {ActivationFunction::LINEAR, "LINEAR"},
35  {ActivationFunction::LOGISTIC, "LOGISTIC"},
36  {ActivationFunction::RELU, "RELU"},
37  {ActivationFunction::BOUNDED_RELU, "BRELU"},
38  {ActivationFunction::LU_BOUNDED_RELU, "LU_BRELU"},
39  {ActivationFunction::LEAKY_RELU, "LRELU"},
40  {ActivationFunction::SOFT_RELU, "SRELU"},
41  {ActivationFunction::ELU, "ELU"},
42  {ActivationFunction::SQRT, "SQRT"},
43  {ActivationFunction::SQUARE, "SQUARE"},
44  {ActivationFunction::TANH, "TANH"},
45  {ActivationFunction::IDENTITY, "IDENTITY"},
46  {ActivationFunction::HARD_SWISH, "HARD_SWISH"},
47  {ActivationFunction::SWISH, "SWISH"},
48  {ActivationFunction::GELU, "GELU"}
49 
50  };
51 
52  return act_map[act];
53 }

References ABS, BOUNDED_RELU, ELU, GELU, HARD_SWISH, IDENTITY, LEAKY_RELU, LINEAR, LOGISTIC, LU_BOUNDED_RELU, RELU, SOFT_RELU, SQRT, SQUARE, SWISH, and TANH.

Referenced by ClActivationKernel::configure(), ClMatMulNativeKernel::configure(), ClMatMulLowpNativeKernel::configure(), ClGemmMatrixMultiplyNativeKernel::configure(), ClGemmMatrixMultiplyReshapedOnlyRhsMMULKernel::configure(), ClIndirectConv2dKernel::configure(), ClWinogradOutputTransformKernel::configure(), ClDirectConv2dKernel::configure(), ClMulKernel::configure(), ClGemmMatrixMultiplyReshapedOnlyRhsKernel::configure(), CLDepthwiseConvolutionLayerNativeKernel::configure(), ClGemmMatrixMultiplyReshapedKernel::configure(), CLBatchNormalizationLayerKernel::configure(), and ClComplexMulKernel::configure().

◆ string_from_border_mode()

const std::string & string_from_border_mode ( BorderMode  border_mode)

Translates a given border mode policy to a string.

Parameters
[in]border_modeBorderMode to be translated to string.
Returns
The string describing the border mode.

Definition at line 96 of file Utils.cpp.

97 {
98  static std::map<BorderMode, const std::string> border_mode_map = {
99  {BorderMode::UNDEFINED, "UNDEFINED"},
100  {BorderMode::CONSTANT, "CONSTANT"},
101  {BorderMode::REPLICATE, "REPLICATE"},
102  };
103 
104  return border_mode_map[border_mode];
105 }

References CONSTANT, REPLICATE, and UNDEFINED.

Referenced by CLFillBorderKernel::configure().

◆ string_from_channel()

const std::string & string_from_channel ( Channel  channel)

Convert a channel identity into a string.

Parameters
[in]channelChannel to be translated to string.
Returns
The string describing the channel.

Definition at line 78 of file Utils.cpp.

79 {
80  static std::map<Channel, const std::string> channels_map = {{Channel::UNKNOWN, "UNKNOWN"},
81  {Channel::R, "R"},
82  {Channel::G, "G"},
83  {Channel::B, "B"},
84  {Channel::A, "A"},
85  {Channel::Y, "Y"},
86  {Channel::U, "U"},
87  {Channel::V, "V"},
88  {Channel::C0, "C0"},
89  {Channel::C1, "C1"},
90  {Channel::C2, "C2"},
91  {Channel::C3, "C3"}};
92 
93  return channels_map[channel];
94 }

References A, B, C0, C1, C2, C3, G, R, U, UNKNOWN, V, and Y.

◆ string_from_data_layout()

◆ string_from_data_type()

const std::string & string_from_data_type ( DataType  dt)

Convert a data type identity into a string.

Parameters
[in]dtDataType to be translated to string.
Returns
The string describing the data type.

Definition at line 31 of file DataTypeUtils.cpp.

32 {
33  static std::map<DataType, const std::string> dt_map = {
34  {DataType::UNKNOWN, "UNKNOWN"},
35  {DataType::S8, "S8"},
36  {DataType::U8, "U8"},
37  {DataType::S16, "S16"},
38  {DataType::U16, "U16"},
39  {DataType::S32, "S32"},
40  {DataType::U32, "U32"},
41  {DataType::S64, "S64"},
42  {DataType::U64, "U64"},
43  {DataType::F16, "F16"},
44  {DataType::F32, "F32"},
45  {DataType::F64, "F64"},
46  {DataType::SIZET, "SIZET"},
47  {DataType::QSYMM8, "QSYMM8"},
48  {DataType::QSYMM8_PER_CHANNEL, "QSYMM8_PER_CHANNEL"},
49  {DataType::QASYMM8, "QASYMM8"},
50  {DataType::QASYMM8_SIGNED, "QASYMM8_SIGNED"},
51  {DataType::QSYMM16, "QSYMM16"},
52  {DataType::QASYMM16, "QASYMM16"},
53  };
54 
55  return dt_map[dt];
56 }

References dt, F16, F32, F64, QASYMM16, QASYMM8, QASYMM8_SIGNED, QSYMM16, QSYMM8, QSYMM8_PER_CHANNEL, S16, S32, S64, S8, SIZET, U16, U32, U64, U8, and UNKNOWN.

Referenced by ClTransposedConvolutionKernel::configure(), CpuQuantizeKernel::configure(), ClMatMulLowpNativeMMULKernel::configure(), ClWidthConcatenate2TensorsKernel::configure(), ClPool2dKernel::configure(), ClPool3dKernel::configure(), ClActivationKernel::configure(), ClWidthConcatenate4TensorsKernel::configure(), ClMatMulNativeKernel::configure(), CLStridedSliceKernel::configure(), ClMatMulLowpNativeKernel::configure(), ClGemmReshapeLhsMatrixKernel::configure(), CLMaxUnpoolingLayerKernel::configure(), ClGemmMatrixMultiplyNativeKernel::configure(), ClGemmMatrixMultiplyReshapedOnlyRhsMMULKernel::configure(), CLChannelShuffleLayerKernel::configure(), ClIndirectConv2dKernel::configure(), CLSelectKernel::configure(), ClWinogradOutputTransformKernel::configure(), CLQLSTMLayerNormalizationKernel::configure(), CLFFTScaleKernel::configure(), ClSoftmaxKernel::configure(), CLNormalizationLayerKernel::configure(), CLTileKernel::configure(), CLComparisonKernel::configure(), ClCastKernel::configure(), CLFFTDigitReverseKernel::configure(), CLReorgLayerKernel::configure(), CLMeanStdDevNormalizationKernel::configure(), CLNormalizePlanarYUVLayerKernel::configure(), CLRangeKernel::configure(), CLReverseKernel::configure(), CpuScaleKernel::configure(), CLFFTRadixStageKernel::configure(), ClDirectConv2dKernel::configure(), ClCol2ImKernel::configure(), ClDirectConv3dKernel::configure(), ClMatMulNativeMMULKernel::configure(), ClMulKernel::configure(), ClGemmMatrixMultiplyReshapedOnlyRhsKernel::configure(), CLDepthwiseConvolutionLayerNativeKernel::configure(), ClIm2ColKernel::configure(), CLFillBorderKernel::configure(), ClGemmMatrixMultiplyReshapedKernel::configure(), CLDeconvolutionReshapeOutputKernel::configure(), CLBatchNormalizationLayerKernel::configure(), error_on_data_type_not_in(), GpuCkwElementwiseBinary::get_name(), and operator<<().

◆ string_from_format()

const std::string & string_from_format ( Format  format)

Convert a tensor format into a string.

Parameters
[in]formatFormat to be translated to string.
Returns
The string describing the format.

Definition at line 31 of file FormatUtils.cpp.

32 {
33  static std::map<Format, const std::string> formats_map = {
34  {Format::UNKNOWN, "UNKNOWN"}, {Format::U8, "U8"},
35  {Format::S16, "S16"}, {Format::U16, "U16"},
36  {Format::S32, "S32"}, {Format::U32, "U32"},
37  {Format::F16, "F16"}, {Format::F32, "F32"},
38  {Format::UV88, "UV88"}, {Format::RGB888, "RGB888"},
39  {Format::RGBA8888, "RGBA8888"}, {Format::YUV444, "YUV444"},
40  {Format::YUYV422, "YUYV422"}, {Format::NV12, "NV12"},
41  {Format::NV21, "NV21"}, {Format::IYUV, "IYUV"},
42  {Format::UYVY422, "UYVY422"}};
43 
44  return formats_map[format];
45 }

References F16, F32, update_supported_ops::format, IYUV, NV12, NV21, RGB888, RGBA8888, S16, S32, U16, U32, U8, UNKNOWN, UV88, UYVY422, YUV444, and YUYV422.

Referenced by error_on_format_not_in().

◆ string_from_gemmlowp_output_stage()

const std::string & string_from_gemmlowp_output_stage ( GEMMLowpOutputStageType  output_stage)

Translates a given GEMMLowp output stage to a string.

Parameters
[in]output_stageGEMMLowpOutputStageInfo to be translated to string.
Returns
The string describing the GEMMLowp output stage

Definition at line 154 of file Utils.cpp.

155 {
156  static std::map<GEMMLowpOutputStageType, const std::string> output_stage_map = {
157  {GEMMLowpOutputStageType::NONE, ""},
158  {GEMMLowpOutputStageType::QUANTIZE_DOWN, "quantize_down"},
159  {GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT, "quantize_down_fixedpoint"},
160  {GEMMLowpOutputStageType::QUANTIZE_DOWN_FLOAT, "quantize_down_float"}};
161 
162  return output_stage_map[output_stage];
163 }

References NONE, output_stage, QUANTIZE_DOWN, QUANTIZE_DOWN_FIXEDPOINT, and QUANTIZE_DOWN_FLOAT.

Referenced by ClGemmLowpOffsetContributionOutputStageKernel::configure().

◆ string_from_interpolation_policy()

const std::string & string_from_interpolation_policy ( InterpolationPolicy  policy)

Translates a given interpolation policy to a string.

Parameters
[in]policyInterpolationPolicy to be translated to string.
Returns
The string describing the interpolation policy.

Definition at line 30 of file InterpolationPolicyUtils.cpp.

31 {
32  static std::map<InterpolationPolicy, const std::string> interpolation_policy_map = {
33  {InterpolationPolicy::AREA, "AREA"},
34  {InterpolationPolicy::BILINEAR, "BILINEAR"},
35  {InterpolationPolicy::NEAREST_NEIGHBOR, "NEAREST_NEIGHBOUR"},
36  };
37 
38  return interpolation_policy_map[policy];
39 }

References AREA, BILINEAR, and NEAREST_NEIGHBOR.

Referenced by ClScaleKernel::configure(), and CpuScaleKernel::configure().

◆ string_from_norm_type()

const std::string & string_from_norm_type ( NormType  type)

Translates a given normalization type to a string.

Parameters
[in]typeNormType to be translated to string.
Returns
The string describing the normalization type.

Definition at line 107 of file Utils.cpp.

108 {
109  static std::map<NormType, const std::string> norm_type_map = {
110  {NormType::IN_MAP_1D, "IN_MAP_1D"},
111  {NormType::IN_MAP_2D, "IN_MAP_2D"},
112  {NormType::CROSS_MAP, "CROSS_MAP"},
113  };
114 
115  return norm_type_map[type];
116 }

References CROSS_MAP, IN_MAP_1D, IN_MAP_2D, and type.

◆ string_from_pixel_value()

std::string string_from_pixel_value ( const PixelValue value,
const DataType  data_type 
)

Convert a PixelValue to a string, represented through the specific data type.

Parameters
[in]valueThe PixelValue to convert
[in]data_typeThe type to be used to convert the value
Returns
String representation of the PixelValue through the given data type.

Definition at line 165 of file Utils.cpp.

166 {
167  std::stringstream ss;
168  std::string converted_string;
169 
170  switch (data_type)
171  {
172  case DataType::U8:
173  case DataType::QASYMM8:
174  // Needs conversion to 32 bit, otherwise interpreted as ASCII values
175  ss << uint32_t(value.get<uint8_t>());
176  converted_string = ss.str();
177  break;
178  case DataType::S8:
179  case DataType::QASYMM8_SIGNED:
180  case DataType::QSYMM8_PER_CHANNEL:
181  // Needs conversion to 32 bit, otherwise interpreted as ASCII values
182  ss << int32_t(value.get<int8_t>());
183  converted_string = ss.str();
184  break;
185  case DataType::U16:
186  case DataType::QASYMM16:
187  ss << value.get<uint16_t>();
188  converted_string = ss.str();
189  break;
190  case DataType::S16:
191  case DataType::QSYMM16:
192  ss << value.get<int16_t>();
193  converted_string = ss.str();
194  break;
195  case DataType::U32:
196  ss << value.get<uint32_t>();
197  converted_string = ss.str();
198  break;
199  case DataType::S32:
200  ss << value.get<int32_t>();
201  converted_string = ss.str();
202  break;
203  case DataType::F32:
204  converted_string = float_to_string_with_full_precision(value.get<float>());
205  break;
206  case DataType::F16:
207  static_assert(sizeof(half) == 2, "Half must be 16 bit");
208  ss << value.get<half>();
209  converted_string = ss.str();
210  break;
211  default:
212  ARM_COMPUTE_ERROR("Not handled");
213  }
214 
215  return converted_string;
216 }

References ARM_COMPUTE_ERROR, arm_compute::test::validation::data_type, F16, F32, float_to_string_with_full_precision(), PixelValue::get(), QASYMM16, QASYMM8, QASYMM8_SIGNED, QSYMM16, QSYMM8_PER_CHANNEL, S16, S32, S8, arm_compute::test::validation::ss(), U16, U32, and U8.

Referenced by ClFillKernel::configure(), ClScaleKernel::configure(), and CLPadLayerKernel::configure().

◆ string_from_pooling_type()

const std::string & string_from_pooling_type ( PoolingType  type)

Translates a given pooling type to a string.

Parameters
[in]typePoolingType to be translated to string.
Returns
The string describing the pooling type.

Definition at line 118 of file Utils.cpp.

119 {
120  static std::map<PoolingType, const std::string> pool_type_map = {
121  {PoolingType::MAX, "MAX"},
122  {PoolingType::AVG, "AVG"},
123  {PoolingType::L2, "L2"},
124  };
125 
126  return pool_type_map[type];
127 }

References AVG, L2, MAX, and type.

Referenced by ClPool2dKernel::configure(), and ClPool3dKernel::configure().

◆ string_from_target()

const std::string & string_from_target ( GPUTarget  target)

Translates a given gpu device target to string.

Parameters
[in]targetGiven gpu target.
Returns
The string describing the target.

Definition at line 169 of file GPUTarget.cpp.

170 {
171  static std::map<GPUTarget, const std::string> gpu_target_map = {
172  {GPUTarget::MIDGARD, "midgard"}, {GPUTarget::BIFROST, "bifrost"}, {GPUTarget::VALHALL, "valhall"},
173  {GPUTarget::FIFTHGEN, "fifthgen"},
174 
175  {GPUTarget::T600, "t600"}, {GPUTarget::T700, "t700"}, {GPUTarget::T800, "t800"},
176  {GPUTarget::G71, "g71"}, {GPUTarget::G72, "g72"}, {GPUTarget::G51, "g51"},
177  {GPUTarget::G51BIG, "g51big"}, {GPUTarget::G51LIT, "g51lit"}, {GPUTarget::G31, "g31"},
178  {GPUTarget::G76, "g76"}, {GPUTarget::G52, "g52"}, {GPUTarget::G52LIT, "g52lit"},
179  {GPUTarget::G77, "g77"}, {GPUTarget::G57, "g57"}, {GPUTarget::G78, "g78"},
180  {GPUTarget::G68, "g68"}, {GPUTarget::G78AE, "g78ae"}, {GPUTarget::G710, "g710"},
181  {GPUTarget::G610, "g610"}, {GPUTarget::G510, "g510"}, {GPUTarget::G310, "g310"},
182  {GPUTarget::G715, "g715"}, {GPUTarget::G615, "g615"}, {GPUTarget::G720, "g720"},
183  {GPUTarget::G620, "g620"}};
184 
185  return gpu_target_map[target];
186 }

References BIFROST, FIFTHGEN, G31, G310, G51, G510, G51BIG, G51LIT, G52, G52LIT, G57, G610, G615, G620, G68, G71, G710, G715, G72, G720, G76, G77, G78, G78AE, MIDGARD, T600, T700, T800, and VALHALL.

Referenced by arm_compute::cl_gemm::auto_heuristics::select_mlgo_gemm_config_native(), arm_compute::cl_gemm::auto_heuristics::select_mlgo_gemm_config_reshaped(), arm_compute::cl_gemm::auto_heuristics::select_mlgo_gemm_config_reshaped_only_rhs(), and arm_compute::cl_gemm::auto_heuristics::select_mlgo_gemm_kernel().

◆ swap()

void arm_compute::swap ( Window lhs,
Window rhs 
)
inline
Parameters
[in]lhsFirst window to swap.
[in]rhsSecond window to swap.

Definition at line 318 of file Window.inl.

319 {
320  lhs._dims.swap(rhs._dims);
321 }

Referenced by CaffePreproccessor::CaffePreproccessor().

◆ throw_error()

void throw_error ( Status  err)

Throw an std::runtime_error.

Parameters
[in]errError status

Definition at line 47 of file Error.cpp.

48 {
49  ARM_COMPUTE_THROW(std::runtime_error(err.error_description()));
50 }

References ARM_COMPUTE_THROW, and Status::error_description().

◆ to_string() [1/101]

std::string arm_compute::to_string ( CLGEMMKernelType  val)
inline

Converts a CLGEMMKernelType to string.

Parameters
[in]valCLGEMMKernelType value to be converted
Returns
String representing the corresponding CLGEMMKernelType

Definition at line 2548 of file TypePrinter.h.

2549 {
2550  switch (val)
2551  {
2552  case CLGEMMKernelType::NATIVE:
2553  {
2554  return "Native";
2555  }
2556  case CLGEMMKernelType::RESHAPED_ONLY_RHS:
2557  {
2558  return "Reshaped_Only_RHS";
2559  }
2560  case CLGEMMKernelType::RESHAPED:
2561  {
2562  return "Reshaped";
2563  }
2564  default:
2565  {
2566  return "Unknown";
2567  }
2568  }
2569 }

References NATIVE, RESHAPED, and RESHAPED_ONLY_RHS.

◆ to_string() [2/101]

std::string arm_compute::to_string ( const ArithmeticOperation op)
inline

Formatted output of the Arithmetic Operation.

Parameters
[in]opType to output.
Returns
Formatted string.

Definition at line 1788 of file TypePrinter.h.

1789 {
1790  std::stringstream str;
1791  str << op;
1792  return str.str();
1793 }

References caffe_mnist_image_extractor::str.

◆ to_string() [3/101]

std::string arm_compute::to_string ( const arm_compute::ActivationLayerInfo info)
inline

Formatted output of the activation function info type.

Parameters
[in]infoActivationLayerInfo to output.
Returns
Formatted string.

Definition at line 527 of file TypePrinter.h.

528 {
529  std::stringstream str;
530  if (info.enabled())
531  {
532  str << info.activation();
533  }
534  return str.str();
535 }

References arm_compute::test::validation::info, and caffe_mnist_image_extractor::str.

◆ to_string() [4/101]

std::string arm_compute::to_string ( const arm_compute::ActivationLayerInfo::ActivationFunction function)
inline

Formatted output of the activation function type.

Parameters
[in]functionType to output.
Returns
Formatted string.

Definition at line 574 of file TypePrinter.h.

575 {
576  std::stringstream str;
577  str << function;
578  return str.str();
579 }

References caffe_mnist_image_extractor::str.

◆ to_string() [5/101]

std::string arm_compute::to_string ( const arm_compute::CpuMatMulSettings settings)
inline

Formatted output of the arm_compute::CpuMatMulSettings type.

Parameters
[in]settingsarm_compute::CpuMatMulSettings type to output.
Returns
Formatted string.

Definition at line 3615 of file TypePrinter.h.

3616 {
3617  std::stringstream str;
3618  str << settings;
3619  return str.str();
3620 }

References caffe_mnist_image_extractor::str.

◆ to_string() [6/101]

std::string arm_compute::to_string ( const arm_compute::DataLayout data_layout)
inline

Formatted output of the DataLayout type.

Parameters
[in]data_layoutType to output.
Returns
Formatted string.

Definition at line 728 of file TypePrinter.h.

729 {
730  std::stringstream str;
731  str << data_layout;
732  return str.str();
733 }

References arm_compute::cpu::data_layout, and caffe_mnist_image_extractor::str.

◆ to_string() [7/101]

std::string arm_compute::to_string ( const arm_compute::DataType data_type)
inline

Formatted output of the DataType type.

Parameters
[in]data_typeType to output.
Returns
Formatted string.

Definition at line 852 of file TypePrinter.h.

853 {
854  std::stringstream str;
855  str << data_type;
856  return str.str();
857 }

References arm_compute::test::validation::data_type, and caffe_mnist_image_extractor::str.

◆ to_string() [8/101]

std::string arm_compute::to_string ( const arm_compute::MatMulInfo matmul_info)
inline

Formatted output of the arm_compute::MatMulInfo type.

Parameters
[in]matmul_infoarm_compute::MatMulInfo type to output.
Returns
Formatted string.

Definition at line 3554 of file TypePrinter.h.

3555 {
3556  std::stringstream str;
3557  str << matmul_info;
3558  return str.str();
3559 }

References caffe_mnist_image_extractor::str.

◆ to_string() [9/101]

std::string arm_compute::to_string ( const arm_compute::MatMulKernelInfo matmul_info)
inline

Formatted output of the arm_compute::MatMulKernelInfo type.

Parameters
[in]matmul_infoarm_compute::MatMulKernelInfo type to output.
Returns
Formatted string.

Definition at line 3587 of file TypePrinter.h.

3588 {
3589  std::stringstream str;
3590  str << matmul_info;
3591  return str.str();
3592 }

References caffe_mnist_image_extractor::str.

◆ to_string() [10/101]

std::string arm_compute::to_string ( const arm_compute::NormalizationLayerInfo info)
inline

Formatted output of NormalizationLayerInfo.

Parameters
[in]infoType to output.
Returns
Formatted string.

Definition at line 614 of file TypePrinter.h.

615 {
616  std::stringstream str;
617  str << info.type() << ":NormSize=" << info.norm_size();
618  return str.str();
619 }

References arm_compute::test::validation::info, and caffe_mnist_image_extractor::str.

◆ to_string() [11/101]

std::string arm_compute::to_string ( const arm_compute::ScatterFunction func)
inline

Formatted output of the arm_compute::ScatterFunction type.

Parameters
[in]funcarm_compute::ScatterFunction type to output.
Returns
Formatted string.

Definition at line 3659 of file TypePrinter.h.

3660 {
3661  std::stringstream str;
3662  str << func;
3663  return str.str();
3664 }

References caffe_mnist_image_extractor::str.

◆ to_string() [12/101]

std::string arm_compute::to_string ( const arm_compute::ScatterInfo info)
inline

Formatted output of the arm_compute::ScatterInfo type.

Parameters
[in]infoarm_compute::ScatterInfo type to output.
Returns
Formatted string.

Definition at line 3686 of file TypePrinter.h.

3687 {
3688  std::stringstream str;
3689  str << info;
3690  return str.str();
3691 }

References arm_compute::test::validation::info, and caffe_mnist_image_extractor::str.

Referenced by to_string().

◆ to_string() [13/101]

std::string arm_compute::to_string ( const BorderMode mode)
inline

Formatted output of the BorderMode type.

Parameters
[in]modeType to output.
Returns
Formatted string.

Definition at line 1637 of file TypePrinter.h.

1638 {
1639  std::stringstream str;
1640  str << mode;
1641  return str.str();
1642 }

References clang_tidy_rules::mode, and caffe_mnist_image_extractor::str.

◆ to_string() [14/101]

std::string arm_compute::to_string ( const BorderSize border)
inline

Formatted output of the BorderSize type.

Parameters
[in]borderType to output.
Returns
Formatted string.

Definition at line 1650 of file TypePrinter.h.

1651 {
1652  std::stringstream str;
1653  str << border;
1654  return str.str();
1655 }

References caffe_mnist_image_extractor::str.

◆ to_string() [15/101]

std::string arm_compute::to_string ( const BoundingBoxTransformInfo bbox_info)
inline

Formatted output of the BoundingBoxTransformInfo type.

Parameters
[in]bbox_infoType to output.
Returns
Formatted string.

Definition at line 367 of file TypePrinter.h.

368 {
369  std::stringstream str;
370  str << bbox_info;
371  return str.str();
372 }

References caffe_mnist_image_extractor::str.

◆ to_string() [16/101]

std::string arm_compute::to_string ( const BoxNMSLimitInfo info)
inline

Converts a BoxNMSLimitInfo to string.

Parameters
[in]infoBoxNMSLimitInfo value to be converted
Returns
String representing the corresponding BoxNMSLimitInfo

Definition at line 3123 of file TypePrinter.h.

3124 {
3125  std::stringstream str;
3126  str << info;
3127  return str.str();
3128 }

References arm_compute::test::validation::info, and caffe_mnist_image_extractor::str.

◆ to_string() [17/101]

std::string arm_compute::to_string ( const Channel channel)
inline

Formatted output of the Channel type.

Parameters
[in]channelType to output.
Returns
Formatted string.

Definition at line 1001 of file TypePrinter.h.

1002 {
1003  std::stringstream str;
1004  str << channel;
1005  return str.str();
1006 }

References caffe_mnist_image_extractor::str.

◆ to_string() [18/101]

std::string arm_compute::to_string ( const ClComponentElementwiseBinary::Attributes::ElementwiseOp op)
inline

Formatted output of the arm_compute::experimental::dynamic_fusion::ClComponentElementwiseBinary::Attributes::ElementwiseOp type.

Parameters
[in]oparm_compute::experimental::dynamic_fusion::ClComponentElementwiseBinary::Attributes::ElementwiseOp type to output.
Returns
Formatted string.

Definition at line 68 of file ElementwiseBinary.h.

69 {
70  std::stringstream str;
71  str << op;
72  return str.str();
73 }

References caffe_mnist_image_extractor::str.

Referenced by ClSoftmaxKernel::configure(), arm_compute::graph::backends::detail::create_batch_normalization_layer(), arm_compute::graph::backends::detail::create_convolution_layer(), arm_compute::graph::backends::detail::create_depthwise_convolution_layer(), arm_compute::graph::backends::detail::create_fused_convolution_batch_normalization_layer(), arm_compute::graph::backends::detail::create_fused_depthwise_convolution_batch_normalization_layer(), InitializerListDataset< T >::iterator::description(), GpuCkwElementwiseBinary::get_name(), handle_cl_error(), arm_compute::test::framework::make_printable(), operator<<(), arm_compute::cl_gemm::auto_heuristics::select_mlgo_gemm_config_native(), arm_compute::cl_gemm::auto_heuristics::select_mlgo_gemm_config_reshaped(), arm_compute::cl_gemm::auto_heuristics::select_mlgo_gemm_config_reshaped_only_rhs(), arm_compute::cl_gemm::auto_heuristics::select_mlgo_gemm_kernel(), to_string(), to_string_if_not_null(), CpuGemm::validate(), DotGraphVisitor::visit(), and CLMutableCommandBuffer::~CLMutableCommandBuffer().

◆ to_string() [19/101]

std::string arm_compute::to_string ( const CLTunerMode  val)
inline

Convert a CLTunerMode value to a string.

Parameters
valCLTunerMode value to be converted
Returns
String representing the corresponding CLTunerMode.

Definition at line 2519 of file TypePrinter.h.

2520 {
2521  switch (val)
2522  {
2523  case CLTunerMode::EXHAUSTIVE:
2524  {
2525  return std::string("Exhaustive");
2526  }
2527  case CLTunerMode::NORMAL:
2528  {
2529  return std::string("Normal");
2530  }
2531  case CLTunerMode::RAPID:
2532  {
2533  return std::string("Rapid");
2534  }
2535  default:
2536  {
2537  ARM_COMPUTE_ERROR("Invalid tuner mode.");
2538  return std::string("UNDEFINED");
2539  }
2540  }
2541 }

References ARM_COMPUTE_ERROR, EXHAUSTIVE, NORMAL, and RAPID.

◆ to_string() [20/101]

std::string arm_compute::to_string ( const ComparisonOperation op)
inline

Formatted output of the Comparison Operations.

Parameters
[in]opType to output.
Returns
Formatted string.

Definition at line 1934 of file TypePrinter.h.

1935 {
1936  std::stringstream str;
1937  str << op;
1938  return str.str();
1939 }

References caffe_mnist_image_extractor::str.

◆ to_string() [21/101]

std::string arm_compute::to_string ( const ComputeAnchorsInfo anchors_info)
inline

Formatted output of the ComputeAnchorsInfo type.

Parameters
[in]anchors_infoType to output.
Returns
Formatted string.

Definition at line 393 of file TypePrinter.h.

394 {
395  std::stringstream str;
396  str << anchors_info;
397  return str.str();
398 }

References caffe_mnist_image_extractor::str.

◆ to_string() [22/101]

std::string arm_compute::to_string ( const Conv2dInfo conv_info)
inline

Converts a Conv2dInfo to string.

Parameters
[in]conv_infoConv2dInfo value to be converted
Returns
String representing the corresponding Conv2dInfo

Definition at line 2746 of file TypePrinter.h.

2747 {
2748  std::stringstream str;
2749  str << conv_info;
2750  return str.str();
2751 }

References arm_compute::test::validation::conv_info, and caffe_mnist_image_extractor::str.

◆ to_string() [23/101]

std::string arm_compute::to_string ( const Conv3dInfo conv3d_info)
inline

Formatted output of the Conv3dInfo type.

Parameters
[in]conv3d_infoType to output.
Returns
Formatted string.

Definition at line 3173 of file TypePrinter.h.

3174 {
3175  std::stringstream str;
3176  str << conv3d_info;
3177  return str.str();
3178 }

References caffe_mnist_image_extractor::str.

◆ to_string() [24/101]

std::string arm_compute::to_string ( const ConvertPolicy policy)
inline

Definition at line 1733 of file TypePrinter.h.

1734 {
1735  std::stringstream str;
1736  str << policy;
1737  return str.str();
1738 }

References caffe_mnist_image_extractor::str.

◆ to_string() [25/101]

std::string arm_compute::to_string ( const ConvolutionInfo info)
inline

Converts a ConvolutionInfo to string.

Parameters
[in]infoConvolutionInfo value to be converted
Returns
String representing the corresponding ConvolutionInfo

Definition at line 2606 of file TypePrinter.h.

2607 {
2608  std::stringstream str;
2609  str << info;
2610  return str.str();
2611 }

References arm_compute::test::validation::info, and caffe_mnist_image_extractor::str.

◆ to_string() [26/101]

std::string arm_compute::to_string ( const ConvolutionMethod conv_method)
inline

Formatted output of the ConvolutionMethod type.

Parameters
[in]conv_methodType to output
Returns
Formatted string.

Definition at line 2201 of file TypePrinter.h.

2202 {
2203  std::stringstream str;
2204  str << conv_method;
2205  return str.str();
2206 }

References caffe_mnist_image_extractor::str.

◆ to_string() [27/101]

std::string arm_compute::to_string ( const Coordinates coord)
inline

Formatted output of the Coordinates type.

Parameters
[in]coordType to output.
Returns
Formatted string.

Definition at line 1379 of file TypePrinter.h.

1380 {
1381  std::stringstream str;
1382  str << coord;
1383  return str.str();
1384 }

References caffe_mnist_image_extractor::str.

◆ to_string() [28/101]

std::string arm_compute::to_string ( const Coordinates2D coord_2d)
inline

Converts a Coordinates2D to string.

Parameters
[in]coord_2dCoordinates2D value to be converted
Returns
String representing the corresponding Coordinates2D

Definition at line 2922 of file TypePrinter.h.

2923 {
2924  std::stringstream str;
2925  str << coord_2d;
2926  return str.str();
2927 }

References caffe_mnist_image_extractor::str.

◆ to_string() [29/101]

std::string arm_compute::to_string ( const DetectionOutputLayerCodeType detection_code)
inline

Formatted output of the DetectionOutputLayerCodeType type.

Parameters
[in]detection_codeType to output
Returns
Formatted string.

Definition at line 2386 of file TypePrinter.h.

2387 {
2388  std::stringstream str;
2389  str << detection_code;
2390  return str.str();
2391 }

References caffe_mnist_image_extractor::str.

◆ to_string() [30/101]

std::string arm_compute::to_string ( const DetectionOutputLayerInfo detection_info)
inline

Formatted output of the DetectionOutputLayerInfo type.

Parameters
[in]detection_infoType to output
Returns
Formatted string.

Definition at line 2423 of file TypePrinter.h.

2424 {
2425  std::stringstream str;
2426  str << detection_info;
2427  return str.str();
2428 }

References caffe_mnist_image_extractor::str.

◆ to_string() [31/101]

std::string arm_compute::to_string ( const DetectionPostProcessLayerInfo detection_info)
inline

Formatted output of the DetectionPostProcessLayerInfo type.

Parameters
[in]detection_infoType to output
Returns
Formatted string.

Definition at line 2459 of file TypePrinter.h.

2460 {
2461  std::stringstream str;
2462  str << detection_info;
2463  return str.str();
2464 }

References caffe_mnist_image_extractor::str.

◆ to_string() [32/101]

std::string arm_compute::to_string ( const DetectionWindow detection_window)
inline

Formatted output of the DetectionWindow type.

Parameters
[in]detection_windowType to output
Returns
Formatted string.

Definition at line 2472 of file TypePrinter.h.

2473 {
2474  std::stringstream str;
2475  str << detection_window;
2476  return str.str();
2477 }

References caffe_mnist_image_extractor::str.

◆ to_string() [33/101]

std::string arm_compute::to_string ( const DimensionRoundingType rounding_type)
inline

Converts a DimensionRoundingType to string.

Parameters
[in]rounding_typeDimensionRoundingType value to be converted
Returns
String representing the corresponding DimensionRoundingType

Definition at line 3136 of file TypePrinter.h.

3137 {
3138  std::stringstream str;
3139  str << rounding_type;
3140  return str.str();
3141 }

References caffe_mnist_image_extractor::str.

◆ to_string() [34/101]

std::string arm_compute::to_string ( const Dimensions< T > &  dimensions)
inline

Formatted output of the Dimensions type.

Parameters
[in]dimensionsType to output.
Returns
Formatted string.

Definition at line 1340 of file TypePrinter.h.

1341 {
1342  std::stringstream str;
1343  str << dimensions;
1344  return str.str();
1345 }

References caffe_mnist_image_extractor::str.

◆ to_string() [35/101]

std::string arm_compute::to_string ( const ElementWiseUnary op)
inline

Formatted output of the Elementwise unary Operations.

Parameters
[in]opType to output.
Returns
Formatted string.

Definition at line 1947 of file TypePrinter.h.

1948 {
1949  std::stringstream str;
1950  str << op;
1951  return str.str();
1952 }

References caffe_mnist_image_extractor::str.

◆ to_string() [36/101]

std::string arm_compute::to_string ( const experimental::dynamic_fusion::CastAttributes cast_attr)
inline

Formatted output of the arm_compute::experimental::dynamic_fusion::CastAttributes type.

Parameters
[in]cast_attrarm_compute::experimental::dynamic_fusion::CastAttributes type to output.
Returns
Formatted string.

Definition at line 3404 of file TypePrinter.h.

3405 {
3406  std::stringstream str;
3407  str << cast_attr;
3408  return str.str();
3409 }

References caffe_mnist_image_extractor::str.

◆ to_string() [37/101]

std::string arm_compute::to_string ( const experimental::dynamic_fusion::ClampAttributes clamp_attr)
inline

Formatted output of the arm_compute::experimental::dynamic_fusion::ClampAttributes type.

Parameters
[in]clamp_attrarm_compute::experimental::dynamic_fusion::ClampAttributes type to output.
Returns
Formatted string.

Definition at line 3465 of file TypePrinter.h.

3466 {
3467  std::stringstream str;
3468  str << clamp_attr;
3469  return str.str();
3470 }

References caffe_mnist_image_extractor::str.

◆ to_string() [38/101]

std::string arm_compute::to_string ( const experimental::dynamic_fusion::Conv2dAttributes conv2d_attr)
inline

Formatted output of the arm_compute::experimental::dynamic_fusion::Conv2dAttributes type.

Parameters
[in]conv2d_attrarm_compute::experimental::dynamic_fusion::Conv2dAttributes type to output.
Returns
Formatted string.

Definition at line 3375 of file TypePrinter.h.

3376 {
3377  std::stringstream str;
3378  str << conv2d_attr;
3379  return str.str();
3380 }

References caffe_mnist_image_extractor::str.

◆ to_string() [39/101]

std::string arm_compute::to_string ( const experimental::dynamic_fusion::DepthwiseConv2dAttributes dw_conv2d_attr)
inline

Formatted output of the arm_compute::experimental::dynamic_fusion::DepthwiseConv2dAttributes type.

Parameters
[in]dw_conv2d_attrarm_compute::experimental::dynamic_fusion::DepthwiseConv2dAttributes type to output.
Returns
Formatted string.

Definition at line 3437 of file TypePrinter.h.

3438 {
3439  std::stringstream str;
3440  str << dw_conv2d_attr;
3441  return str.str();
3442 }

References caffe_mnist_image_extractor::str.

◆ to_string() [40/101]

std::string arm_compute::to_string ( const experimental::dynamic_fusion::GpuPool2dSettings settings)
inline

Formatted output of the arm_compute::experimental::dynamic_fusion::GpuPool2dSettings type.

Parameters
[in]settingsarm_compute::experimental::dynamic_fusion::GpuPool2dSettings type to output.
Returns
Formatted string.

Definition at line 3344 of file TypePrinter.h.

3345 {
3346  std::stringstream str;
3347  str << settings;
3348  return str.str();
3349 }

References caffe_mnist_image_extractor::str.

◆ to_string() [41/101]

std::string arm_compute::to_string ( const experimental::dynamic_fusion::Pool2dAttributes pool2d_attr)
inline

Formatted output of the arm_compute::experimental::dynamic_fusion::Pool2dAttributes type.

Parameters
[in]pool2d_attrarm_compute::experimental::dynamic_fusion::Pool2dAttributes type to output.
Returns
Formatted string.

Definition at line 3318 of file TypePrinter.h.

3319 {
3320  std::stringstream str;
3321  str << pool2d_attr;
3322  return str.str();
3323 }

References caffe_mnist_image_extractor::str.

◆ to_string() [42/101]

std::string arm_compute::to_string ( const experimental::dynamic_fusion::ResizeAttributes resize_attr)
inline

Formatted output of the arm_compute::experimental::dynamic_fusion::ResizeAttributes type.

Parameters
[in]resize_attrarm_compute::experimental::dynamic_fusion::ResizeAttributes type to output.
Returns
Formatted string.

Definition at line 3497 of file TypePrinter.h.

3498 {
3499  std::stringstream str;
3500  str << resize_attr;
3501  return str.str();
3502 }

References caffe_mnist_image_extractor::str.

◆ to_string() [43/101]

std::string arm_compute::to_string ( const experimental::dynamic_fusion::SoftmaxAttributes softmax_attr)
inline

Formatted output of the arm_compute::experimental::dynamic_fusion::SoftmaxAttributes type.

Parameters
[in]softmax_attrarm_compute::experimental::dynamic_fusion::SoftmaxAttributes type to output.
Returns
Formatted string.

Definition at line 3527 of file TypePrinter.h.

3528 {
3529  std::stringstream str;
3530  str << softmax_attr;
3531  return str.str();
3532 }

References caffe_mnist_image_extractor::str.

◆ to_string() [44/101]

std::string arm_compute::to_string ( const FFT1DInfo fft1d_info)
inline

Converts a FFT1DInfo to string.

Parameters
[in]fft1d_infoFFT1DInfo value to be converted
Returns
String representing the corresponding FFT1DInfo

Definition at line 2867 of file TypePrinter.h.

2868 {
2869  std::stringstream str;
2870  str << fft1d_info;
2871  return str.str();
2872 }

References caffe_mnist_image_extractor::str.

◆ to_string() [45/101]

std::string arm_compute::to_string ( const FFT2DInfo fft2d_info)
inline

Converts a FFT2DInfo to string.

Parameters
[in]fft2d_infoFFT2DInfo value to be converted
Returns
String representing the corresponding FFT2DInfo

Definition at line 2895 of file TypePrinter.h.

2896 {
2897  std::stringstream str;
2898  str << fft2d_info;
2899  return str.str();
2900 }

References caffe_mnist_image_extractor::str.

◆ to_string() [46/101]

std::string arm_compute::to_string ( const FFTDirection fft_dir)
inline

Converts a FFT1DInfo to string.

Parameters
[in]fft_dirFFT1DInfo value to be converted
Returns
String representing the corresponding FFT1DInfo

Definition at line 2840 of file TypePrinter.h.

2841 {
2842  std::stringstream str;
2843  str << "{" << fft_dir << "}";
2844  return str.str();
2845 }

References caffe_mnist_image_extractor::str.

◆ to_string() [47/101]

std::string arm_compute::to_string ( const Format format)
inline

Formatted output of the Format type.

Parameters
[in]formatType to output.
Returns
Formatted string.

Definition at line 934 of file TypePrinter.h.

935 {
936  std::stringstream str;
937  str << format;
938  return str.str();
939 }

References update_supported_ops::format, and caffe_mnist_image_extractor::str.

◆ to_string() [48/101]

std::string arm_compute::to_string ( const FullyConnectedLayerInfo info)
inline

Converts a FullyConnectedLayerInfo to string.

Parameters
[in]infoFullyConnectedLayerInfo value to be converted
Returns
String representing the corresponding FullyConnectedLayerInfo

Definition at line 2637 of file TypePrinter.h.

2638 {
2639  std::stringstream str;
2640  str << info;
2641  return str.str();
2642 }

References arm_compute::test::validation::info, and caffe_mnist_image_extractor::str.

◆ to_string() [49/101]

std::string arm_compute::to_string ( const FuseBatchNormalizationType fuse_type)
inline

Converts a FuseBatchNormalizationType to string.

Parameters
[in]fuse_typeFuseBatchNormalizationType value to be converted
Returns
String representing the corresponding FuseBatchNormalizationType

Definition at line 2958 of file TypePrinter.h.

2959 {
2960  std::stringstream str;
2961  str << fuse_type;
2962  return str.str();
2963 }

References caffe_mnist_image_extractor::str.

◆ to_string() [50/101]

std::string arm_compute::to_string ( const GEMMInfo info)
inline

Formatted output of the GEMMInfo type.

Parameters
[in]infoType to output.
Returns
Formatted string.

Definition at line 1496 of file TypePrinter.h.

1497 {
1498  std::stringstream str;
1499  str << info;
1500  return str.str();
1501 }

References arm_compute::test::validation::info, and caffe_mnist_image_extractor::str.

◆ to_string() [51/101]

std::string arm_compute::to_string ( const GEMMKernelInfo gemm_info)
inline

Formatted output of the GEMMKernelInfo type.

Parameters
[in]gemm_infoGEMMKernelInfo Type to output.
Returns
Formatted string.

Definition at line 332 of file TypePrinter.h.

333 {
334  std::stringstream str;
335  str << gemm_info;
336  return str.str();
337 }

References caffe_mnist_image_extractor::str.

◆ to_string() [52/101]

std::string arm_compute::to_string ( const GEMMLHSMatrixInfo gemm_info)
inline

Formatted output of the GEMMLHSMatrixInfo type.

Parameters
[in]gemm_infoGEMMLHSMatrixInfo to output.
Returns
Formatted string.

Definition at line 319 of file TypePrinter.h.

320 {
321  std::stringstream str;
322  str << gemm_info;
323  return str.str();
324 }

References caffe_mnist_image_extractor::str.

◆ to_string() [53/101]

std::string arm_compute::to_string ( const GEMMLowpOutputStageInfo gemm_info)
inline

Converts a GEMMLowpOutputStageInfo to string.

Parameters
[in]gemm_infoGEMMLowpOutputStageInfo value to be converted
Returns
String representing the corresponding GEMMLowpOutputStageInfo

Definition at line 2715 of file TypePrinter.h.

2716 {
2717  std::stringstream str;
2718  str << gemm_info;
2719  return str.str();
2720 }

References caffe_mnist_image_extractor::str.

◆ to_string() [54/101]

std::string arm_compute::to_string ( const GEMMLowpOutputStageType gemm_type)
inline

Converts a GEMMLowpOutputStageType to string.

Parameters
[in]gemm_typeGEMMLowpOutputStageType value to be converted
Returns
String representing the corresponding GEMMLowpOutputStageType

Definition at line 2679 of file TypePrinter.h.

2680 {
2681  std::stringstream str;
2682  str << gemm_type;
2683  return str.str();
2684 }

References arm_compute::mlgo::parser::gemm_type(), and caffe_mnist_image_extractor::str.

◆ to_string() [55/101]

std::string arm_compute::to_string ( const GEMMReshapeInfo info)
inline

Formatted output of the GEMMReshapeInfo type.

Parameters
[in]infoType to output.
Returns
Formatted string.

Definition at line 1483 of file TypePrinter.h.

1484 {
1485  std::stringstream str;
1486  str << info;
1487  return str.str();
1488 }

References arm_compute::test::validation::info, and caffe_mnist_image_extractor::str.

◆ to_string() [56/101]

std::string arm_compute::to_string ( const GEMMRHSMatrixInfo gemm_info)
inline

Formatted output of the GEMMRHSMatrixInfo type.

Parameters
[in]gemm_infoGEMMRHSMatrixInfo to output.
Returns
Formatted string.

Definition at line 306 of file TypePrinter.h.

307 {
308  std::stringstream str;
309  str << gemm_info;
310  return str.str();
311 }

References caffe_mnist_image_extractor::str.

◆ to_string() [57/101]

std::string arm_compute::to_string ( const GenerateProposalsInfo proposals_info)
inline

Formatted output of the GenerateProposalsInfo type.

Parameters
[in]proposals_infoType to output.
Returns
Formatted string.

Definition at line 419 of file TypePrinter.h.

420 {
421  std::stringstream str;
422  str << proposals_info;
423  return str.str();
424 }

References caffe_mnist_image_extractor::str.

◆ to_string() [58/101]

std::string arm_compute::to_string ( const GPUTarget gpu_target)
inline

Formatted output of the GPUTarget type.

Parameters
[in]gpu_targetType to output
Returns
Formatted string.

Definition at line 2325 of file TypePrinter.h.

2326 {
2327  std::stringstream str;
2328  str << gpu_target;
2329  return str.str();
2330 }

References caffe_mnist_image_extractor::str.

◆ to_string() [59/101]

std::string arm_compute::to_string ( const InterpolationPolicy policy)
inline

Formatted output of the InterpolationPolicy type.

Parameters
[in]policyType to output.
Returns
Formatted string.

Definition at line 1689 of file TypePrinter.h.

1690 {
1691  std::stringstream str;
1692  str << policy;
1693  return str.str();
1694 }

References caffe_mnist_image_extractor::str.

◆ to_string() [60/101]

std::string arm_compute::to_string ( const ITensor tensor)
inline

Formatted output of the ITensorInfo type obtained from const ITensor* type.

Parameters
[in]tensorType to output.
Returns
Formatted string.

Definition at line 1240 of file TypePrinter.h.

1241 {
1242  std::string ret_str = "nullptr";
1243  if (tensor != nullptr)
1244  {
1245  std::stringstream str;
1246  str << "ITensor->info(): " << tensor->info();
1247  ret_str = str.str();
1248  }
1249  return ret_str;
1250 }

References CLTensor::info(), caffe_mnist_image_extractor::str, and tensor.

◆ to_string() [61/101]

std::string arm_compute::to_string ( const ITensorInfo info)
inline

Formatted output of the const ITensorInfo& type.

Parameters
[in]infoType to output.
Returns
Formatted string.

Definition at line 1198 of file TypePrinter.h.

1199 {
1200  std::stringstream str;
1201  str << &info;
1202  return str.str();
1203 }

References arm_compute::test::validation::info, and caffe_mnist_image_extractor::str.

◆ to_string() [62/101]

std::string arm_compute::to_string ( const ITensorInfo info)
inline

Formatted output of the const ITensorInfo* type.

Parameters
[in]infoType to output.
Returns
Formatted string.

Definition at line 1211 of file TypePrinter.h.

1212 {
1213  std::string ret_str = "nullptr";
1214  if (info != nullptr)
1215  {
1216  std::stringstream str;
1217  str << info;
1218  ret_str = str.str();
1219  }
1220  return ret_str;
1221 }

References arm_compute::test::validation::info, and caffe_mnist_image_extractor::str.

◆ to_string() [63/101]

std::string arm_compute::to_string ( const LSTMParams< T > &  lstm_params)

Converts a LSTMParams to string.

Parameters
[in]lstm_paramsLSTMParams<T> value to be converted
Returns
String representing the corresponding LSTMParams

Definition at line 3037 of file TypePrinter.h.

3038 {
3039  std::stringstream str;
3040  str << lstm_params;
3041  return str.str();
3042 }

References caffe_mnist_image_extractor::str.

◆ to_string() [64/101]

std::string arm_compute::to_string ( const Multiples multiples)
inline

Formatted output of the Multiples type.

Parameters
[in]multiplesType to output.
Returns
Formatted string.

Definition at line 1676 of file TypePrinter.h.

1677 {
1678  std::stringstream str;
1679  str << multiples;
1680  return str.str();
1681 }

References caffe_mnist_image_extractor::str.

◆ to_string() [65/101]

std::string arm_compute::to_string ( const NMSType  nms_type)
inline

Converts a NMSType to string.

Parameters
[in]nms_typeNMSType value to be converted
Returns
String representing the corresponding NMSType

Definition at line 3089 of file TypePrinter.h.

3090 {
3091  std::stringstream str;
3092  str << nms_type;
3093  return str.str();
3094 }

References caffe_mnist_image_extractor::str.

◆ to_string() [66/101]

std::string arm_compute::to_string ( const NormType type)
inline

Formatted output of the Norm Type.

Parameters
[in]typeType to output.
Returns
Formatted string.

Definition at line 1960 of file TypePrinter.h.

1961 {
1962  std::stringstream str;
1963  str << type;
1964  return str.str();
1965 }

References caffe_mnist_image_extractor::str, and type.

◆ to_string() [67/101]

std::string arm_compute::to_string ( const Padding2D padding2d)
inline

Converts a Padding2D to string.

Parameters
[in]padding2dPadding2D value to be converted
Returns
String representing the corresponding Padding2D

Definition at line 3285 of file TypePrinter.h.

3286 {
3287  std::stringstream str;
3288  str << padding2d;
3289  return str.str();
3290 }

References caffe_mnist_image_extractor::str.

◆ to_string() [68/101]

std::string arm_compute::to_string ( const Padding3D padding3d)
inline

Converts a Padding3D to string.

Parameters
[in]padding3dPadding3D value to be converted
Returns
String representing the corresponding Padding3D

Definition at line 2049 of file TypePrinter.h.

2050 {
2051  std::stringstream str;
2052  str << padding3d;
2053  return str.str();
2054 }

References caffe_mnist_image_extractor::str.

◆ to_string() [69/101]

std::string arm_compute::to_string ( const PaddingList padding)
inline

Formatted output of the PaddingList type.

Parameters
[in]paddingType to output.
Returns
Formatted string.

Definition at line 1663 of file TypePrinter.h.

1664 {
1665  std::stringstream str;
1666  str << padding;
1667  return str.str();
1668 }

References caffe_mnist_image_extractor::str.

◆ to_string() [70/101]

std::string arm_compute::to_string ( const PaddingMode mode)
inline

Formatted output of the PaddingMode type.

Parameters
[in]modeType to output.
Returns
Formatted string.

Definition at line 1594 of file TypePrinter.h.

1595 {
1596  std::stringstream str;
1597  str << mode;
1598  return str.str();
1599 }

References clang_tidy_rules::mode, and caffe_mnist_image_extractor::str.

◆ to_string() [71/101]

std::string arm_compute::to_string ( const PadStrideInfo pad_stride_info)
inline

Formatted output of the PadStrideInfo type.

Parameters
[in]pad_stride_infoType to output.
Returns
Formatted string.

Definition at line 1624 of file TypePrinter.h.

1625 {
1626  std::stringstream str;
1627  str << pad_stride_info;
1628  return str.str();
1629 }

References caffe_mnist_image_extractor::str.

◆ to_string() [72/101]

std::string arm_compute::to_string ( const PixelValue pixel_value)
inline

Converts a PixelValue to string.

Parameters
[in]pixel_valuePixelValue value to be converted
Returns
String representing the corresponding PixelValue

Definition at line 2772 of file TypePrinter.h.

2773 {
2774  std::stringstream str;
2775  str << pixel_value;
2776  return str.str();
2777 }

References caffe_mnist_image_extractor::str.

◆ to_string() [73/101]

std::string arm_compute::to_string ( const Pooling3dLayerInfo info)
inline

Formatted output of the Pooling 3d Layer Info.

Parameters
[in]infoType to output.
Returns
Formatted string.

Definition at line 2110 of file TypePrinter.h.

2111 {
2112  std::stringstream str;
2113  str << info;
2114  return str.str();
2115 }

References arm_compute::test::validation::info, and caffe_mnist_image_extractor::str.

◆ to_string() [74/101]

std::string arm_compute::to_string ( const PoolingLayerInfo info)
inline

Formatted output of the Pooling Layer Info.

Parameters
[in]infoType to output.
Returns
Formatted string.

Definition at line 1986 of file TypePrinter.h.

1987 {
1988  std::stringstream str;
1989  str << "{Type=" << info.pool_type << ","
1990  << "DataLayout=" << info.data_layout << ","
1991  << "IsGlobalPooling=" << info.is_global_pooling;
1992  if (!info.is_global_pooling)
1993  {
1994  str << ","
1995  << "PoolSize=" << info.pool_size.width << "," << info.pool_size.height << ","
1996  << "PadStride=" << info.pad_stride_info;
1997  }
1998  str << "}";
1999  return str.str();
2000 }

References ScaleKernelInfo::data_layout, arm_compute::test::validation::info, and caffe_mnist_image_extractor::str.

◆ to_string() [75/101]

std::string arm_compute::to_string ( const PoolingType type)
inline

Formatted output of the Pooling Type.

Parameters
[in]typeType to output.
Returns
Formatted string.

Definition at line 1973 of file TypePrinter.h.

1974 {
1975  std::stringstream str;
1976  str << type;
1977  return str.str();
1978 }

References caffe_mnist_image_extractor::str, and type.

◆ to_string() [76/101]

std::string arm_compute::to_string ( const PriorBoxLayerInfo info)
inline

Formatted output of the PriorBoxLayerInfo.

Parameters
[in]infoType to output.
Returns
Formatted string.

Definition at line 2123 of file TypePrinter.h.

2124 {
2125  std::stringstream str;
2126  str << "{";
2127  str << "Clip:" << info.clip() << "Flip:" << info.flip() << "StepX:" << info.steps()[0]
2128  << "StepY:" << info.steps()[1] << "MinSizes:" << info.min_sizes().size()
2129  << "MaxSizes:" << info.max_sizes().size() << "ImgSizeX:" << info.img_size().x
2130  << "ImgSizeY:" << info.img_size().y << "Offset:" << info.offset() << "Variances:" << info.variances().size();
2131  str << "}";
2132  return str.str();
2133 }

References arm_compute::test::validation::info, and caffe_mnist_image_extractor::str.

◆ to_string() [77/101]

std::string arm_compute::to_string ( const QuantizationInfo quantization_info)
inline

Formatted output of the QuantizationInfo type.

Parameters
[in]quantization_infoType to output.
Returns
Formatted string.

Definition at line 447 of file TypePrinter.h.

448 {
449  std::stringstream str;
450  str << quantization_info;
451  return str.str();
452 }

References caffe_mnist_image_extractor::str.

◆ to_string() [78/101]

std::string arm_compute::to_string ( const ReductionOperation op)
inline

Formatted output of the Reduction Operations.

Parameters
[in]opType to output.
Returns
Formatted string.

Definition at line 1843 of file TypePrinter.h.

1844 {
1845  std::stringstream str;
1846  str << op;
1847  return str.str();
1848 }

References caffe_mnist_image_extractor::str.

◆ to_string() [79/101]

std::string arm_compute::to_string ( const ROIPoolingLayerInfo pool_info)
inline

Formatted output of the ROIPoolingInfo type.

Parameters
[in]pool_infoType to output.
Returns
Formatted string.

Definition at line 240 of file TypePrinter.h.

241 {
242  std::stringstream str;
243  str << pool_info;
244  return str.str();
245 }

References caffe_mnist_image_extractor::str.

◆ to_string() [80/101]

std::string arm_compute::to_string ( const RoundingPolicy rounding_policy)
inline

Formatted output of RoundingPolicy.

Parameters
[in]rounding_policyType to output.
Returns
Formatted string.

Definition at line 681 of file TypePrinter.h.

682 {
683  std::stringstream str;
684  str << rounding_policy;
685  return str.str();
686 }

References caffe_mnist_image_extractor::str.

◆ to_string() [81/101]

std::string arm_compute::to_string ( const SamplingPolicy policy)
inline

Formatted output of the SamplingPolicy type.

Parameters
[in]policyType to output.
Returns
Formatted string.

Definition at line 1702 of file TypePrinter.h.

1703 {
1704  std::stringstream str;
1705  str << policy;
1706  return str.str();
1707 }

References caffe_mnist_image_extractor::str.

◆ to_string() [82/101]

std::string arm_compute::to_string ( const ScaleKernelInfo scale_info)
inline

Converts a ScaleKernelInfo to string.

Parameters
[in]scale_infoScaleKernelInfo value to be converted
Returns
String representing the corresponding ScaleKernelInfo

Definition at line 2804 of file TypePrinter.h.

2805 {
2806  std::stringstream str;
2807  str << scale_info;
2808  return str.str();
2809 }

References caffe_mnist_image_extractor::str.

◆ to_string() [83/101]

std::string arm_compute::to_string ( const Size2D type)
inline

Formatted output of the Size2D type.

Parameters
[in]typeType to output
Returns
Formatted string.

Definition at line 2155 of file TypePrinter.h.

2156 {
2157  std::stringstream str;
2158  str << type;
2159  return str.str();
2160 }

References caffe_mnist_image_extractor::str, and type.

◆ to_string() [84/101]

std::string arm_compute::to_string ( const Size3D type)
inline

Formatted output of the Size3D type.

Parameters
[in]typeType to output
Returns
Formatted string.

Definition at line 2022 of file TypePrinter.h.

2023 {
2024  std::stringstream str;
2025  str << type;
2026  return str.str();
2027 }

References caffe_mnist_image_extractor::str, and type.

◆ to_string() [85/101]

std::string arm_compute::to_string ( const SoftmaxKernelInfo info)
inline

Converts a SoftmaxKernelInfo to string.

Parameters
[in]infoSoftmaxKernelInfo value to be converted
Returns
String representing the corresponding SoftmaxKernelInfo

Definition at line 2987 of file TypePrinter.h.

2988 {
2989  std::stringstream str;
2990  str << info;
2991  return str.str();
2992 }

References arm_compute::test::validation::info, and caffe_mnist_image_extractor::str.

◆ to_string() [86/101]

std::string arm_compute::to_string ( const std::tuple< TensorShape, TensorShape, arm_compute::WeightFormat values)
inline

Formatted output of the std::tuple<TensorShape, TensorShape, arm_compute::WeightFormat> tuple.

Parameters
[in]valuestuple of input and output tensor shapes and WeightFormat used.
Returns
Formatted string.

Definition at line 3254 of file TypePrinter.h.

3255 {
3256  std::stringstream str;
3257  str << "[Input shape = " << std::get<0>(values);
3258  str << ", ";
3259  str << "Expected output shape = " << std::get<1>(values);
3260 
3261  str << ", ";
3262  str << "WeightFormat = " << std::get<2>(values) << "]";
3263  return str.str();
3264 }

References caffe_mnist_image_extractor::str.

◆ to_string() [87/101]

std::string arm_compute::to_string ( const std::vector< T > &  args)

Formatted output of a vector of objects.

Parameters
[in]argsVector of objects to print
Returns
String representing args.

Definition at line 148 of file TypePrinter.h.

149 {
150  std::stringstream str;
151  str << args;
152  return str.str();
153 }

References GemmTuner::args, and caffe_mnist_image_extractor::str.

◆ to_string() [88/101]

std::string arm_compute::to_string ( const Strides stride)
inline

Formatted output of the Strides type.

Parameters
[in]strideType to output.
Returns
Formatted string.

Definition at line 1353 of file TypePrinter.h.

1354 {
1355  std::stringstream str;
1356  str << stride;
1357  return str.str();
1358 }

References caffe_mnist_image_extractor::str.

◆ to_string() [89/101]

std::string arm_compute::to_string ( const T &  val)
inline

Fallback method: try to use std::to_string:

Parameters
[in]valValue to convert to string
Returns
String representing val.

Definition at line 94 of file TypePrinter.h.

95 {
96  return support::cpp11::to_string(val);
97 }

References arm_compute::support::cpp11::to_string().

◆ to_string() [90/101]

std::string arm_compute::to_string ( const TensorInfo info)
inline

Formatted output of the const TensorInfo& type.

Parameters
[in]infoType to output.
Returns
Formatted string.

Definition at line 1185 of file TypePrinter.h.

1186 {
1187  std::stringstream str;
1188  str << &info;
1189  return str.str();
1190 }

References arm_compute::test::validation::info, and caffe_mnist_image_extractor::str.

◆ to_string() [91/101]

std::string arm_compute::to_string ( const TensorShape shape)
inline

Formatted output of the TensorShape type.

Parameters
[in]shapeType to output.
Returns
Formatted string.

Definition at line 1366 of file TypePrinter.h.

1367 {
1368  std::stringstream str;
1369  str << shape;
1370  return str.str();
1371 }

References arm_compute::test::validation::shape, and caffe_mnist_image_extractor::str.

◆ to_string() [92/101]

std::string arm_compute::to_string ( const uint8_t  num)
inline

Converts a LSTMParams to string.

Parameters
[in]numuint8_t value to be converted
Returns
String representing the corresponding uint8_t

Definition at line 3050 of file TypePrinter.h.

3051 {
3052  // Explicity cast the uint8_t to signed integer and call the corresponding overloaded to_string() function.
3053  return ::std::to_string(static_cast<int>(num));
3054 }

References to_string().

◆ to_string() [93/101]

std::string arm_compute::to_string ( const WeightFormat  wf)
inline

Formatted output of the arm_compute::WeightFormat type.

Parameters
[in]wfarm_compute::WeightFormat Type to output.
Returns
Formatted string.

Definition at line 3186 of file TypePrinter.h.

3187 {
3188 #define __CASE_WEIGHT_FORMAT(wf) \
3189  case WeightFormat::wf: \
3190  return #wf;
3191  switch (wf)
3192  {
3193  __CASE_WEIGHT_FORMAT(UNSPECIFIED)
3195  __CASE_WEIGHT_FORMAT(OHWI)
3196  __CASE_WEIGHT_FORMAT(OHWIo2)
3197  __CASE_WEIGHT_FORMAT(OHWIo4)
3198  __CASE_WEIGHT_FORMAT(OHWIo8)
3199  __CASE_WEIGHT_FORMAT(OHWIo16)
3200  __CASE_WEIGHT_FORMAT(OHWIo32)
3201  __CASE_WEIGHT_FORMAT(OHWIo64)
3202  __CASE_WEIGHT_FORMAT(OHWIo128)
3203  __CASE_WEIGHT_FORMAT(OHWIo4i2)
3204  __CASE_WEIGHT_FORMAT(OHWIo4i2_bf16)
3205  __CASE_WEIGHT_FORMAT(OHWIo8i2)
3206  __CASE_WEIGHT_FORMAT(OHWIo8i2_bf16)
3207  __CASE_WEIGHT_FORMAT(OHWIo16i2)
3208  __CASE_WEIGHT_FORMAT(OHWIo16i2_bf16)
3209  __CASE_WEIGHT_FORMAT(OHWIo32i2)
3210  __CASE_WEIGHT_FORMAT(OHWIo32i2_bf16)
3211  __CASE_WEIGHT_FORMAT(OHWIo64i2)
3212  __CASE_WEIGHT_FORMAT(OHWIo64i2_bf16)
3213  __CASE_WEIGHT_FORMAT(OHWIo4i4)
3214  __CASE_WEIGHT_FORMAT(OHWIo4i4_bf16)
3215  __CASE_WEIGHT_FORMAT(OHWIo8i4)
3216  __CASE_WEIGHT_FORMAT(OHWIo8i4_bf16)
3217  __CASE_WEIGHT_FORMAT(OHWIo16i4)
3218  __CASE_WEIGHT_FORMAT(OHWIo16i4_bf16)
3219  __CASE_WEIGHT_FORMAT(OHWIo32i4)
3220  __CASE_WEIGHT_FORMAT(OHWIo32i4_bf16)
3221  __CASE_WEIGHT_FORMAT(OHWIo64i4)
3222  __CASE_WEIGHT_FORMAT(OHWIo64i4_bf16)
3223  __CASE_WEIGHT_FORMAT(OHWIo2i8)
3224  __CASE_WEIGHT_FORMAT(OHWIo4i8)
3225  __CASE_WEIGHT_FORMAT(OHWIo8i8)
3226  __CASE_WEIGHT_FORMAT(OHWIo16i8)
3227  __CASE_WEIGHT_FORMAT(OHWIo32i8)
3228  __CASE_WEIGHT_FORMAT(OHWIo64i8)
3229  default:
3230  return "invalid value";
3231  }
3232 #undef __CASE_WEIGHT_FORMAT
3233 }

References __CASE_WEIGHT_FORMAT, ANY, OHWI, OHWIo128, OHWIo16, OHWIo16i2, OHWIo16i2_bf16, OHWIo16i4, OHWIo16i4_bf16, OHWIo16i8, OHWIo2, OHWIo2i8, OHWIo32, OHWIo32i2, OHWIo32i2_bf16, OHWIo32i4, OHWIo32i4_bf16, OHWIo32i8, OHWIo4, OHWIo4i2, OHWIo4i2_bf16, OHWIo4i4, OHWIo4i4_bf16, OHWIo4i8, OHWIo64, OHWIo64i2, OHWIo64i2_bf16, OHWIo64i4, OHWIo64i4_bf16, OHWIo64i8, OHWIo8, OHWIo8i2, OHWIo8i2_bf16, OHWIo8i4, OHWIo8i4_bf16, OHWIo8i8, and UNSPECIFIED.

◆ to_string() [94/101]

std::string arm_compute::to_string ( const WeightsInfo info)
inline

Formatted output of the WeightsInfo type.

Parameters
[in]infoType to output.
Returns
Formatted string.

Definition at line 1470 of file TypePrinter.h.

1471 {
1472  std::stringstream str;
1473  str << info;
1474  return str.str();
1475 }

References arm_compute::test::validation::info, and caffe_mnist_image_extractor::str.

◆ to_string() [95/101]

std::string arm_compute::to_string ( const Window win)
inline

Formatted output of the Window& type.

Parameters
[in]winType to output.
Returns
Formatted string.

Definition at line 1521 of file TypePrinter.h.

1522 {
1523  std::stringstream str;
1524  str << win;
1525  return str.str();
1526 }

References caffe_mnist_image_extractor::str.

◆ to_string() [96/101]

std::string arm_compute::to_string ( const Window::Dimension dim)
inline

Formatted output of the Window::Dimension type.

Parameters
[in]dimType to output.
Returns
Formatted string.

Definition at line 1509 of file TypePrinter.h.

1510 {
1511  std::stringstream str;
1512  str << dim;
1513  return str.str();
1514 }

References caffe_mnist_image_extractor::str.

◆ to_string() [97/101]

std::string arm_compute::to_string ( const WinogradInfo type)
inline

Definition at line 2506 of file TypePrinter.h.

2507 {
2508  std::stringstream str;
2509  str << type;
2510  return str.str();
2511 }

References caffe_mnist_image_extractor::str, and type.

◆ to_string() [98/101]

std::string arm_compute::to_string ( ITensor tensor)
inline

Formatted output of the ITensorInfo type obtained from the ITensor& type.

Parameters
[in]tensorType to output.
Returns
Formatted string.

Definition at line 1269 of file TypePrinter.h.

1270 {
1271  std::stringstream str;
1272  str << "ITensor.info(): " << tensor.info();
1273  return str.str();
1274 }

References CLTensor::info(), caffe_mnist_image_extractor::str, and tensor.

◆ to_string() [99/101]

std::string arm_compute::to_string ( ITensor tensor)
inline

Formatted output of the ITensorInfo type obtained from the ITensor* type.

Parameters
[in]tensorType to output.
Returns
Formatted string.

Definition at line 1258 of file TypePrinter.h.

1259 {
1260  return to_string(static_cast<const ITensor *>(tensor));
1261 }

References tensor, and to_string().

◆ to_string() [100/101]

std::string arm_compute::to_string ( ITensorInfo info)
inline

Formatted output of the ITensorInfo* type.

Parameters
[in]infoType to output.
Returns
Formatted string.

Definition at line 1229 of file TypePrinter.h.

1230 {
1231  return to_string(static_cast<const ITensorInfo *>(info));
1232 }

References arm_compute::test::validation::info, and to_string().

◆ to_string() [101/101]

std::string arm_compute::to_string ( Window win)
inline

Formatted output of the Window* type.

Parameters
[in]winType to output.
Returns
Formatted string.

Definition at line 1534 of file TypePrinter.h.

1535 {
1536  std::string ret_str = "nullptr";
1537  if (win != nullptr)
1538  {
1539  std::stringstream str;
1540  str << *win;
1541  ret_str = str.str();
1542  }
1543  return ret_str;
1544 }

References caffe_mnist_image_extractor::str.

◆ to_string_if_not_null()

std::string arm_compute::to_string_if_not_null ( T *  arg)

Formatted output if arg is not null.

Parameters
[in]argObject to print
Returns
String representing arg.

Definition at line 75 of file TypePrinter.h.

76 {
77  if (arg == nullptr)
78  {
79  return "nullptr";
80  }
81  else
82  {
83  return to_string(*arg);
84  }
85 }

References to_string().

◆ tuner_mode_from_name()

CLTunerMode arm_compute::tuner_mode_from_name ( const std::string &  name)
inline

Converts a string to a strong types enumeration CLTunerMode.

Parameters
[in]nameString to convert
Returns
Converted CLTunerMode enumeration

Definition at line 57 of file CLTunerTypes.h.

58 {
59  static const std::map<std::string, CLTunerMode> tuner_modes = {
60  {"exhaustive", CLTunerMode::EXHAUSTIVE},
61  {"normal", CLTunerMode::NORMAL},
62  {"rapid", CLTunerMode::RAPID},
63  };
64 
65 #ifndef ARM_COMPUTE_EXCEPTIONS_DISABLED
66  try
67  {
68 #endif /* ARM_COMPUTE_EXCEPTIONS_DISABLED */
69  return tuner_modes.at(arm_compute::utility::tolower(name));
70 
71 #ifndef ARM_COMPUTE_EXCEPTIONS_DISABLED
72  }
73  catch (const std::out_of_range &)
74  {
75  throw std::invalid_argument(name);
76  }
77 #endif /* ARM_COMPUTE_EXCEPTIONS_DISABLED */
78 }

References EXHAUSTIVE, name, NORMAL, RAPID, and arm_compute::utility::tolower().

Referenced by operator>>().

◆ update_window_and_padding()

bool arm_compute::update_window_and_padding ( Window win,
Ts &&...  patterns 
)

Update window and padding size for each of the access patterns.

First the window size is reduced based on all access patterns that are not allowed to modify the padding of the underlying tensor. Then the padding of the remaining tensors is increased to match the window.

Parameters
[in]winWindow that is used by the kernel.
[in]patternsAccess patterns used to calculate the final window and padding.
Returns
True if the window has been changed. Changes to the padding do not influence the returned value.

Definition at line 46 of file WindowHelpers.h.

47 {
48  bool window_changed = false;
49 
50  utility::for_each([&](const IAccessWindow &w) { window_changed |= w.update_window_if_needed(win); }, patterns...);
51 
52  utility::for_each([&](IAccessWindow &w) { w.update_padding_if_needed(win); }, patterns...);
53 
54  return window_changed;
55 }

References arm_compute::utility::for_each(), and arm_compute::test::validation::w.

Referenced by ICLSimpleKernel::configure(), NEBitwiseNotKernel::configure(), NEBitwiseOrKernel::configure(), NEBitwiseXorKernel::configure(), and NEBitwiseAndKernel::configure().

◆ upper_string()

std::string upper_string ( const std::string &  val)

Raise a given string to upper case.

Parameters
[in]valGiven string to lower.
Returns
The upper case string

Definition at line 45 of file StringUtils.cpp.

46 {
47  std::string res = val;
48  std::transform(res.begin(), res.end(), res.begin(), ::toupper);
49  return res;
50 }

Referenced by ClMatMulLowpNativeMMULKernel::configure(), ClWidthConcatenate2TensorsKernel::configure(), ClHeightConcatenateKernel::configure(), ClWidthConcatenateKernel::configure(), ClWidthConcatenate4TensorsKernel::configure(), ClMatMulNativeKernel::configure(), ClDepthConcatenateKernel::configure(), ClBatchConcatenateKernel::configure(), ClMatMulLowpNativeKernel::configure(), ClGemmLowpMatrixMultiplyNativeKernel::configure(), ClGemmMatrixMultiplyNativeKernel::configure(), ClGemmLowpQuantizeDownInt32ScaleByFixedPointKernel::configure(), ClGemmMatrixMultiplyReshapedOnlyRhsMMULKernel::configure(), ClIndirectConv2dAddressPrecalculationKernel::configure(), ClWinogradFilterTransformKernel::configure(), ClWinogradInputTransformKernel::configure(), ClIndirectConv2dKernel::configure(), ClGemmLowpQuantizeDownInt32ScaleByFloatKernel::configure(), ClGemmLowpQuantizeDownInt32ScaleKernel::configure(), ClWinogradOutputTransformKernel::configure(), ClGemmLowpMatrixMultiplyReshapedKernel::configure(), ClGemmLowpOffsetContributionOutputStageKernel::configure(), ClGemmLowpOffsetContributionKernel::configure(), ClGemmLowpMatrixMultiplyReshapedOnlyRhsKernel::configure(), ClMatMulNativeMMULKernel::configure(), ClGemmMatrixMultiplyReshapedOnlyRhsKernel::configure(), ClGemmLowpMatrixAReductionKernel::configure(), ClGemmMatrixMultiplyReshapedKernel::configure(), and ClGemmLowpMatrixBReductionKernel::configure().

◆ validate()

Status arm_compute::validate ( const ITensorInfo scores_in,
const ITensorInfo boxes_in,
const ITensorInfo batch_splits_in,
const ITensorInfo scores_out,
const ITensorInfo boxes_out,
const ITensorInfo classes,
const ITensorInfo batch_splits_out,
const ITensorInfo keeps,
const ITensorInfo keeps_size,
const BoxNMSLimitInfo  info 
)

Definition at line 243 of file CPPBoxWithNonMaximaSuppressionLimit.cpp.

253 {
254  ARM_COMPUTE_UNUSED(batch_splits_in, batch_splits_out, keeps, keeps_size, info);
255  ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(scores_in, boxes_in, scores_out, boxes_out, classes);
256  ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(scores_in, 1, DataType::QASYMM8, DataType::QASYMM8_SIGNED,
257  DataType::F16, DataType::F32);
258 
259  const bool is_qasymm8 =
260  scores_in->data_type() == DataType::QASYMM8 || scores_in->data_type() == DataType::QASYMM8_SIGNED;
261  if (is_qasymm8)
262  {
263  ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(boxes_in, 1, DataType::QASYMM16);
266  const UniformQuantizationInfo boxes_qinfo = boxes_in->quantization_info().uniform();
267  ARM_COMPUTE_RETURN_ERROR_ON(boxes_qinfo.scale != 0.125f);
268  ARM_COMPUTE_RETURN_ERROR_ON(boxes_qinfo.offset != 0);
269  }
270 
271  return Status{};
272 }

References ARM_COMPUTE_RETURN_ERROR_ON, ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN, ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES, ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_QUANTIZATION_INFO, ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR, ARM_COMPUTE_UNUSED, ITensorInfo::data_type(), F16, F32, arm_compute::test::validation::info, UniformQuantizationInfo::offset, QASYMM16, QASYMM8, QASYMM8_SIGNED, ITensorInfo::quantization_info(), UniformQuantizationInfo::scale, and QuantizationInfo::uniform().

Referenced by ClScatter::configure(), ClMatMul::configure(), CpuGemm::configure(), arm_compute::test::validation::FIXTURE_DATA_TEST_CASE(), CpuDepthwiseConv2d::get_depthwiseconvolution_function(), arm_compute::utils::run_example(), arm_compute::test::validation::TEST_CASE(), CPPSplit< CLSlice, ICLTensor >::validate(), CpuDepthwiseConv2d::validate(), ClDirectConv2d::validate(), CLSynthetizeOperator< ClGemmMatrixMultiplyReshapedOnlyRhsKernel >::validate(), NESynthetizeFunction< K >::validate(), ClIndirectConv2d::validate(), CLSynthetizeFunction< K >::validate(), NEQLSTMLayer::validate(), CLQLSTMLayer::validate(), arm_compute::graph::backends::detail::validate_arg_min_max_layer(), arm_compute::graph::backends::detail::validate_bounding_box_transform_layer(), arm_compute::graph::backends::detail::validate_channel_shuffle_layer(), arm_compute::graph::backends::detail::validate_convolution_layer(), arm_compute::graph::backends::detail::validate_depth_to_space_layer(), arm_compute::graph::backends::detail::validate_depthwise_convolution_layer(), arm_compute::graph::backends::detail::validate_dequantization_layer(), arm_compute::graph::backends::detail::validate_detection_output_layer(), arm_compute::graph::backends::detail::validate_detection_post_process_layer(), arm_compute::graph::backends::detail::validate_eltwise_Layer(), arm_compute::graph::backends::detail::validate_generate_proposals_layer(), arm_compute::graph::backends::detail::validate_l2_normalize_layer(), arm_compute::graph::backends::detail::validate_normalize_planar_yuv_layer(), arm_compute::graph::backends::detail::validate_pad_layer(), arm_compute::graph::backends::detail::validate_permute_layer(), arm_compute::graph::backends::detail::validate_prelu_layer(), arm_compute::graph::backends::detail::validate_priorbox_layer(), arm_compute::graph::backends::detail::validate_quantization_layer(), arm_compute::graph::backends::detail::validate_reduction_operation_layer(), arm_compute::graph::backends::detail::validate_reorg_layer(), arm_compute::graph::backends::detail::validate_reshape_layer(), arm_compute::graph::backends::detail::validate_roi_align_layer(), arm_compute::graph::backends::detail::validate_slice_layer(), arm_compute::graph::backends::detail::validate_strided_slice_layer(), and arm_compute::graph::backends::detail::validate_unary_eltwise_layer().

◆ vdequantize() [1/9]

float32x4x4_t arm_compute::vdequantize ( const int16x8x2_t &  qv,
const UniformQuantizationInfo qi 
)
inline

Dequantize a neon vector holding 16 16-bit quantized values.

Parameters
[in]qvInput values to be dequantized.
[in]qiQuantization information to be used in the computation.
Returns
Dequantized values in a neon vector

Definition at line 171 of file NESymm.h.

172 {
173  const float scale = qi.scale;
174  const float32x4_t vscale = vdupq_n_f32(scale);
175  const float32x4x4_t vdequantized_input = {{
176  vmulq_f32(vcvtq_f32_s32(vmovl_s16(vget_low_s16(qv.val[0]))), vscale),
177  vmulq_f32(vcvtq_f32_s32(vmovl_s16(vget_high_s16(qv.val[0]))), vscale),
178  vmulq_f32(vcvtq_f32_s32(vmovl_s16(vget_low_s16(qv.val[1]))), vscale),
179  vmulq_f32(vcvtq_f32_s32(vmovl_s16(vget_high_s16(qv.val[1]))), vscale),
180  }};
181  return vdequantized_input;
182 }

References UniformQuantizationInfo::scale, and arm_compute::test::validation::scale.

◆ vdequantize() [2/9]

float32x4x4_t arm_compute::vdequantize ( const int8x16_t &  qv,
const float32x4x4_t  vscale 
)
inline

Dequantize following symmetric quantization scheme a neon vector holding 16 quantized values.

Parameters
[in]qvInput values to be dequantized.
[in]vscaleVector containing quantization scaling factors.
Returns
Dequantized values in a neon vector

Definition at line 554 of file NEAsymm.h.

555 {
556  const float32x4x4_t vdequantized_input = {{
557  vmulq_f32(vcvtq_f32_s32(vmovl_s16(vget_low_s16(vmovl_s8(vget_low_s8(qv))))), vscale.val[0]),
558  vmulq_f32(vcvtq_f32_s32(vmovl_s16(vget_high_s16(vmovl_s8(vget_low_s8(qv))))), vscale.val[1]),
559  vmulq_f32(vcvtq_f32_s32(vmovl_s16(vget_low_s16(vmovl_s8(vget_high_s8(qv))))), vscale.val[2]),
560  vmulq_f32(vcvtq_f32_s32(vmovl_s16(vget_high_s16(vmovl_s8(vget_high_s8(qv))))), vscale.val[3]),
561  }};
562  return vdequantized_input;
563 }

◆ vdequantize() [3/9]

float32x4x4_t arm_compute::vdequantize ( const int8x16_t &  qv,
const UniformQuantizationInfo qi 
)
inline

Dequantize a neon vector holding 16 signed quantized values.

Parameters
[in]qvInput values to be dequantized.
[in]qiQuantization information to be used in the computation.
Returns
Dequantized values in a neon vector

Definition at line 482 of file NEAsymm.h.

483 {
484  const float scale = qi.scale;
485  const int offset = qi.offset;
486  const int32x4_t voffset = vdupq_n_s32(offset);
487  const float32x4_t vscale = vdupq_n_f32(scale);
488  const float32x4x4_t vdequantized_input = {{
489  vmulq_f32(vcvtq_f32_s32(vsubq_s32(vmovl_s16(vget_low_s16(vmovl_s8(vget_low_s8(qv)))), voffset)), vscale),
490  vmulq_f32(vcvtq_f32_s32(vsubq_s32(vmovl_s16(vget_high_s16(vmovl_s8(vget_low_s8(qv)))), voffset)), vscale),
491  vmulq_f32(vcvtq_f32_s32(vsubq_s32(vmovl_s16(vget_low_s16(vmovl_s8(vget_high_s8(qv)))), voffset)), vscale),
492  vmulq_f32(vcvtq_f32_s32(vsubq_s32(vmovl_s16(vget_high_s16(vmovl_s8(vget_high_s8(qv)))), voffset)), vscale),
493  }};
494  return vdequantized_input;
495 }

References UniformQuantizationInfo::offset, offset(), UniformQuantizationInfo::scale, and arm_compute::test::validation::scale.

◆ vdequantize() [4/9]

float32x4x4_t arm_compute::vdequantize ( const int8x16_t &  qv,
float  scale 
)
inline

Dequantize following a symmetric quantization scheme a neon vector holding 16 quantized values.

Parameters
[in]qvInput values to be dequantized.
[in]scaleQuantization scaling factor.
Returns
Dequantized values in a neon vector

Definition at line 572 of file NEAsymm.h.

573 {
574  const float32x4_t vscale = vdupq_n_f32(scale);
575  const float32x4x4_t vdequantized_input = {{
576  vmulq_f32(vcvtq_f32_s32(vmovl_s16(vget_low_s16(vmovl_s8(vget_low_s8(qv))))), vscale),
577  vmulq_f32(vcvtq_f32_s32(vmovl_s16(vget_high_s16(vmovl_s8(vget_low_s8(qv))))), vscale),
578  vmulq_f32(vcvtq_f32_s32(vmovl_s16(vget_low_s16(vmovl_s8(vget_high_s8(qv))))), vscale),
579  vmulq_f32(vcvtq_f32_s32(vmovl_s16(vget_high_s16(vmovl_s8(vget_high_s8(qv))))), vscale),
580  }};
581  return vdequantized_input;
582 }

References arm_compute::test::validation::scale.

◆ vdequantize() [5/9]

float32x4x4_t arm_compute::vdequantize ( const int8x16_t &  qv,
float  scale,
int32_t  offset 
)
inline

Dequantize a vector of 16 values stored as signed asymmetric.

Parameters
[in]qvInput values to be dequantized.
[in]scaleQuantization scaling factor.
[in]offsetZero quantization offset.
Returns
Dequantized values in a neon vector

Definition at line 534 of file NEAsymm.h.

535 {
536  const int32x4_t voffset = vdupq_n_s32(offset);
537  const float32x4_t vscale = vdupq_n_f32(scale);
538  const float32x4x4_t vdequantized_input = {{
539  vmulq_f32(vcvtq_f32_s32(vsubq_s32(vmovl_s16(vget_low_s16(vmovl_s8(vget_low_s8(qv)))), voffset)), vscale),
540  vmulq_f32(vcvtq_f32_s32(vsubq_s32(vmovl_s16(vget_high_s16(vmovl_s8(vget_low_s8(qv)))), voffset)), vscale),
541  vmulq_f32(vcvtq_f32_s32(vsubq_s32(vmovl_s16(vget_low_s16(vmovl_s8(vget_high_s8(qv)))), voffset)), vscale),
542  vmulq_f32(vcvtq_f32_s32(vsubq_s32(vmovl_s16(vget_high_s16(vmovl_s8(vget_high_s8(qv)))), voffset)), vscale),
543  }};
544  return vdequantized_input;
545 }

References offset(), and arm_compute::test::validation::scale.

◆ vdequantize() [6/9]

float32x4x2_t arm_compute::vdequantize ( const int8x8_t &  qv,
const UniformQuantizationInfo qi 
)
inline

Dequantize a neon vector holding 8 singed quantized values.

Parameters
[in]qvInput values to be dequantized.
[in]qiQuantization information to be used in the computation.
Returns
Dequantized values in a neon vector

Definition at line 432 of file NEAsymm.h.

433 {
434  const float scale = qi.scale;
435  const int offset = qi.offset;
436  const int32x4_t voffset = vdupq_n_s32(offset);
437  const float32x4_t vscale = vdupq_n_f32(scale);
438  const float32x4x2_t vdequantized_input = {{
439  vmulq_f32(vcvtq_f32_s32(vsubq_s32(vmovl_s16(vget_low_s16(vmovl_s8(qv))), voffset)), vscale),
440  vmulq_f32(vcvtq_f32_s32(vsubq_s32(vmovl_s16(vget_high_s16(vmovl_s8(qv))), voffset)), vscale),
441  }};
442  return vdequantized_input;
443 }

References UniformQuantizationInfo::offset, offset(), UniformQuantizationInfo::scale, and arm_compute::test::validation::scale.

◆ vdequantize() [7/9]

float32x4x4_t arm_compute::vdequantize ( const uint8x16_t &  qv,
const UniformQuantizationInfo qi 
)
inline

Dequantize a neon vector holding 16 quantized values.

Parameters
[in]qvInput values to be dequantized.
[in]qiQuantization information to be used in the computation.
Returns
Dequantized values in a neon vector

Definition at line 452 of file NEAsymm.h.

453 {
454  const float scale = qi.scale;
455  const int offset = qi.offset;
456  const int32x4_t voffset = vdupq_n_s32(offset);
457  const float32x4_t vscale = vdupq_n_f32(scale);
458  const float32x4x4_t vdequantized_input = {{
459  vmulq_f32(vcvtq_f32_s32(
460  vsubq_s32(vreinterpretq_s32_u32(vmovl_u16(vget_low_u16(vmovl_u8(vget_low_u8(qv))))), voffset)),
461  vscale),
462  vmulq_f32(vcvtq_f32_s32(
463  vsubq_s32(vreinterpretq_s32_u32(vmovl_u16(vget_high_u16(vmovl_u8(vget_low_u8(qv))))), voffset)),
464  vscale),
465  vmulq_f32(vcvtq_f32_s32(
466  vsubq_s32(vreinterpretq_s32_u32(vmovl_u16(vget_low_u16(vmovl_u8(vget_high_u8(qv))))), voffset)),
467  vscale),
468  vmulq_f32(vcvtq_f32_s32(
469  vsubq_s32(vreinterpretq_s32_u32(vmovl_u16(vget_high_u16(vmovl_u8(vget_high_u8(qv))))), voffset)),
470  vscale),
471  }};
472  return vdequantized_input;
473 }

References UniformQuantizationInfo::offset, offset(), UniformQuantizationInfo::scale, and arm_compute::test::validation::scale.

◆ vdequantize() [8/9]

float32x4x4_t arm_compute::vdequantize ( const uint8x16_t &  qv,
float  scale,
int32_t  offset 
)
inline

Dequantize following an asymmetric quantization scheme a neon vector holding 16 quantized values.

Parameters
[in]qvInput values to be dequantized.
[in]scaleQuantization scaling factor.
[in]offsetZero quantization offset.
Returns
Dequantized values in a neon vector

Definition at line 505 of file NEAsymm.h.

506 {
507  const int32x4_t voffset = vdupq_n_s32(offset);
508  const float32x4_t vscale = vdupq_n_f32(scale);
509  const float32x4x4_t vdequantized_input = {{
510  vmulq_f32(vcvtq_f32_s32(
511  vsubq_s32(vreinterpretq_s32_u32(vmovl_u16(vget_low_u16(vmovl_u8(vget_low_u8(qv))))), voffset)),
512  vscale),
513  vmulq_f32(vcvtq_f32_s32(
514  vsubq_s32(vreinterpretq_s32_u32(vmovl_u16(vget_high_u16(vmovl_u8(vget_low_u8(qv))))), voffset)),
515  vscale),
516  vmulq_f32(vcvtq_f32_s32(
517  vsubq_s32(vreinterpretq_s32_u32(vmovl_u16(vget_low_u16(vmovl_u8(vget_high_u8(qv))))), voffset)),
518  vscale),
519  vmulq_f32(vcvtq_f32_s32(
520  vsubq_s32(vreinterpretq_s32_u32(vmovl_u16(vget_high_u16(vmovl_u8(vget_high_u8(qv))))), voffset)),
521  vscale),
522  }};
523  return vdequantized_input;
524 }

References offset(), and arm_compute::test::validation::scale.

◆ vdequantize() [9/9]

float32x4x2_t arm_compute::vdequantize ( const uint8x8_t &  qv,
const UniformQuantizationInfo qi 
)
inline

Dequantize a neon vector holding 8 quantized values.

Parameters
[in]qvInput values to be dequantized.
[in]qiQuantization information to be used in the computation.
Returns
Dequantized values in a neon vector

Definition at line 410 of file NEAsymm.h.

411 {
412  const float scale = qi.scale;
413  const int offset = qi.offset;
414  const int32x4_t voffset = vdupq_n_s32(offset);
415  const float32x4_t vscale = vdupq_n_f32(scale);
416  const float32x4x2_t vdequantized_input = {{
417  vmulq_f32(vcvtq_f32_s32(vsubq_s32(vreinterpretq_s32_u32(vmovl_u16(vget_low_u16(vmovl_u8(qv)))), voffset)),
418  vscale),
419  vmulq_f32(vcvtq_f32_s32(vsubq_s32(vreinterpretq_s32_u32(vmovl_u16(vget_high_u16(vmovl_u8(qv)))), voffset)),
420  vscale),
421  }};
422  return vdequantized_input;
423 }

References UniformQuantizationInfo::offset, offset(), UniformQuantizationInfo::scale, and arm_compute::test::validation::scale.

Referenced by arm_compute::cpu::elementwise_comp_quantized_signed(), arm_compute::cpu::elementwise_op< int8_t >(), arm_compute::cpu::elementwise_op< uint8_t >(), arm_compute::cpu::elementwise_op_quantized(), arm_compute::cpu::elementwise_op_quantized_signed(), arm_compute::cpu::neon_qasymm8_activation(), arm_compute::cpu::neon_qasymm8_signed_activation(), CpuConcatenateWidthKernel::run_op(), and CpuConcatenateHeightKernel::run_op().

◆ vdequantize_int16()

float32x4x2_t arm_compute::vdequantize_int16 ( const int16x8_t &  qv,
float  scale 
)
inline

Dequantize a neon vector holding 8 16-bit quantized values.

Parameters
[in]qvInput values to be dequantized.
[in]scaleQuantization scale
Returns
Dequantized values in a neon vector

Definition at line 135 of file NESymm.h.

136 {
137  const float32x4_t vscale = vdupq_n_f32(scale);
138  const float32x4x2_t vdequantized_input = {{vmulq_f32(vcvtq_f32_s32(vmovl_s16(vget_low_s16(qv))), vscale),
139  vmulq_f32(vcvtq_f32_s32(vmovl_s16(vget_high_s16(qv))), vscale)}};
140  return vdequantized_input;
141 }

References arm_compute::test::validation::scale.

Referenced by arm_compute::cpu::neon_qsymm16_activation().

◆ verfq_f32()

float32x4_t arm_compute::verfq_f32 ( float32x4_t  x)

Calculate error function.

Parameters
[in]xInput vector in F32 format.
Returns
The calculated erf.

◆ vexpq_f32()

float32x4_t arm_compute::vexpq_f32 ( float32x4_t  x)

Calculate exponential.

Parameters
[in]xInput vector value in F32 format.
Returns
The calculated exponent.

Referenced by arm_compute::cpu::neon_softmax_non_x_quantized(), and arm_compute::cpu::neon_softmax_x_quantized().

◆ vfloorq_f32()

float32x4_t arm_compute::vfloorq_f32 ( float32x4_t  val)

Calculate floor of a vector.

Parameters
[in]valInput vector value in F32 format.
Returns
The calculated floor vector.

Referenced by arm_compute::cpu::fp32_neon_floor().

◆ vinv_f32()

float32x2_t arm_compute::vinv_f32 ( float32x2_t  x)

Calculate reciprocal.

Parameters
[in]xInput value.
Returns
The calculated reciprocal.

◆ vinvq_f32()

float32x4_t arm_compute::vinvq_f32 ( float32x4_t  x)

Calculate reciprocal.

Parameters
[in]xInput value.
Returns
The calculated reciprocal.

◆ vinvsqrt_f32()

float32x2_t arm_compute::vinvsqrt_f32 ( float32x2_t  x)

Calculate inverse square root.

Parameters
[in]xInput value.
Returns
The calculated inverse square root.

◆ vinvsqrtq_f32()

float32x4_t arm_compute::vinvsqrtq_f32 ( float32x4_t  x)

Calculate inverse square root.

Parameters
[in]xInput value.
Returns
The calculated inverse square root.

◆ vlogq_f32()

float32x4_t arm_compute::vlogq_f32 ( float32x4_t  x)

Calculate logarithm.

Parameters
[in]xInput vector value in F32 format.
Returns
The calculated logarithm.

◆ vmax2q_f32()

float32x4x2_t arm_compute::vmax2q_f32 ( float32x4x2_t  a,
float32x4x2_t  b 
)

Compute lane-by-lane maximum between elements of a float vector with 4x2 elements.

Parameters
[in]aFloat input vector
[in]bFloat input vector
Returns
The lane-by-lane maximum -> float32x4x2

◆ vmlaq_qasymm8()

qasymm8x16_t vmlaq_qasymm8 ( qasymm8x16_t  vd,
float32x4_t  vs,
float32x4_t  vo 
)
inline

Perform a multiply-accumulate on all 16 components of a QASYMM8 vector.

vd*vs + vo

Parameters
[in]vdInput vector value in QASYMM8 format
[in]vsVector multiplier in F32 format. The multiplier value must be duplicated across all four lanes.
[in]voVector addend in F32 format. The addend value must be duplicated across all four lanes.
Returns
A 16-component vector in QASYMM8 format, saturated to fit

Definition at line 30 of file NEAsymm.inl.

31 {
32  // Convert uint8 vectors to uint16 vectors
33  const uint8x8_t vd_low = vget_low_u8(vd);
34  const uint8x8_t vd_high = vget_high_u8(vd);
35  uint16x8_t vd_low_u16x8 = vmovl_u8(vd_low);
36  uint16x8_t vd_high_u16x8 = vmovl_u8(vd_high);
37  // Convert uint16 vectors to uint32 vectors
38  uint32x4_t A_u32x4 = vmovl_u16(vget_low_u16(vd_low_u16x8));
39  uint32x4_t B_u32x4 = vmovl_u16(vget_high_u16(vd_low_u16x8));
40  uint32x4_t C_u32x4 = vmovl_u16(vget_low_u16(vd_high_u16x8));
41  uint32x4_t D_u32x4 = vmovl_u16(vget_high_u16(vd_high_u16x8));
42  // Convert uint32 vectors to float32 vectors
43  float32x4_t A_f32x4 = vcvtq_f32_u32(A_u32x4);
44  float32x4_t B_f32x4 = vcvtq_f32_u32(B_u32x4);
45  float32x4_t C_f32x4 = vcvtq_f32_u32(C_u32x4);
46  float32x4_t D_f32x4 = vcvtq_f32_u32(D_u32x4);
47  // vd = vd*vs + vo
48  A_f32x4 = vmlaq_f32(vo, A_f32x4, vs);
49  B_f32x4 = vmlaq_f32(vo, B_f32x4, vs);
50  C_f32x4 = vmlaq_f32(vo, C_f32x4, vs);
51  D_f32x4 = vmlaq_f32(vo, D_f32x4, vs);
52  // Convert float32 vectors to uint32 vectors
53 #if __aarch64__
54  if (round_policy == RoundingPolicy::TO_NEAREST_EVEN)
55  {
56  A_u32x4 = vcvtnq_u32_f32(A_f32x4);
57  B_u32x4 = vcvtnq_u32_f32(B_f32x4);
58  C_u32x4 = vcvtnq_u32_f32(C_f32x4);
59  D_u32x4 = vcvtnq_u32_f32(D_f32x4);
60  }
61  else if (round_policy == RoundingPolicy::TO_NEAREST_UP)
62  {
63  A_u32x4 = vcvtaq_u32_f32(A_f32x4);
64  B_u32x4 = vcvtaq_u32_f32(B_f32x4);
65  C_u32x4 = vcvtaq_u32_f32(C_f32x4);
66  D_u32x4 = vcvtaq_u32_f32(D_f32x4);
67  }
68  else
69  {
70  A_u32x4 = vcvtq_u32_f32(A_f32x4);
71  B_u32x4 = vcvtq_u32_f32(B_f32x4);
72  C_u32x4 = vcvtq_u32_f32(C_f32x4);
73  D_u32x4 = vcvtq_u32_f32(D_f32x4);
74  }
75 #else // #if __aarch64__
76  // rounding mode only supported in aarch64
77  A_u32x4 = vcvtq_u32_f32(A_f32x4);
78  B_u32x4 = vcvtq_u32_f32(B_f32x4);
79  C_u32x4 = vcvtq_u32_f32(C_f32x4);
80  D_u32x4 = vcvtq_u32_f32(D_f32x4);
81 #endif // #if __aarch64__
82  // Convert uint32 vectors to uint16 vectors (with saturation)
83  vd_low_u16x8 = vcombine_u16(vqmovn_u32(A_u32x4), vqmovn_u32(B_u32x4));
84  vd_high_u16x8 = vcombine_u16(vqmovn_u32(C_u32x4), vqmovn_u32(D_u32x4));
85  // convert uint16 vectors to uint8 vectors (with saturation)
86  return vcombine_u8(vqmovn_u16(vd_low_u16x8), vqmovn_u16(vd_high_u16x8));
87 }

References TO_NEAREST_EVEN, and TO_NEAREST_UP.

◆ vmlaq_qasymm8_signed()

qasymm8x16_signed_t vmlaq_qasymm8_signed ( qasymm8x16_signed_t  vd,
float32x4_t  vs,
float32x4_t  vo 
)
inline

Perform a multiply-accumulate on all 16 components of a QASYMM8_SIGNED vector.

vd*vs + vo

Parameters
[in]vdInput vector value in QASYMM8_SIGNED format
[in]vsVector multiplier in F32 format. The multiplier value must be duplicated across all four lanes.
[in]voVector addend in F32 format. The addend value must be duplicated across all four lanes.
Returns
A 16-component vector in QASYMM8_SIGNED format, saturated to fit

Definition at line 90 of file NEAsymm.inl.

91 {
92  // Convert uint8 vectors to int16 vectors
93  const int8x8_t vd_low = vget_low_s8(vd);
94  const int8x8_t vd_high = vget_high_s8(vd);
95  int16x8_t vd_low_s16x8 = vmovl_s8(vd_low);
96  int16x8_t vd_high_s16x8 = vmovl_s8(vd_high);
97  // Convert int16 vectors to int32 vectors
98  int32x4_t A_s32x4 = vmovl_s16(vget_low_s16(vd_low_s16x8));
99  int32x4_t B_s32x4 = vmovl_s16(vget_high_s16(vd_low_s16x8));
100  int32x4_t C_s32x4 = vmovl_s16(vget_low_s16(vd_high_s16x8));
101  int32x4_t D_s32x4 = vmovl_s16(vget_high_s16(vd_high_s16x8));
102  // Convert int32 vectors to float32 vectors
103  float32x4_t A_f32x4 = vcvtq_f32_s32(A_s32x4);
104  float32x4_t B_f32x4 = vcvtq_f32_s32(B_s32x4);
105  float32x4_t C_f32x4 = vcvtq_f32_s32(C_s32x4);
106  float32x4_t D_f32x4 = vcvtq_f32_s32(D_s32x4);
107  // vd = vd*vs + vo
108  A_f32x4 = vmlaq_f32(vo, A_f32x4, vs);
109  B_f32x4 = vmlaq_f32(vo, B_f32x4, vs);
110  C_f32x4 = vmlaq_f32(vo, C_f32x4, vs);
111  D_f32x4 = vmlaq_f32(vo, D_f32x4, vs);
112 #if __aarch64__
113  if (round_policy == RoundingPolicy::TO_NEAREST_EVEN)
114  {
115  A_s32x4 = vcvtnq_s32_f32(A_f32x4);
116  B_s32x4 = vcvtnq_s32_f32(B_f32x4);
117  C_s32x4 = vcvtnq_s32_f32(C_f32x4);
118  D_s32x4 = vcvtnq_s32_f32(D_f32x4);
119  }
120  else if (round_policy == RoundingPolicy::TO_NEAREST_UP)
121  {
122  A_s32x4 = vcvtaq_s32_f32(A_f32x4);
123  B_s32x4 = vcvtaq_s32_f32(B_f32x4);
124  C_s32x4 = vcvtaq_s32_f32(C_f32x4);
125  D_s32x4 = vcvtaq_s32_f32(D_f32x4);
126  }
127  else
128  {
129  A_s32x4 = vcvtq_s32_f32(A_f32x4);
130  B_s32x4 = vcvtq_s32_f32(B_f32x4);
131  C_s32x4 = vcvtq_s32_f32(C_f32x4);
132  D_s32x4 = vcvtq_s32_f32(D_f32x4);
133  }
134 #else // #if __aarch64__
135  // rounding mode only supported in aarch64
136  A_s32x4 = vcvtq_s32_f32(A_f32x4);
137  B_s32x4 = vcvtq_s32_f32(B_f32x4);
138  C_s32x4 = vcvtq_s32_f32(C_f32x4);
139  D_s32x4 = vcvtq_s32_f32(D_f32x4);
140 #endif // #if __aarch64__
141 
142  // Convert int32 vectors to int16 vectors (with saturation)
143  vd_low_s16x8 = vcombine_s16(vqmovn_s32(A_s32x4), vqmovn_s32(B_s32x4));
144  vd_high_s16x8 = vcombine_s16(vqmovn_s32(C_s32x4), vqmovn_s32(D_s32x4));
145  // convert int16 vectors to int8 vectors (with saturation)
146  return vcombine_s8(vqmovn_s16(vd_low_s16x8), vqmovn_s16(vd_high_s16x8));
147 }

References TO_NEAREST_EVEN, and TO_NEAREST_UP.

◆ vpowq_f32()

float32x4_t arm_compute::vpowq_f32 ( float32x4_t  val,
float32x4_t  n 
)

Calculate n power of a number.

pow(x,n) = e^(n*log(x))

Parameters
[in]valInput vector value in F32 format.
[in]nPowers to raise the input to.
Returns
The calculated power.

◆ vquantize() [1/2]

uint8x8_t arm_compute::vquantize ( const float32x4x2_t &  qv,
const UniformQuantizationInfo qi 
)
inline

Quantize a neon vector holding 8 floating point values.

Parameters
[in]qvInput values to be quantized.
[in]qiQuantization information to be used in the computation.
Returns
A neon vector holding the quantized values

Definition at line 591 of file NEAsymm.h.

592 {
593  const float scale = qi.scale;
594  const int offset = qi.offset;
595  const float32x4_t voffset = vdupq_n_f32(offset);
596  const float32x4_t vinvscale = vdupq_n_f32(1.f / scale);
597  const int32x4x4_t rf = {{
598 #ifdef __aarch64__
599  vcvtnq_s32_f32(vmlaq_f32(voffset, qv.val[0], vinvscale)),
600  vcvtnq_s32_f32(vmlaq_f32(voffset, qv.val[1], vinvscale)),
601 #else //__aarch64__
602  vcvtq_s32_f32(vmlaq_f32(voffset, qv.val[0], vinvscale)),
603  vcvtq_s32_f32(vmlaq_f32(voffset, qv.val[1], vinvscale)),
604 #endif //__aarch64__
605  }};
606  return vqmovun_s16(vcombine_s16(vqmovn_s32(rf.val[0]), vqmovn_s32(rf.val[1])));
607 }

References UniformQuantizationInfo::offset, offset(), UniformQuantizationInfo::scale, and arm_compute::test::validation::scale.

Referenced by arm_compute::cpu::elementwise_op< uint8_t >(), arm_compute::cpu::neon_qasymm8_activation(), CpuConcatenateHeightKernel::run_op(), and CpuConcatenateWidthKernel::run_op().

◆ vquantize() [2/2]

uint8x16_t arm_compute::vquantize ( const float32x4x4_t &  qv,
const UniformQuantizationInfo qi 
)
inline

Quantize a neon vector holding 16 floating point values.

Parameters
[in]qvInput values to be quantized.
[in]qiQuantization information to be used in the computation.
Returns
A neon vector holding the quantized values

Definition at line 661 of file NEAsymm.h.

662 {
663  auto rf = vquantize_internal(qv, qi.scale, qi.offset);
664  const uint8x8_t pa = vqmovun_s16(vcombine_s16(vqmovn_s32(rf.val[0]), vqmovn_s32(rf.val[1])));
665  const uint8x8_t pb = vqmovun_s16(vcombine_s16(vqmovn_s32(rf.val[2]), vqmovn_s32(rf.val[3])));
666  return vcombine_u8(pa, pb);
667 }

References UniformQuantizationInfo::offset, UniformQuantizationInfo::scale, and vquantize_internal().

◆ vquantize_int16()

int16x8_t arm_compute::vquantize_int16 ( const float32x4x2_t &  qv,
float  scale 
)
inline

Quantize a neon vector holding 8 floating point values.

Parameters
[in]qvInput values to be quantized.
[in]scaleQuantization scale
Returns
A neon vector holding the quantized values

Definition at line 150 of file NESymm.h.

151 {
152  const float32x4_t vinvscale = vdupq_n_f32(1.f / scale);
153 
154  const int32x4x2_t rf = {{
155 #ifdef __aarch64__
156  vcvtnq_s32_f32(vmulq_f32(qv.val[0], vinvscale)), vcvtnq_s32_f32(vmulq_f32(qv.val[1], vinvscale))
157 #else //__aarch64__
158  vcvtq_s32_f32(vmulq_f32(qv.val[0], vinvscale)), vcvtq_s32_f32(vmulq_f32(qv.val[1], vinvscale))
159 #endif //__aarch64__
160  }};
161  return vcombine_s16(vqmovn_s32(rf.val[0]), vqmovn_s32(rf.val[1]));
162 }

References arm_compute::test::validation::scale.

Referenced by arm_compute::cpu::neon_qsymm16_activation().

◆ vquantize_internal()

int32x4x4_t arm_compute::vquantize_internal ( const float32x4x4_t &  qv,
float  scale,
int32_t  offset 
)
inline

Definition at line 634 of file NEAsymm.h.

635 {
636  const int32x4_t voffset = vdupq_n_s32(offset);
637  const float32x4_t vinvscale = vdupq_n_f32(1.f / scale);
638  const int32x4x4_t rf = {{
639 #ifdef __aarch64__
640  vaddq_s32(vcvtaq_s32_f32(vmulq_f32(qv.val[0], vinvscale)), voffset),
641  vaddq_s32(vcvtaq_s32_f32(vmulq_f32(qv.val[1], vinvscale)), voffset),
642  vaddq_s32(vcvtaq_s32_f32(vmulq_f32(qv.val[2], vinvscale)), voffset),
643  vaddq_s32(vcvtaq_s32_f32(vmulq_f32(qv.val[3], vinvscale)), voffset),
644 #else //__aarch64__
645  vaddq_s32(vcvtq_s32_f32(vmulq_f32(qv.val[0], vinvscale)), voffset),
646  vaddq_s32(vcvtq_s32_f32(vmulq_f32(qv.val[1], vinvscale)), voffset),
647  vaddq_s32(vcvtq_s32_f32(vmulq_f32(qv.val[2], vinvscale)), voffset),
648  vaddq_s32(vcvtq_s32_f32(vmulq_f32(qv.val[3], vinvscale)), voffset),
649 #endif //__aarch64__
650  }};
651  return rf;
652 }

References offset(), and arm_compute::test::validation::scale.

Referenced by vquantize(), vquantize_qasymm16(), and vquantize_signed().

◆ vquantize_qasymm16()

uint16x8x2_t arm_compute::vquantize_qasymm16 ( const float32x4x4_t &  qv,
const UniformQuantizationInfo qi 
)
inline

Quantize to QASYMM16 a neon vector holding 16 floating point values.

Parameters
[in]qvInput values to be quantized.
[in]qiQuantization information to be used in the computation.
Returns
A neon vector holding the quantized values

Definition at line 691 of file NEAsymm.h.

692 {
693  auto rf = vquantize_internal(qv, qi.scale, qi.offset);
694  const uint16x8_t pa = vcombine_u16(vqmovun_s32(rf.val[0]), vqmovun_s32(rf.val[1]));
695  const uint16x8_t pb = vcombine_u16(vqmovun_s32(rf.val[2]), vqmovun_s32(rf.val[3]));
696  return {pa, pb};
697 }

References UniformQuantizationInfo::offset, UniformQuantizationInfo::scale, and vquantize_internal().

◆ vquantize_qsymm16()

qsymm16x8x2_t arm_compute::vquantize_qsymm16 ( const float32x4x4_t &  qv,
const UniformQuantizationInfo qi 
)
inline

Quantize a neon vector holding 16 floating point values.

Parameters
[in]qvInput values to be quantized.
[in]qiQuantization information to be used in the computation.
Returns
A neon vector holding the quantized values

Definition at line 191 of file NESymm.h.

192 {
193  const float scale = qi.scale;
194  ARM_COMPUTE_ERROR_ON(scale == 0.f);
195  const float32x4_t vinvscale = vdupq_n_f32(1.f / scale);
196  const int32x4x4_t rf = {{
197 #ifdef __aarch64__
198  vcvtnq_s32_f32(vmulq_f32(qv.val[0], vinvscale)),
199  vcvtnq_s32_f32(vmulq_f32(qv.val[1], vinvscale)),
200  vcvtnq_s32_f32(vmulq_f32(qv.val[2], vinvscale)),
201  vcvtnq_s32_f32(vmulq_f32(qv.val[3], vinvscale)),
202 #else //__aarch64__
203  vcvtq_s32_f32(vmulq_f32(qv.val[0], vinvscale)),
204  vcvtq_s32_f32(vmulq_f32(qv.val[1], vinvscale)),
205  vcvtq_s32_f32(vmulq_f32(qv.val[2], vinvscale)),
206  vcvtq_s32_f32(vmulq_f32(qv.val[3], vinvscale)),
207 #endif //__aarch64__
208  }};
209  const qsymm16x8x2_t res = {
210  vcombine_s16(vqmovn_s32(rf.val[0]), vqmovn_s32(rf.val[1])),
211  vcombine_s16(vqmovn_s32(rf.val[2]), vqmovn_s32(rf.val[3])),
212  };
213 
214  return res;
215 }

References ARM_COMPUTE_ERROR_ON, UniformQuantizationInfo::scale, and arm_compute::test::validation::scale.

◆ vquantize_signed() [1/2]

int8x8_t arm_compute::vquantize_signed ( const float32x4x2_t &  qv,
const UniformQuantizationInfo qi 
)
inline

Quantize a neon vector holding 8 floating point values.

Parameters
[in]qvInput values to be quantized.
[in]qiQuantization information to be used in the computation.
Returns
A neon vector holding the singed quantized values

Definition at line 616 of file NEAsymm.h.

617 {
618  const float scale = qi.scale;
619  const int offset = qi.offset;
620  const float32x4_t voffset = vdupq_n_f32(offset);
621  const float32x4_t vinvscale = vdupq_n_f32(1.f / scale);
622  const int32x4x4_t rf = {{
623 #ifdef __aarch64__
624  vcvtnq_s32_f32(vmlaq_f32(voffset, qv.val[0], vinvscale)),
625  vcvtnq_s32_f32(vmlaq_f32(voffset, qv.val[1], vinvscale)),
626 #else //__aarch64__
627  vcvtq_s32_f32(vmlaq_f32(voffset, qv.val[0], vinvscale)),
628  vcvtq_s32_f32(vmlaq_f32(voffset, qv.val[1], vinvscale)),
629 #endif //__aarch64__
630  }};
631  return vqmovn_s16(vcombine_s16(vqmovn_s32(rf.val[0]), vqmovn_s32(rf.val[1])));
632 }

References UniformQuantizationInfo::offset, offset(), UniformQuantizationInfo::scale, and arm_compute::test::validation::scale.

Referenced by arm_compute::cpu::elementwise_op< int8_t >(), arm_compute::cpu::neon_qasymm8_signed_activation(), CpuConcatenateHeightKernel::run_op(), and CpuConcatenateWidthKernel::run_op().

◆ vquantize_signed() [2/2]

int8x16_t arm_compute::vquantize_signed ( const float32x4x4_t &  qv,
const UniformQuantizationInfo qi 
)
inline

Signed quantize a neon vector holding 16 floating point values.

Parameters
[in]qvInput values to be quantized.
[in]qiQuantization information to be used in the computation.
Returns
A neon vector holding the quantized values

Definition at line 676 of file NEAsymm.h.

677 {
678  auto rf = vquantize_internal(qv, qi.scale, qi.offset);
679  const int8x8_t pa = vqmovn_s16(vcombine_s16(vqmovn_s32(rf.val[0]), vqmovn_s32(rf.val[1])));
680  const int8x8_t pb = vqmovn_s16(vcombine_s16(vqmovn_s32(rf.val[2]), vqmovn_s32(rf.val[3])));
681  return vcombine_s8(pa, pb);
682 }

References UniformQuantizationInfo::offset, UniformQuantizationInfo::scale, and vquantize_internal().

◆ vreduce()

float vreduce ( const float32x4_t &  v)
inline

Reduce a vector to be a scalar by accumulating all lanes in the vector.

Parameters
[in]vVector to be reduced.
Returns
the wrapped-around number.

Definition at line 537 of file NEMath.inl.

538 {
539  const float32x2_t v0 = vget_high_f32(v);
540  const float32x2_t v1 = vget_low_f32(v);
541  const float32x2_t v_out = vadd_f32(v0, v1);
542 
543  const float a = vget_lane_f32(v_out, 0);
544  const float b = vget_lane_f32(v_out, 1);
545 
546  return a + b;
547 }

References arm_compute::test::validation::b.

Referenced by arm_compute::cpu::kernels::convolve_nchw(), arm_compute::cpu::kernels::convolve_nhwc(), and arm_compute::cpu::directconv3d_float_neon_ndhwc().

◆ vroundq_rte_f32()

float32x4_t arm_compute::vroundq_rte_f32 ( float32x4_t  val)

Calculate round value of a vector to nearest with ties to even.

Parameters
[in]valInput vector value in F32 format.
Returns
The calculated round vector.

◆ vsin_f32()

float32x2_t arm_compute::vsin_f32 ( float32x2_t  val)

Calculate sine.

Parameters
[in]valInput vector value in radians, F32 format.
Returns
The calculated sine.

◆ vsinq_f32()

float32x4_t arm_compute::vsinq_f32 ( float32x4_t  val)

Calculate sine.

Parameters
[in]valInput vector value in radians, F32 format.
Returns
The calculated sine.

◆ vtanhq_f32()

float32x4_t arm_compute::vtanhq_f32 ( float32x4_t  val)

Calculate hyperbolic tangent.

tanh(x) = (e^2x - 1)/(e^2x + 1)

Note
We clamp x to [-5,5] to avoid overflowing issues.
Parameters
[in]valInput vector value in F32 format.
Returns
The calculated Hyperbolic Tangent.

◆ vtaylor_polyq_f32()

float32x4_t arm_compute::vtaylor_polyq_f32 ( float32x4_t  x,
const std::array< float32x4_t, 8 > &  coeffs 
)

Perform a 7th degree polynomial approximation using Estrin's method.

Parameters
[in]xInput vector value in F32 format.
[in]coeffsPolynomial coefficients table.
Returns
The calculated approximation.

◆ wrap_around()

Variable Documentation

◆ erf_f32_lut

const std::array< ErfLutEntry< float >, 513 > erf_f32_lut

The lookup table for FP32 erf(x) calculation.

Definition at line 30 of file Math.cpp.

◆ log_tab

const std::array<float32x4_t, 8> log_tab
Initial value:
= {{
vdupq_n_f32(-2.29561495781f),
vdupq_n_f32(-2.47071170807f),
vdupq_n_f32(-5.68692588806f),
vdupq_n_f32(-0.165253549814f),
vdupq_n_f32(5.17591238022f),
vdupq_n_f32(0.844007015228f),
vdupq_n_f32(4.58445882797f),
vdupq_n_f32(0.0141278216615f),
}}

Logarithm polynomial coefficients.

Definition at line 34 of file NEMath.inl.

◆ MAX_DIMS

constexpr size_t MAX_DIMS = 6
constexpr

Constant value used to indicate maximum dimensions of a Window, TensorShape and Coordinates.

Definition at line 38 of file Dimensions.h.

Referenced by arm_compute::misc::shape_calculator::calculate_concatenate_shape().

◆ te_sin_coeff2

constexpr float te_sin_coeff2 = 0.166666666666f
constexpr

Sin polynomial coefficients.

Definition at line 46 of file NEMath.inl.

◆ te_sin_coeff3

constexpr float te_sin_coeff3 = 0.05f
constexpr

Definition at line 47 of file NEMath.inl.

◆ te_sin_coeff4

constexpr float te_sin_coeff4 = 0.023809523810f
constexpr

Definition at line 48 of file NEMath.inl.

◆ te_sin_coeff5

constexpr float te_sin_coeff5 = 0.013888888889f
constexpr

Definition at line 49 of file NEMath.inl.

AclUnsupportedTarget
@ AclUnsupportedTarget
Call failed as an invalid backend was requested.
Definition: AclTypes.h:56
arm_compute::WeightFormat::OHWIo4i2_bf16
@ OHWIo4i2_bf16
arm_compute::DataLayout::NCHW
@ NCHW
Num samples, channels, height, width.
arm_compute::NMSType::GAUSSIAN
@ GAUSSIAN
Gaussian NMS.
arm_compute::test::validation::dst_shape
TensorShape dst_shape
Definition: DFT.cpp:164
arm_compute::ACL_SRC_DST
@ ACL_SRC_DST
Definition: Types.h:41
acl::Target::GpuOcl
@ GpuOcl
Gpu target that leverages OpenCL.
arm_compute::Channel::V
@ V
Cr/V/Value channel.
arm_compute::DataType::QSYMM8_PER_CHANNEL
@ QSYMM8_PER_CHANNEL
quantized, symmetric per channel fixed-point 8-bit number
arm_compute::wrapper::vadd
uint8x8_t vadd(const uint8x8_t &a, const uint8x8_t &b)
Definition: add.h:39
arm_compute::ComparisonOperation::LessEqual
@ LessEqual
Less equal comparison ( )
arm_compute::DataType::QASYMM16
@ QASYMM16
quantized, asymmetric fixed-point 16-bit number
GemmTuner.args
args
Definition: GemmTuner.py:679
arm_compute::GPUTarget::T700
@ T700
arm_compute::GPUTarget::G31
@ G31
arm_compute::opencl_is_available
bool opencl_is_available()
Check if OpenCL is available.
Definition: OpenCL.cpp:236
arm_compute::Format::U64
@ U64
1 channel, 1 U64 per channel
arm_compute::GPUTarget::G610
@ G610
arm_compute::Format::RGB888
@ RGB888
3 channels, 1 U8 per channel
arm_compute::ACL_DST_1
@ ACL_DST_1
Definition: Types.h:57
arm_compute::error_on_mismatching_data_layouts
arm_compute::Status error_on_mismatching_data_layouts(const char *function, const char *file, const int line, const ITensorInfo *tensor_info, Ts... tensor_infos)
Return an error if the passed tensor infos have different data layouts.
Definition: Validate.h:588
AclCpu
@ AclCpu
Cpu target that uses SIMD extensions.
Definition: AclTypes.h:66
arm_compute::calculate_subsampled_shape
TensorShape calculate_subsampled_shape(const TensorShape &shape, Format format, Channel channel=Channel::UNKNOWN)
Calculate subsampled shape for a given format and channel.
Definition: Validate.h:400
PRELU
#define PRELU(x, y)
Definition: elementwise_operation_quantized.cl:31
GemmTuner.required
required
Definition: GemmTuner.py:652
arm_compute::WeightFormat::OHWIo64i2_bf16
@ OHWIo64i2_bf16
arm_compute::GPUTarget::VALHALL
@ VALHALL
arm_compute::CLVersion::CL10
@ CL10
arm_compute::test::validation::src
SimpleTensor< float > src
Definition: DFT.cpp:155
N
unsigned int N
Definition: CpuGemmAssemblyDispatch.cpp:105
arm_compute::ReductionOperation::PROD
@ PROD
Product.
arm_compute::ConvolutionMethod::FFT
@ FFT
Convolution using FFT.
arm_compute::Format::UNKNOWN
@ UNKNOWN
Unknown image format.
type
decltype(strategy::transforms) typedef type
Definition: gemm_interleaved.hpp:338
arm_compute::utility::tolower
std::string tolower(std::string string)
Convert string to lower case.
Definition: Utility.h:204
DetectionWindow::width
ushort width
Width of the detection window.
Definition: types.h:51
arm_compute::GPUTarget::T800
@ T800
arm_compute::cpu::vector_size
constexpr size_t vector_size
Definition: impl.h:43
arm_compute::PoolingType::L2
@ L2
L2 Pooling.
arm_compute::RoundingPolicy::TO_NEAREST_EVEN
@ TO_NEAREST_EVEN
Rounds to nearest value; half rounds to nearest even.
arm_compute::convert_int8x16_to_float32x4x4
float32x4x4_t convert_int8x16_to_float32x4x4(const int8x16_t &in)
Converts from int8x16 to float32x4x4_t.
Definition: NEMath.inl:462
arm_compute::GPUTarget::FIFTHGEN
@ FIFTHGEN
arm_compute::ACL_DST_END
@ ACL_DST_END
Definition: Types.h:59
arm_compute::quantize_qasymm16
uint16_t quantize_qasymm16(float value, const QuantizationInfo &qinfo)
Quantize a value given a 16-bit asymmetric quantization scheme.
Definition: QuantizationInfo.h:549
arm_compute::test::validation::idx_height
const int idx_height
Definition: Scale.cpp:263
arm_compute::error_on_data_layout_not_in
arm_compute::Status error_on_data_layout_not_in(const char *function, const char *file, const int line, const ITensorInfo *tensor_info, T &&dl, Ts &&...dls)
Return an error if the data layout of the passed tensor info does not match any of the data layouts p...
Definition: Validate.h:853
arm_compute::WeightFormat::OHWIo8i4
@ OHWIo8i4
arm_compute::Dimensions::set
void set(size_t dimension, T value, bool increase_dim_unit=true)
Accessor to set the value of one of the dimensions.
Definition: Dimensions.h:75
arm_compute::DataLayout
DataLayout
[DataLayout enum definition]
Definition: CoreTypes.h:110
arm_compute::DataLayoutDimension::CHANNEL
@ CHANNEL
channel
arm_compute::DataType::F64
@ F64
64-bit floating-point number
arm_compute::ComparisonOperation::Equal
@ Equal
Equal comparison ( )
arm_compute::GEMMLowpOutputStageType::QUANTIZE_DOWN_FLOAT
@ QUANTIZE_DOWN_FLOAT
Quantize using a floating point multiplication.
arm_compute::GPUTarget::G620
@ G620
arm_compute::detail::ObjectType::TensorPack
@ TensorPack
arm_compute::POOL
@ POOL
Pool CL kernel type.
Definition: CLTypes.h:85
arm_compute::WeightFormat::ANY
@ ANY
arm_compute::NormType::IN_MAP_1D
@ IN_MAP_1D
Normalization applied within the same map in 1D region.
arm_compute::GPUTarget::G720
@ G720
arm_compute::DataLayout::NCDHW
@ NCDHW
Num samples, channels, depth, height, width.
arm_compute::DataLayout::NHWC
@ NHWC
Num samples, height, width, channels.
arm_compute::BorderMode::UNDEFINED
@ UNDEFINED
Borders are left undefined.
arm_compute::GPUTarget::G51BIG
@ G51BIG
AclHostPtr
@ AclHostPtr
Host allocated memory.
Definition: AclTypes.h:188
arm_compute::DataLayoutDimension
DataLayoutDimension
[DataLayout enum definition]
Definition: CoreTypes.h:121
arm_compute::FFTDirection::Inverse
@ Inverse
arm_compute::vquantize_internal
int32x4x4_t vquantize_internal(const float32x4x4_t &qv, float scale, int32_t offset)
Definition: NEAsymm.h:634
arm_compute::ACL_INT_0
@ ACL_INT_0
Definition: Types.h:63
arm_compute::test::validation::weights_info
weights_info
Definition: BatchNormalizationLayer.cpp:165
arm_compute::ACL_UNKNOWN
@ ACL_UNKNOWN
Definition: Types.h:40
arm_compute::SamplingPolicy::TOP_LEFT
@ TOP_LEFT
Samples are taken at pixel top left corner.
arm_compute::InterpolationPolicy::AREA
@ AREA
Output values are determined by averaging the source pixels whose areas fall under the area of the de...
arm_compute::DataType::QASYMM8
@ QASYMM8
quantized, asymmetric fixed-point 8-bit number unsigned
arm_compute::ComparisonOperation::Greater
@ Greater
Greater comparison ( )
arm_compute::WeightFormat::OHWIo32i4_bf16
@ OHWIo32i4_bf16
arm_compute::error_on_unsupported_fp16
arm_compute::Status error_on_unsupported_fp16(const char *function, const char *file, const int line, const ITensorInfo *tensor_info, bool is_fp16_supported)
Return an error if the data type of the passed tensor info is FP16 and FP16 extension is not supporte...
Definition: Validate.h:966
arm_compute::DetectionOutputLayerCodeType::CORNER_SIZE
@ CORNER_SIZE
Use box centers and size.
arm_compute::support::cpp11::lowest
T lowest()
Definition: ToolchainSupport.h:278
arm_compute::has_holes
bool has_holes(const ITensorInfo &info, size_t dimension)
Check if the tensor has any holes.
Definition: Utils.cpp:33
arm_compute::string_from_format
const std::string & string_from_format(Format format)
Convert a tensor format into a string.
Definition: FormatUtils.cpp:31
arm_compute::CLVersion::CL30
@ CL30
arm_compute::WeightFormat::OHWIo32i2
@ OHWIo32i2
arm_compute::CLVersion::CL11
@ CL11
arm_compute::CLImage2DType::WriteOnly
@ WriteOnly
arm_compute::ACL_INT_2
@ ACL_INT_2
Definition: Types.h:65
AclSuccess
@ AclSuccess
Call succeeded, leading to valid state for all involved objects/data.
Definition: AclTypes.h:52
ARM_COMPUTE_ERROR_ON_LOC_MSG
#define ARM_COMPUTE_ERROR_ON_LOC_MSG(cond, func, file, line,...)
Definition: Error.h:458
arm_compute::to_string
std::string to_string(const arm_compute::ScatterInfo &info)
Formatted output of the arm_compute::ScatterInfo type.
Definition: TypePrinter.h:3686
arm_compute::ACL_SHIFTS
@ ACL_SHIFTS
Definition: Types.h:79
dl
DataLayout dl
Definition: NEFuseBatchNormalizationKernel.cpp:50
quantize
void quantize(Tensor &qt, const Tensor &t, float min, float max)
Definition: neon_gemm_s8_f32.cpp:47
ARM_COMPUTE_ERROR_VAR
#define ARM_COMPUTE_ERROR_VAR(msg,...)
Print the given message then throw an std::runtime_error.
Definition: Error.h:348
AclPreferFastStart
@ AclPreferFastStart
Prioritize performance when a single iterations is expected to be performed.
Definition: AclTypes.h:74
arm_compute::WeightFormat::OHWIo4i4
@ OHWIo4i4
arm_compute::DataType::QSYMM8
@ QSYMM8
quantized, symmetric fixed-point 8-bit number
DetectionWindow::height
ushort height
Height of the detection window.
Definition: types.h:52
DetectionWindow::x
ushort x
Top-left x coordinate.
Definition: types.h:49
arm_compute::ConvolutionMethod::INDIRECT
@ INDIRECT
Indirect convolution.
arm_compute::ActivationFunction::LOGISTIC
@ LOGISTIC
Logistic ( )
arm_compute::TensorInfo::valid_region
ValidRegion valid_region() const override
Valid region of the tensor.
Definition: TensorInfo.h:291
arm_compute::DEPTHWISE
@ DEPTHWISE
Depthwise CL kernel type.
Definition: CLTypes.h:81
arm_compute::WeightFormat::OHWIo2
@ OHWIo2
arm_compute::TensorInfo::data_layout
DataLayout data_layout() const override
Get the data layout of the tensor.
Definition: TensorInfo.h:303
arm_compute::MatMulKernelInfo::adj_rhs
bool adj_rhs
Get Adjoint RHS flag value.
Definition: KernelDescriptors.h:246
arm_compute::WeightFormat::OHWIo64i8
@ OHWIo64i8
AclUnsupportedConfig
@ AclUnsupportedConfig
Call failed as configuration is unsupported.
Definition: AclTypes.h:59
arm_compute::test::validation::sampling_policy
sampling_policy
Definition: Scale.cpp:250
ARM_COMPUTE_ERROR
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
Definition: Error.h:354
arm_compute::wrapper::vinv
float32x2_t vinv(const float32x2_t &a)
Definition: inv.h:48
arm_compute::scaled_dimensions
std::pair< unsigned int, unsigned int > scaled_dimensions(int width, int height, int kernel_width, int kernel_height, const PadStrideInfo &pad_stride_info, const Size2D &dilation=Size2D(1U, 1U))
Returns expected width and height of output scaled tensor depending on dimensions rounding mode.
Definition: Utils.cpp:288
arm_compute::has_format_vertical_subsampling
bool has_format_vertical_subsampling(Format format)
Return true if the given format has vertical subsampling.
Definition: Validate.h:318
AclInvalidObjectState
@ AclInvalidObjectState
Call failed as an object has invalid state.
Definition: AclTypes.h:60
arm_compute::CPUInfo::get
static CPUInfo & get()
Access the KernelLibrary singleton.
Definition: CPPTypes.cpp:41
arm_compute::set_wbsm
void set_wbsm(cl::Kernel &kernel, cl_int wbsm_hint)
Definition: CLHelpers.cpp:441
arm_compute::image2d_from_buffer_supported
bool image2d_from_buffer_supported(const cl::Device &device)
Helper function to check whether the cl_khr_image2d_from_buffer extension is supported.
Definition: CLHelpers.cpp:377
arm_compute::WeightFormat::OHWIo8i2
@ OHWIo8i2
arm_compute::Status::error_description
std::string error_description() const
Gets error description if any.
Definition: Error.h:96
arm_compute::Channel::Y
@ Y
Luma channel.
arm_compute::error_on_mismatching_quantization_info
arm_compute::Status error_on_mismatching_quantization_info(const char *function, const char *file, const int line, const ITensorInfo *tensor_info_1, const ITensorInfo *tensor_info_2, Ts... tensor_infos)
Return an error if the passed tensor infos have different asymmetric quantized data types or differen...
Definition: Validate.h:695
arm_compute::CpuMatMulSettings::fixed_format
bool fixed_format() const
Definition: NEMatMul.h:45
arm_compute::CLGEMMKernelType::NATIVE
@ NATIVE
Native GEMM kernel with configurable block size.
arm_compute::DimensionRoundingType::CEIL
@ CEIL
Ceil rounding.
arm_compute::ACL_SRC_3
@ ACL_SRC_3
Definition: Types.h:48
acl::ExecutionMode::FastRerun
@ FastRerun
Prefer minimum latency in consecutive runs, might introduce higher startup times.
arm_compute::WINOGRAD
@ WINOGRAD
Winograd CL kernel type.
Definition: CLTypes.h:86
arm_compute::test::colorconvert_helper::detail::yuyv_to_rgb_calculation
void yuyv_to_rgb_calculation(const SimpleTensor< T > yvec, const SimpleTensor< T > vvec, const SimpleTensor< T > yyvec, const SimpleTensor< T > uvec, SimpleTensor< T > &dst)
Definition: ColorConvertHelper.h:159
arm_compute::string_from_data_type
const std::string & string_from_data_type(DataType dt)
Convert a data type identity into a string.
Definition: DataTypeUtils.cpp:31
arm_compute::test::validation::idx_width
const int idx_width
Definition: Scale.cpp:262
arm_compute::wrapper::vloadq
uint8x16_t vloadq(const uint8_t *ptr)
Definition: load.h:58
arm_compute::ACL_SRC_0
@ ACL_SRC_0
Definition: Types.h:45
arm_compute::wrap_around
T wrap_around(T x, T m)
Wrap-around a number within the range 0 <= x < m.
Definition: Helpers.h:277
arm_compute::ReductionOperation::MEAN_SUM
@ MEAN_SUM
Mean of sum.
arm_compute::GPUTarget::G715
@ G715
acl::StatusCode::UnsupportedConfig
@ UnsupportedConfig
arm_compute::get_target_from_name
GPUTarget get_target_from_name(const std::string &device_name)
Helper function to get the GPU target from a device name.
Definition: GPUTarget.cpp:188
arm_compute::ACL_SRC_6
@ ACL_SRC_6
Definition: Types.h:51
caffe_mnist_image_extractor.str
str
Definition: caffe_mnist_image_extractor.py:21
arm_compute::DIV_CEIL
constexpr auto DIV_CEIL(S val, T m) -> decltype((val+m - 1)/m)
Calculate the rounded up quotient of val / m.
Definition: Math.h:37
acl::DataType
DataType
Definition: Acl.hpp:482
arm_compute::ACL_SRC_END
@ ACL_SRC_END
Definition: Types.h:52
arm_compute::MatMulKernelInfo::m0
int m0
Number of output rows processed by each work-item.
Definition: KernelDescriptors.h:247
arm_compute::ACL_SRC_1
@ ACL_SRC_1
Definition: Types.h:46
arm_compute::ACL_INT_4
@ ACL_INT_4
Definition: Types.h:67
arm_compute::ActivationFunction::SOFT_RELU
@ SOFT_RELU
Soft Rectifier ( )
arm_compute::quantization::rounding_divide_by_pow2
int32_t rounding_divide_by_pow2(int32_t x, int exponent)
Round to the nearest division by a power-of-two using exponent, copied from NEMath.
Definition: AsymmHelpers.cpp:260
arm_compute::Channel::G
@ G
Green channel.
arm_compute::BilinearInterpolation::BILINEAR_OLD_NEW
@ BILINEAR_OLD_NEW
Old-new method.
arm_compute::ActivationFunction::BOUNDED_RELU
@ BOUNDED_RELU
Upper Bounded Rectifier ( )
arm_compute::DataType::S8
@ S8
signed 8-bit number
arm_compute::ActivationFunction::TANH
@ TANH
Hyperbolic tangent ( )
arm_compute::error_on_data_type_channel_not_in
arm_compute::Status error_on_data_type_channel_not_in(const char *function, const char *file, const int line, const ITensor *tensor, size_t num_channels, T &&dt, Ts &&...dts)
Return an error if the data type or the number of channels of the passed tensor does not match any of...
Definition: Validate.h:936
arm_compute::ElementWiseUnary::RSQRT
@ RSQRT
Reverse square root.
arm_compute::support::cpp11::snprintf
int snprintf(char *s, std::size_t n, const char *fmt, Ts &&...args)
Loads the data from the given location, converts them to character string equivalents and writes the ...
Definition: ToolchainSupport.h:270
ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(...)
Definition: Validate.h:677
arm_compute::WeightFormat::OHWI
@ OHWI
arm_compute::wrapper::vpow
float32x4_t vpow(const float32x4_t &a, const float32x4_t &b)
Definition: pow.h:41
arm_compute::DataLayoutDimension::WIDTH
@ WIDTH
width
ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN
#define ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(t, c,...)
Definition: Validate.h:952
arm_compute::ACL_SRC_2
@ ACL_SRC_2
Definition: Types.h:47
arm_compute::WeightFormat::OHWIo32i8
@ OHWIo32i8
AclOutOfMemory
@ AclOutOfMemory
Call failed due to failure to allocate resources.
Definition: AclTypes.h:54
arm_compute::cpu::data_layout
constexpr auto data_layout
Definition: impl.h:36
arm_compute::DataType::QSYMM16
@ QSYMM16
quantized, symmetric fixed-point 16-bit number
arm_compute::Format::UV88
@ UV88
2 channel, 1 U8 per channel
arm_compute::Format::S64
@ S64
1 channel, 1 S64 per channel
arm_compute::WeightFormat::OHWIo32
@ OHWIo32
arm_compute::ArithmeticOperation::POWER
@ POWER
x ^ y
arm_compute::GPUTarget::G615
@ G615
arm_compute::compute_strides
Strides compute_strides(const ITensorInfo &info)
Create a strides object based on the tensor dimensions.
Definition: Utils.h:63
arm_compute::CLTunerMode::EXHAUSTIVE
@ EXHAUSTIVE
Searches all possible LWS configurations while tuning.
arm_compute::test::validation::valid_region
const ValidRegion valid_region
Definition: Scale.cpp:214
arm_compute::GPUTarget::GPU_GENERATION_MASK
@ GPU_GENERATION_MASK
arm_compute::GPUTarget::G310
@ G310
output_stage
const OutputStage & output_stage
Definition: working_space.hpp:107
ARM_COMPUTE_RETURN_ON_ERROR
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
Definition: Error.h:205
arm_compute::ScaleKernelInfo::data_layout
DataLayout data_layout
Data layout to use.
Definition: KernelDescriptors.h:234
arm_compute::convert_float32x4x4_to_int8x16
void convert_float32x4x4_to_int8x16(const float32x4x4_t &in, int8x16_t &out)
Converts from float32x4x4_t to just one int8x16_t.
Definition: NEMath.inl:502
arm_compute::FFTDirection::Forward
@ Forward
arm_compute::GEMMLowpOutputStageType::QUANTIZE_DOWN
@ QUANTIZE_DOWN
Quantize using an integer multiplication.
arm_compute::DetectionOutputLayerCodeType::CORNER
@ CORNER
Use box corners.
arm_compute::GPUTarget::BIFROST
@ BIFROST
arm_compute::DataLayoutDimension::DEPTH
@ DEPTH
depth
arm_compute::CLTunerMode::NORMAL
@ NORMAL
Searches a subset of LWS configurations while tuning.
arm_compute::detail::for_each_error
arm_compute::Status for_each_error(F &&func, T &&arg, Ts &&...args)
Definition: Validate.h:114
arm_compute::CLBackendType::Clvk
@ Clvk
CLVK backend.
arm_compute::test::validation::act_info
act_info
Definition: DirectConvolutionLayer.cpp:547
arm_compute::ACL_DST_2
@ ACL_DST_2
Definition: Types.h:58
arm_compute::RoundingPolicy::TO_NEAREST_UP
@ TO_NEAREST_UP
Rounds to nearest value; half rounds away from zero.
arm_compute::convert_uint8x16_to_float32x4x4
float32x4x4_t convert_uint8x16_to_float32x4x4(const uint8x16_t &in)
Converts from uint8x16 to float32x4x4_t.
Definition: NEMath.inl:448
arm_compute::ElementWiseUnary::SIN
@ SIN
Sine.
arm_compute::ErrorCode::RUNTIME_ERROR
@ RUNTIME_ERROR
Generic runtime error.
arm_compute::ScatterFunction::Max
@ Max
arm_compute::DIRECT
@ DIRECT
Direct Convolution CL kernel type.
Definition: CLTypes.h:82
ARM_COMPUTE_ERROR_ON_NULLPTR
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
Definition: Validate.h:159
arm_compute::GPUTarget::G78AE
@ G78AE
arm_compute::half
half_float::half half
16-bit floating point type
Definition: CoreTypes.h:36
arm_compute::ACL_SRC_5
@ ACL_SRC_5
Definition: Types.h:50
arm_compute::MatMulKernelInfo::k0
int k0
Number of inner accumulations.
Definition: KernelDescriptors.h:249
arm_compute::utils::cast::U
U
Definition: SaturateCast.h:65
arm_compute::ElementWiseUnary::ABS
@ ABS
Absolute value.
arm_compute::ImportMemoryType::HostPtr
@ HostPtr
arm_compute::ITensor::info
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
arm_compute::test::validation::shape
shape
Definition: DFT.cpp:115
arm_compute::WeightFormat::OHWIo64
@ OHWIo64
ARM_COMPUTE_ERROR_ON
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Definition: Error.h:466
arm_compute::ConvertPolicy::WRAP
@ WRAP
Wrap around.
arm_compute::ScatterFunction::Sub
@ Sub
arm_compute::error_on_mismatching_shapes
arm_compute::Status error_on_mismatching_shapes(const char *function, const char *file, const int line, const ITensorInfo *tensor_info_1, const ITensorInfo *tensor_info_2, Ts... tensor_infos)
Return an error if the passed two tensor infos have different shapes from the given dimension.
Definition: Validate.h:475
clGetPlatformIDs
cl_int clGetPlatformIDs(cl_uint num_entries, cl_platform_id *platforms, cl_uint *num_platforms)
Definition: OpenCL.cpp:969
arm_compute::ComparisonOperation::Less
@ Less
Less comparison ( )
SQUARED_DIFF
#define SQUARED_DIFF(x, y)
Definition: elementwise_operation_quantized.cl:30
arm_compute::get_layout_map
const std::map< DataLayout, std::vector< DataLayoutDimension > > & get_layout_map()
Returns a static map used to find an index or dimension based on a data layout.
Definition: Helpers.cpp:107
arm_compute::WeightFormat::OHWIo4i8
@ OHWIo4i8
arm_compute::WeightFormat::OHWIo16i8
@ OHWIo16i8
arm_compute::GPUTarget::G51
@ G51
arm_compute::data_layout_from_name
arm_compute::DataLayout data_layout_from_name(const std::string &name)
Converts a string to a strong types enumeration DataLayout.
Definition: TypeLoader.cpp:32
quantize_qasymm8
uchar quantize_qasymm8(float input, float offset, float scale)
Quantize a floating-point scalar value to 8-bit asymmetric.
Definition: helpers_asymm.h:47
arm_compute::WeightFormat::OHWIo2i8
@ OHWIo2i8
arm_compute::WeightFormat::OHWIo64i2
@ OHWIo64i2
Coordinates2D::x
int x
The x coordinate.
Definition: types.h:30
arm_compute::CPUInfo::has_bf16
bool has_bf16() const
Checks if the cpu model supports bf16.
Definition: CPPTypes.cpp:64
arm_compute::ACL_DST_0
@ ACL_DST_0
Definition: Types.h:56
arm_compute::test::validation::ss
std::stringstream ss(mlgo_str)
arm_compute::wrapper::vmul
uint8x8_t vmul(const uint8x8_t &a, const uint8x8_t &b)
Definition: mul.h:39
arm_compute::GPUTarget::G52
@ G52
arm_compute::ReductionOperation::SUM_SQUARE
@ SUM_SQUARE
Sum of squares.
arm_compute::Channel::B
@ B
Blue channel.
arm_compute::execute_window_loop
void execute_window_loop(const Window &w, L &&lambda_function, Ts &&...iterators)
Iterate through the passed window, automatically adjusting the iterators and calling the lambda_funct...
Definition: Helpers.inl:74
AclInvalidTarget
@ AclInvalidTarget
Call failed as invalid argument was passed.
Definition: AclTypes.h:57
arm_compute::PaddingMode::REFLECT
@ REFLECT
arm_compute::DetectionOutputLayerCodeType::TF_CENTER
@ TF_CENTER
Use box centers and size but flip x and y co-ordinates.
arm_compute::error_on_unsupported_cpu_bf16
Status error_on_unsupported_cpu_bf16(const char *function, const char *file, const int line, const ITensorInfo *tensor_info)
Return an error if the data type of the passed tensor info is BFLOAT16 and BFLOAT16 support is not co...
Definition: Validate.h:66
arm_compute::CLImage2DType::ReadOnly
@ ReadOnly
arm_compute::WeightFormat::OHWIo8i2_bf16
@ OHWIo8i2_bf16
arm_compute::ActivationFunction::LEAKY_RELU
@ LEAKY_RELU
Leaky Rectifier ( )
arm_compute::DataLayoutDimension::HEIGHT
@ HEIGHT
height
arm_compute::CPUInfo::has_fp16
bool has_fp16() const
Checks if the cpu model supports fp16.
Definition: CPPTypes.cpp:59
arm_compute::quantize_qasymm8_signed
int8_t quantize_qasymm8_signed(float value, const INFO_TYPE &qinfo, RoundingPolicy rounding_policy=RoundingPolicy::TO_NEAREST_UP)
Quantize a value given a signed 8-bit asymmetric quantization scheme.
Definition: QuantizationInfo.h:323
ARM_COMPUTE_ERROR_ON_MSG
#define ARM_COMPUTE_ERROR_ON_MSG(cond, msg)
Definition: Error.h:456
ARM_COMPUTE_RETURN_ERROR_ON
#define ARM_COMPUTE_RETURN_ERROR_ON(cond)
If the condition is true, an error is returned.
Definition: Error.h:298
arm_compute::ACL_INT_1
@ ACL_INT_1
Definition: Types.h:64
arm_compute::PoolingType::AVG
@ AVG
Average Pooling.
arm_compute::ACL_SRC_4
@ ACL_SRC_4
Definition: Types.h:49
dequantize_qasymm8
float dequantize_qasymm8(uchar input, float offset, float scale)
Dequantize a scalar value from 8-bit asymmetric to floating-point.
Definition: helpers_asymm.h:62
arm_compute::ActivationFunction::IDENTITY
@ IDENTITY
Identity ( )
arm_compute::ACL_DST
@ ACL_DST
Definition: Types.h:55
arm_compute::BitwiseOperation::AND
@ AND
Bitwise AND operation.
acl::StatusCode::InvalidArgument
@ InvalidArgument
arm_compute::test::validation::w
SimpleTensor< float > w
Definition: DFT.cpp:156
arm_compute::is_data_type_quantized_asymmetric_signed
bool is_data_type_quantized_asymmetric_signed(DataType dt)
Check if a given data type is of asymmetric quantized signed type.
Definition: DataTypeUtils.h:365
__CASE_WEIGHT_FORMAT
#define __CASE_WEIGHT_FORMAT(wf)
arm_compute::mlgo::parser::gemm_type
GEMMType gemm_type(TokenStream &in, bool &valid)
Definition: MLGOParser.cpp:560
arm_compute::WeightFormat::OHWIo16i2_bf16
@ OHWIo16i2_bf16
arm_compute::WeightFormat::OHWIo4i2
@ OHWIo4i2
arm_compute::MappingType::OFFSETS
@ OFFSETS
Mappings are in offset granularity in the same blob.
arm_compute::round
int round(float x, RoundingPolicy rounding_policy)
Return a rounded value of x.
Definition: Rounding.cpp:36
arm_compute::GPUTarget::G77
@ G77
arm_compute::ErrorCode::OK
@ OK
No error.
ARM_COMPUTE_CPU_MODEL_LIST
#define ARM_COMPUTE_CPU_MODEL_LIST
Definition: CPPTypes.h:38
arm_compute::MatMulInfo::adj_lhs
bool adj_lhs() const
Definition: MatMulInfo.h:35
arm_compute::QuantizationInfo::scale
const std::vector< float > & scale() const
Scale vector accessor.
Definition: QuantizationInfo.h:120
arm_compute::Status
Status class.
Definition: Error.h:52
arm_compute::FuseBatchNormalizationType::CONVOLUTION
@ CONVOLUTION
For Convolution weights.
arm_compute::wrapper::vcombine
uint8x16_t vcombine(const uint8x8_t &a, const uint8x8_t &b)
Definition: combine.h:39
arm_compute::DataType::QASYMM8_SIGNED
@ QASYMM8_SIGNED
quantized, asymmetric fixed-point 8-bit number signed
arm_compute::test::validation::scale_y
const float scale_y
Definition: Scale.cpp:260
acl::StatusCode::InvalidTarget
@ InvalidTarget
arm_compute::Channel::C1
@ C1
Second channel (used by formats with unknown channel types).
arm_compute::dequantize_qasymm16
float dequantize_qasymm16(uint16_t value, const QuantizationInfo &qinfo)
Dequantize a value given a 16-bit asymmetric quantization scheme.
Definition: QuantizationInfo.h:561
arm_compute::BorderMode::REPLICATE
@ REPLICATE
Pixels outside the image are assumed to have the same value as the closest image pixel.
arm_compute::GPUTarget::G510
@ G510
arm_compute::ComparisonOperation::NotEqual
@ NotEqual
NotEqual comparison ( )
arm_compute::WeightFormat::OHWIo16i4
@ OHWIo16i4
arm_compute::WeightFormat::OHWIo64i4
@ OHWIo64i4
arm_compute::ConvertPolicy::SATURATE
@ SATURATE
Saturate.
arm_compute::float_to_string_with_full_precision
std::string float_to_string_with_full_precision(float val)
Create a string with the float in full precision.
Definition: StringUtils.cpp:52
arm_compute::CLTunerMode::RAPID
@ RAPID
Searches a minimal subset of LWS configurations while tuning.
arm_compute::gpu_target_is_in
bool gpu_target_is_in(GPUTarget target_to_check, GPUTarget target)
Variant of gpu_target_is_in for comparing two targets.
Definition: GPUTarget.h:115
arm_compute::DepthwiseConvolutionFunction::OPTIMIZED
@ OPTIMIZED
Optimized Depthwise Convolution.
arm_compute::ConvolutionMethod::GEMM_CONV2D
@ GEMM_CONV2D
Direct 2D GEMM convolution.
arm_compute::Format::IYUV
@ IYUV
A 3 plane of 8-bit 4:2:0 sampled Y, U, V planes.
AclPreferFastRerun
@ AclPreferFastRerun
Prioritize performance when multiple iterations are performed.
Definition: AclTypes.h:73
name
const char * name
Definition: NEBatchNormalizationLayerKernel.cpp:66
offset
__global uchar * offset(const Image *img, int x, int y)
Get the pointer position of a Image.
Definition: helpers.h:1142
arm_compute::ACL_MULTIPLIERS
@ ACL_MULTIPLIERS
Definition: Types.h:80
arm_compute::Dimensions::x
T x() const
Alias to access the size of the first dimension.
Definition: Dimensions.h:86
arm_compute::Format::RGBA8888
@ RGBA8888
4 channels, 1 U8 per channel
arm_compute::ScatterFunction::Add
@ Add
arm_compute::WeightFormat::OHWIo4i4_bf16
@ OHWIo4i4_bf16
arm_compute::FuseBatchNormalizationType::DEPTHWISECONVOLUTION
@ DEPTHWISECONVOLUTION
For Depthwise Convolution weights.
arm_compute::test::validation::reference::accumulate
SimpleTensor< T2 > accumulate(const SimpleTensor< T1 > &src, DataType output_data_type)
Definition: Accumulate.cpp:38
arm_compute::BitwiseOperation::XOR
@ XOR
Bitwise XOR operation
arm_compute::WeightFormat::OHWIo128
@ OHWIo128
arm_compute::dequantize
float dequantize(int32_t value, float scale, int32_t offset)
Dequantize a value given a 32-bit asymmetric quantization scheme.
Definition: QuantizationInfo.h:455
ARM_COMPUTE_ERROR_ON_LOC
#define ARM_COMPUTE_ERROR_ON_LOC(cond, func, file, line)
If the condition is true then an error message is printed and an exception thrown.
Definition: Error.h:475
arm_compute::WeightFormat::OHWIo8i4_bf16
@ OHWIo8i4_bf16
ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG_VAR
#define ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG_VAR(cond, func, file, line, msg,...)
If the condition is true, an error is thrown.
Definition: Error.h:265
arm_compute::QuantizationInfo::uniform
UniformQuantizationInfo uniform() const
Return per layer quantization info.
Definition: QuantizationInfo.h:152
ADD
#define ADD(x, y)
Definition: elementwise_operation_quantized.cl:27
arm_compute::WeightFormat::OHWIo16i4_bf16
@ OHWIo16i4_bf16
arm_compute::ElementWiseUnary::NEG
@ NEG
Negate.
arm_compute::ActivationFunction::SQUARE
@ SQUARE
Square ( )
arm_compute::WeightFormat::OHWIo64i4_bf16
@ OHWIo64i4_bf16
arm_compute::DeviceType::NEON
@ NEON
arm_compute::ReductionOperation::ARG_IDX_MAX
@ ARG_IDX_MAX
Index of the max value.
arm_compute::Channel::C0
@ C0
Unknown channel format.
arm_compute::NormType::IN_MAP_2D
@ IN_MAP_2D
Normalization applied within the same map in 2D region.
acl::StatusCode::UnsupportedTarget
@ UnsupportedTarget
arm_compute::Channel::C2
@ C2
Third channel (used by formats with unknown channel types).
DetectionWindow::score
float score
Confidence value for the detection window.
Definition: types.h:54
arm_compute::wrapper::vmla
uint8x8_t vmla(const uint8x8_t &a, const uint8x8_t &b, const uint8x8_t &c)
Definition: mla.h:46
arm_compute::test::validation::pack
ITensorPack pack
Definition: Im2Col.cpp:188
ARM_COMPUTE_UNUSED
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
Definition: Error.h:151
AclRuntimeError
@ AclRuntimeError
Call failed during execution.
Definition: AclTypes.h:53
dt
DataType dt
Definition: NEBatchNormalizationLayerKernel.cpp:50
arm_compute::WeightFormat::OHWIo8
@ OHWIo8
tensor
CLTensor * tensor
Pointer to the auxiliary tensor.
Definition: ClWorkloadRuntime.cpp:67
arm_compute::test::validation::context
auto context
Definition: DirectConv2d.cpp:167
arm_compute::ACL_SRC_VEC
@ ACL_SRC_VEC
Definition: Types.h:68
arm_compute::GPUTarget::MIDGARD
@ MIDGARD
arm_compute::error_on_data_type_not_in
arm_compute::Status error_on_data_type_not_in(const char *function, const char *file, const int line, const ITensorInfo *tensor_info, T &&dt, Ts &&...dts)
Return an error if the data type of the passed tensor info does not match any of the data types provi...
Definition: Validate.h:801
arm_compute::test::validation::scale_x
const float scale_x
Definition: Scale.cpp:259
arm_compute::Format::U8
@ U8
1 channel, 1 U8 per channel
arm_compute::CLScheduler::get
static CLScheduler & get()
Access the scheduler singleton.
Definition: CLScheduler.cpp:112
arm_compute::GEMMLowpOutputStageType::NONE
@ NONE
No quantization.
acl::StatusCode::InvalidObjectState
@ InvalidObjectState
arm_compute::error_on_unsupported_cpu_fp16
Status error_on_unsupported_cpu_fp16(const char *function, const char *file, const int line, const ITensorInfo *tensor_info)
Return an error if the data type of the passed tensor info is FP16 and FP16 support is not compiled i...
Definition: Validate.h:42
MAX
#define MAX(x, y)
Definition: elementwise_operation_quantized.cl:28
arm_compute::WeightFormat::UNSPECIFIED
@ UNSPECIFIED
arm_compute::InterpolationPolicy::BILINEAR
@ BILINEAR
Output values are defined by bilinear interpolation between the pixels.
arm_compute::Format
Format
Image colour formats.
Definition: CoreTypes.h:58
clCreateImage
cl_mem clCreateImage(cl_context context, cl_mem_flags flags, const cl_image_format *image_format, const cl_image_desc *image_desc, void *host_ptr, cl_int *errcode_ret)
Definition: OpenCL.cpp:1056
arm_compute::test::validation::data_type
data_type
Definition: Cast.cpp:222
arm_compute::ceil_to_multiple
auto ceil_to_multiple(S value, T divisor) -> decltype(((value+divisor - 1)/divisor) *divisor)
Computes the smallest number larger or equal to value that is a multiple of divisor.
Definition: Math.h:50
arm_compute::GPUTarget::G68
@ G68
arm_compute::dequantize_s32
float dequantize_s32(int32_t value, const QuantizationInfo &qinfo)
Dequantize a value given a 32-bit asymmetric quantization scheme.
Definition: QuantizationInfo.h:586
arm_compute::Format::S32
@ S32
1 channel, 1 S32 per channel
arm_compute::test::validation::input_shape
TensorShape input_shape
Validate test suite is to test ARM_COMPUTE_RETURN_ON_* macros we use to check the validity of given a...
Definition: LSTMLayerQuantized.cpp:466
arm_compute::GPUTarget::G710
@ G710
arm_compute::Format::YUYV422
@ YUYV422
A single plane of 32-bit macro pixel of Y0, U0, Y1, V0 bytes.
AclInvalidArgument
@ AclInvalidArgument
Call failed as invalid argument was passed.
Definition: AclTypes.h:58
ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_QUANTIZATION_INFO
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_QUANTIZATION_INFO(...)
Definition: Validate.h:753
arm_compute::string_from_data_layout
const std::string & string_from_data_layout(DataLayout dl)
Convert a data layout identity into a string.
Definition: DataLayoutUtils.cpp:30
arm_compute::LogicalOperation::Or
@ Or
Logical Or ||.
acl::StatusCode::RuntimeError
@ RuntimeError
arm_compute::GPUTarget
GPUTarget
Available GPU Targets.
Definition: GPUTarget.h:34
ARM_COMPUTE_ERROR_LOC
#define ARM_COMPUTE_ERROR_LOC(func, file, line, msg)
Print the given message then throw an std::runtime_error.
Definition: Error.h:375
arm_compute::ACL_INT
@ ACL_INT
Definition: Types.h:62
arm_compute::GPUTarget::G52LIT
@ G52LIT
arm_compute::MatMulKernelInfo::adj_lhs
bool adj_lhs
Get Adjoint LHS flag value.
Definition: KernelDescriptors.h:245
arm_compute::Format::YUV444
@ YUV444
A 3 plane of 8 bit 4:4:4 sampled Y, U, V planes.
arm_compute::ScatterFunction::Min
@ Min
arm_compute::Format::UYVY422
@ UYVY422
A single plane of 32-bit macro pixel of U0, Y0, V0, Y1 byte.
arm_compute::convert_float32x4x4_to_uint8x16
void convert_float32x4x4_to_uint8x16(const float32x4x4_t &in, uint8x16_t &out)
Converts from two float32x4x4_t to just one uint8x16_t.
Definition: NEMath.inl:495
arm_compute::get_data_layout_dimension_index
size_t get_data_layout_dimension_index(const DataLayout &data_layout, const DataLayoutDimension &data_layout_dimension)
Get the index of the given dimension.
Definition: Helpers.inl:201
DetectionWindow::y
ushort y
Top-left y coordinate.
Definition: types.h:50
arm_compute::Channel::UNKNOWN
@ UNKNOWN
arm_compute::CLBackendType::Native
@ Native
OpenCL native backend.
arm_compute::DimensionRoundingType::FLOOR
@ FLOOR
Floor rounding.
arm_compute::UniformQuantizationInfo::scale
float scale
Definition: QuantizationInfo.h:62
AclGpuOcl
@ AclGpuOcl
OpenCL target for GPU.
Definition: AclTypes.h:67
arm_compute::CLScheduler::default_init
void default_init(ICLTuner *cl_tuner=nullptr, CLGEMMHeuristicsHandle *gemm_h=nullptr, CLBackendType cl_backend_type=CLBackendType::Native)
Initialises the context and command queue used by the scheduler to default values and sets a default ...
Definition: CLScheduler.cpp:134
arm_compute::GPUTarget::G76
@ G76
arm_compute::ScatterFunction::Update
@ Update
arm_compute::ReductionOperation::ARG_IDX_MIN
@ ARG_IDX_MIN
Index of the min value.
arm_compute::wrapper::vgetlow
uint8x8_t vgetlow(const uint8x16_t val)
Definition: getlow.h:39
arm_compute::qsymm16x8x2_t
int16x8x2_t qsymm16x8x2_t
16 bit quantized symmetric vector with 16 elements
Definition: NESymm.h:39
acl::Target::Cpu
@ Cpu
Cpu target that leverages SIMD.
arm_compute::DeviceType::CL
@ CL
MIN
#define MIN(x, y)
Definition: elementwise_operation_quantized.cl:29
arm_compute::CpuMatMulSettings::fast_math
bool fast_math() const
Definition: NEMatMul.h:40
ARM_COMPUTE_LOG_INFO_MSG_CORE
#define ARM_COMPUTE_LOG_INFO_MSG_CORE(msg)
Log information level message to the core system logger.
Definition: Log.h:87
arm_compute::Format::F32
@ F32
1 channel, 1 F32 per channel
arm_compute::tuner_mode_from_name
CLTunerMode tuner_mode_from_name(const std::string &name)
Converts a string to a strong types enumeration CLTunerMode.
Definition: CLTunerTypes.h:57
arm_compute::wrapper::vstore
void vstore(uint8_t *ptr, uint8x8_t val)
Definition: store.h:39
arm_compute::CLVersion::CL20
@ CL20
arm_compute::ValidRegion::shape
TensorShape shape
Shape of the valid region.
Definition: Types.h:223
arm_compute::WeightFormat::OHWIo32i2_bf16
@ OHWIo32i2_bf16
acl::ExecutionMode::FastStart
@ FastStart
Prefer minimizing startup time.
arm_compute::ELEMENTWISE
@ ELEMENTWISE
Elementwise CL kernel type.
Definition: CLTypes.h:83
arm_compute::error_on_mismatching_shapes
arm_compute::Status error_on_mismatching_shapes(const char *function, const char *file, const int line, unsigned int upper_dim, const ITensor *tensor_1, const ITensor *tensor_2, Ts... tensors)
Return an error if the passed two tensors have different shapes from the given dimension.
Definition: Validate.h:556
arm_compute::test::validation::b
SimpleTensor< float > b
Definition: DFT.cpp:157
arm_compute::device_supports_extension
bool device_supports_extension(const cl::Device &device, const char *extension_name)
Helper function to check whether a given extension is supported.
Definition: CLHelpers.cpp:285
arm_compute::ACL_INT_3
@ ACL_INT_3
Definition: Types.h:66
arm_compute::ACL_BIAS
@ ACL_BIAS
Definition: Types.h:74
arm_compute::Channel::A
@ A
Alpha channel.
arm_compute::ActivationFunction::LU_BOUNDED_RELU
@ LU_BOUNDED_RELU
Lower and Upper Bounded Rectifier ( )
arm_compute::has_format_horizontal_subsampling
bool has_format_horizontal_subsampling(Format format)
Return true if the given format has horizontal subsampling.
Definition: Validate.h:304
arm_compute::create_image2d_from_buffer
cl::Image2D create_image2d_from_buffer(const cl::Context &ctx, const cl::Buffer &buffer, const TensorShape &shape2d, DataType data_type, size_t image_row_pitch, CLImage2DType image_type)
Create a cl::Image2D object from an OpenCL buffer.
Definition: CLUtils.cpp:62
arm_compute::test::validation::scale
NEScale scale
Definition: Scale.cpp:272
arm_compute::CPUModel::GENERIC
@ GENERIC
arm_compute::ActivationFunction::RELU
@ RELU
Rectifier ( )
arm_compute::WeightFormat::OHWIo32i4
@ OHWIo32i4
DetectionWindow::idx_class
ushort idx_class
Index of the class.
Definition: types.h:53
arm_compute::Format::NV12
@ NV12
A 2 plane YUV format of Luma (Y) and interleaved UV data at 4:2:0 sampling.
arm_compute::NMSType::LINEAR
@ LINEAR
Linear NMS.
arm_compute::to_string
std::string to_string(const ClComponentElementwiseBinary::Attributes::ElementwiseOp &op)
Formatted output of the arm_compute::experimental::dynamic_fusion::ClComponentElementwiseBinary::Attr...
Definition: ElementwiseBinary.h:68
arm_compute::NMSType::ORIGINAL
@ ORIGINAL
Original NMS.
arm_compute::test::validation::conv_info
conv_info
Definition: DirectConvolutionLayer.cpp:547
arm_compute::PaddingMode::SYMMETRIC
@ SYMMETRIC
arm_compute::ACL_VEC_COL_SUM
@ ACL_VEC_COL_SUM
Definition: Types.h:78
arm_compute::BilinearInterpolation::BILINEAR_SCHARR
@ BILINEAR_SCHARR
Scharr method.
arm_compute::ElementWiseUnary::EXP
@ EXP
Exponential.
clang_tidy_rules.mode
mode
Definition: clang_tidy_rules.py:194
arm_compute::RoundingPolicy::TO_ZERO
@ TO_ZERO
Truncates the least significant values that are lost in operations.
arm_compute::UNKNOWN
@ UNKNOWN
Unknown CL kernel type.
Definition: CLTypes.h:80
arm_compute::error_on_mismatching_data_types
arm_compute::Status error_on_mismatching_data_types(const char *function, const char *file, const int line, const ITensorInfo *tensor_info, Ts... tensor_infos)
Return an error if the passed two tensor infos have different data types.
Definition: Validate.h:640
arm_compute::GPUTarget::GPU_ARCH_MASK
@ GPU_ARCH_MASK
arm_compute::DataType::SIZET
@ SIZET
size_t
arm_compute::Channel::R
@ R
Red channel.
arm_compute::is_data_type_float
bool is_data_type_float(DataType dt)
Check if a given data type is of floating point type.
Definition: DataTypeUtils.h:304
DIV
#define DIV(x, y)
Definition: elementwise_operation_quantized.cl:32
arm_compute::NormType::CROSS_MAP
@ CROSS_MAP
Normalization applied cross maps.
arm_compute::get_cl_image_pitch_alignment
size_t get_cl_image_pitch_alignment(const cl::Device &device)
Helper function to get the cl_image pitch alignment in pixels.
Definition: CLHelpers.cpp:382
arm_compute::CLGEMMKernelType::RESHAPED_ONLY_RHS_MMUL
@ RESHAPED_ONLY_RHS_MMUL
Reshaped GEMM kernel where only the rhs matrix is reshaped.
arm_compute::MatMulKernelInfo::export_rhs_to_cl_image
bool export_rhs_to_cl_image
Flag to know whether the RHS tensor should be exported to cl_image.
Definition: KernelDescriptors.h:250
arm_compute::ComparisonOperation::GreaterEqual
@ GreaterEqual
Greater equal comparison ( )
arm_compute::ITensorInfo::strides_in_bytes
virtual const Strides & strides_in_bytes() const =0
The strides in bytes for accessing each dimension of the tensor.
arm_compute::test::validation::src_info
TensorInfo src_info(src_shape, 1, data_type)
arm_compute::mlgo::parser::end
void end(TokenStream &in, bool &valid)
Definition: MLGOParser.cpp:283
arm_compute::CLGEMMKernelType::RESHAPED
@ RESHAPED
Reshaped GEMM kernel where both lhs and rhs matrices are reshaped.
arm_compute::is_data_type_quantized_asymmetric
bool is_data_type_quantized_asymmetric(DataType dt)
Check if a given data type is of asymmetric quantized type.
Definition: DataTypeUtils.h:346
arm_compute::Channel::U
@ U
Cb/U channel.
ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
Definition: Validate.h:161
arm_compute::WeightFormat::OHWIo16i2
@ OHWIo16i2
arm_compute::GPUTarget::G57
@ G57
arm_compute::IImage
ITensor IImage
Definition: ITensor.h:100
arm_compute::InterpolationPolicy::NEAREST_NEIGHBOR
@ NEAREST_NEIGHBOR
Output values are defined to match the source pixel whose center is nearest to the sample position.
arm_compute::Format::F16
@ F16
1 channel, 1 F16 per channel
arm_compute::BitwiseOperation::NOT
@ NOT
Bitwise NOT operation.
arm_compute::SamplingPolicy::CENTER
@ CENTER
Samples are taken at pixel center.
arm_compute::quantize_qsymm16
int16_t quantize_qsymm16(float value, const QuantizationInfo &qinfo)
Quantize a value given a 16-bit symmetric quantization scheme.
Definition: QuantizationInfo.h:496
arm_compute::is_data_type_quantized
bool is_data_type_quantized(DataType dt)
Check if a given data type is of quantized type.
Definition: DataTypeUtils.h:324
arm_compute::MappingType::BLOBS
@ BLOBS
Mappings are in blob granularity.
arm_compute::cpu::channel_idx
const size_t channel_idx
Definition: impl.h:39
arm_compute::DeconvolutionMethod::UPSCALE_CONV2D
@ UPSCALE_CONV2D
Deconvolution with Upscaling.
arm_compute::data_type_from_name
DataType data_type_from_name(const std::string &name)
Convert a string to DataType.
Definition: DataTypeUtils.cpp:58
arm_compute::ACL_INT_VEC
@ ACL_INT_VEC
Definition: Types.h:70
acl::StatusCode::Unimplemented
@ Unimplemented
arm_compute::select_preferable_platform
cl::Platform select_preferable_platform(CLBackendType cl_backend_type)
This function selects the OpenCL platform based on the backend type.
Definition: CLHelpers.cpp:84
arm_compute::ACL_SRC
@ ACL_SRC
Definition: Types.h:44
arm_compute::Format::S16
@ S16
1 channel, 1 S16 per channel
arm_compute::GPUTarget::G71
@ G71
arm_compute::MatMulInfo::adj_rhs
bool adj_rhs() const
Definition: MatMulInfo.h:40
arm_compute::DataLayoutDimension::BATCHES
@ BATCHES
batches
clSetKernelExecInfo
cl_int clSetKernelExecInfo(cl_kernel kernel, cl_kernel_exec_info param_name, size_t param_value_size, const void *param_value)
Definition: OpenCL.cpp:1080
arm_compute::DetectionOutputLayerCodeType::CENTER_SIZE
@ CENTER_SIZE
Use box centers and size.
arm_compute::WeightFormat::OHWIo4
@ OHWIo4
arm_compute::WeightFormat::OHWIo16
@ OHWIo16
ARM_COMPUTE_CREATE_ERROR_LOC
#define ARM_COMPUTE_CREATE_ERROR_LOC(error_code, func, file, line, msg)
Creates an error on location with a given message.
Definition: Error.h:169
arm_compute::CLVersion::CL12
@ CL12
arm_compute::cpu::width_idx
const size_t width_idx
Definition: impl.h:37
acl::StatusCode::OutOfMemory
@ OutOfMemory
arm_compute::GPUTarget::G51LIT
@ G51LIT
arm_compute::get_min_max
std::tuple< PixelValue, PixelValue > get_min_max(DataType dt)
Compute the mininum and maximum values a data type can take.
Definition: DataTypeUtils.h:195
arm_compute::PaddingMode::CONSTANT
@ CONSTANT
arm_compute::operator==
bool operator==(const UniformQuantizationInfo &lhs, const UniformQuantizationInfo &rhs)
Check whether two quantization info are equal.
Definition: QuantizationInfo.h:199
arm_compute::WeightFormat::OHWIo8i8
@ OHWIo8i8
arm_compute::test::validation::info
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
arm_compute::cpu::step
constexpr int step
Definition: fp32.cpp:35
arm_compute::BitwiseOperation::OR
@ OR
Bitwise OR operation
arm_compute::GPUTarget::T600
@ T600
arm_compute::CLGEMMKernelType::RESHAPED_ONLY_RHS
@ RESHAPED_ONLY_RHS
Reshaped GEMM kernel where only the rhs matrix is reshaped.
arm_compute::Format::BFLOAT16
@ BFLOAT16
16-bit brain floating-point number
arm_compute::TensorShape::set
TensorShape & set(size_t dimension, size_t value, bool apply_dim_correction=true, bool increase_dim_unit=true)
Accessor to set the value of one of the dimensions.
Definition: TensorShape.h:78
Coordinates2D::y
int y
The y coordinate.
Definition: types.h:31
arm_compute::Channel::C3
@ C3
Fourth channel (used by formats with unknown channel types).
ARM_COMPUTE_THROW
#define ARM_COMPUTE_THROW(ex)
Definition: Error.h:479
arm_compute::ActivationFunction::GELU
@ GELU
GELU ( )
arm_compute::utility::foldl
T && foldl(F &&, T &&value)
Base case of foldl.
Definition: Utility.h:133
arm_compute::Dimensions::y
T y() const
Alias to access the size of the second dimension.
Definition: Dimensions.h:91
arm_compute::LogicalOperation::Not
@ Not
Logical Not !
AclUnimplemented
@ AclUnimplemented
Call failed as requested capability is not implemented.
Definition: AclTypes.h:55
acl::StatusCode::Success
@ Success
arm_compute::utility::for_each
void for_each(F &&)
Base case of for_each.
Definition: Utility.h:111
arm_compute::MatMulKernelInfo::n0
int n0
Number of output columns processed by each work-item.
Definition: KernelDescriptors.h:248
acl::DataType::Unknown
@ Unknown
arm_compute::ActivationFunction::SQRT
@ SQRT
Square root ( )
arm_compute::LogicalOperation::And
@ And
Logical And &&.
arm_compute::GEMMLowpOutputStageType::QUANTIZE_DOWN_FIXEDPOINT
@ QUANTIZE_DOWN_FIXEDPOINT
Quantize using a fixed point multiplication.
arm_compute::Dimensions::num_dimensions
unsigned int num_dimensions() const
Returns the effective dimensionality of the tensor.
Definition: Dimensions.h:142
arm_compute::wrapper::vgethigh
uint8x8_t vgethigh(const uint8x16_t val)
Definition: gethigh.h:39
arm_compute::GEMM
@ GEMM
GEMM CL kernel type.
Definition: CLTypes.h:84
arm_compute::ElementWiseUnary::ROUND
@ ROUND
Round.
tensor_info
TensorInfo tensor_info
Associated tensor info.
Definition: ClWorkloadRuntime.cpp:68
arm_compute::ACL_DST_VEC
@ ACL_DST_VEC
Definition: Types.h:69
clGetDeviceInfo
cl_int clGetDeviceInfo(cl_device_id device, cl_device_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
Definition: OpenCL.cpp:904
arm_compute::Format::NV21
@ NV21
A 2 plane YUV format of Luma (Y) and interleaved VU data at 4:2:0 sampling.
arm_compute::ACL_VEC_ROW_SUM
@ ACL_VEC_ROW_SUM
Definition: Types.h:77
arm_compute::ElementWiseUnary::LOGICAL_NOT
@ LOGICAL_NOT
Logical Not.
update_supported_ops.format
format
Definition: update_supported_ops.py:405
ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG
#define ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG(cond, func, file, line, msg)
If the condition is true, an error is thrown.
Definition: Error.h:285
arm_compute::ActivationFunction::HARD_SWISH
@ HARD_SWISH
Hard-swish ( )
arm_compute::dequantize_qsymm16
float dequantize_qsymm16(int16_t value, const QuantizationInfo &qinfo)
Dequantize a value given a 16-bit symmetric quantization scheme.
Definition: QuantizationInfo.h:508
arm_compute::TensorInfo::tensor_shape
const TensorShape & tensor_shape() const override
Size for each dimension of the tensor.
Definition: TensorInfo.h:245
arm_compute::CLScheduler::context
cl::Context & context()
Accessor for the associated CL context.
Definition: CLScheduler.cpp:33
arm_compute::Dimensions< int >::num_max_dimensions
static constexpr size_t num_max_dimensions
Number of dimensions the tensor has.
Definition: Dimensions.h:46
arm_compute::ReductionOperation::SUM
@ SUM
Sum.
arm_compute::test::validation::qinfo
const QuantizationInfo qinfo
Definition: Im2Col.cpp:155
arm_compute::GPUTarget::G78
@ G78
SUB
#define SUB(x, y)
Definition: elementwise_operation_quantized.cl:26
arm_compute::test::validation::input
auto input
Definition: LSTMLayerQuantized.cpp:486
arm_compute::QuantizationInfo::offset
const std::vector< int32_t > & offset() const
Offset vector accessor.
Definition: QuantizationInfo.h:128
arm_compute::wrapper::vrev64
uint8x8_t vrev64(const uint8x8_t &a)
Definition: rev64.h:39
arm_compute::DataLayout::NDHWC
@ NDHWC
Num samples, depth, height, width, channels.
arm_compute::ValidRegion::anchor
Coordinates anchor
Anchor for the start of the valid region.
Definition: Types.h:222
arm_compute::ErrorCode::UNSUPPORTED_EXTENSION_USE
@ UNSUPPORTED_EXTENSION_USE
Unsupported extension used.
arm_compute::Format::U32
@ U32
1 channel, 1 U32 per channel
arm_compute::GPUTarget::G72
@ G72
arm_compute::error_on_nullptr
arm_compute::Status error_on_nullptr(const char *function, const char *file, const int line, Ts &&...pointers)
Create an error if one of the pointers is a nullptr.
Definition: Validate.h:151
arm_compute::ActivationFunction::ELU
@ ELU
Exponential Linear Unit ( )
arm_compute::wrapper::vdup_n
uint8x8_t vdup_n(uint8_t value, traits::vector_64_tag)
Definition: dup_n.h:41
arm_compute::ActivationFunction::SWISH
@ SWISH
Swish ( )
check_header_guards.extensions
extensions
Definition: check_header_guards.py:177
arm_compute::Format::U16
@ U16
1 channel, 1 U16 per channel
arm_compute::error_on_channel_not_in
arm_compute::Status error_on_channel_not_in(const char *function, const char *file, const int line, T cn, T &&channel, Ts &&...channels)
Return an error if the channel is not in channels.
Definition: Validate.h:1036
arm_compute::cpu::height_idx
const size_t height_idx
Definition: impl.h:38
kernel_name
std::string kernel_name
Definition: ClIm2ColKernel.cpp:58
arm_compute::ElementWiseUnary::LOG
@ LOG
Natural Logarithm.
ARM_COMPUTE_RETURN_ERROR_ON_LOC
#define ARM_COMPUTE_RETURN_ERROR_ON_LOC(cond, func, file, line)
If the condition is true, an error is returned.
Definition: Error.h:307