Compute Library
 23.08
IFunction Class Referenceabstract

Base class for all functions. More...

#include <IFunction.h>

Public Member Functions

virtual ~IFunction ()=default
 Destructor. More...
 
virtual void run ()=0
 Run the kernels contained in the function. More...
 
virtual void prepare ()
 Prepare the function for executing. More...
 

Detailed Description

Base class for all functions.

Definition at line 30 of file IFunction.h.

Constructor & Destructor Documentation

◆ ~IFunction()

virtual ~IFunction ( )
virtualdefault

Destructor.

Member Function Documentation

◆ prepare()

◆ run()

virtual void run ( )
pure virtual

Run the kernels contained in the function.

For CPU kernels:

  • Multi-threading is used for the kernels which are parallelisable.
  • By default std::thread::hardware_concurrency() threads are used.
Note
CPPScheduler::set_num_threads() can be used to manually set the number of threads

For OpenCL kernels:

  • All the kernels are enqueued on the queue associated with CLScheduler.
  • The queue is then flushed.
Note
The function will not block until the kernels are executed. It is the user's responsibility to wait.
Will call prepare() on first run if hasn't been done

Implemented in CLSynthetizeFunctionInitOutputWithZeroAndWithZeroConstantBorder< K, bordersize >, ICLSimpleFunction, INESimpleFunctionNoBorder, INESimpleFunction, ICPPSimpleFunction, CLElementwisePower, CLElementwiseSquaredDiff, CLElementwiseMin, NEElementwiseComparisonStatic< op >, CLRoundLayer, CLElementwiseMax, NEElementwiseComparison, CLAbsLayer, NEElementwisePower, CLArithmeticDivision, CLLogLayer, NEElementwiseDivision, CLSinLayer, CLArithmeticSubtraction, CLQLSTMLayer, CLLSTMLayer, NEElementwiseSquaredDiff, CLConvolutionLayer, CLNegLayer, NEQLSTMLayer, NEGEMMConvolutionLayer, NELogicalNot, CLComplexPixelWiseMultiplication, NEComplexPixelWiseMultiplication, NEConvolutionLayer, CLLSTMLayerQuantized, NELSTMLayer, NEFullyConnectedLayer, CLGEMMConvolutionLayer, NEElementwiseMin, CLDirectDeconvolutionLayer, CLGenerateProposalsLayer, NELSTMLayerQuantized, CLExpLayer, CLGEMMDeconvolutionLayer, NEDeconvolutionLayer, CLArithmeticAddition, CLFFTConvolutionLayer, CLSpaceToBatchLayer, CLWinogradConvolutionLayer, NELogicalOr, CLBatchToSpaceLayer, CLBatchNormalizationLayer, NEPixelWiseMultiplication, CLGEMMLowpMatrixMultiplyCore, CLCropResize, CLFuseBatchNormalization, CLPixelWiseMultiplication, NEFFTConvolutionLayer, NEGenerateProposalsLayer, CLDirectConvolutionLayer, CLStridedSlice, NEMatMul, CLConcatenateLayer, CLIndirectConvolutionLayer, NEDirectConvolutionLayer, CLDepthConvertLayer, CLGEMM, CLGEMMLowpOutputStage, CLInstanceNormalizationLayer, CLMatMul, CLDepthwiseConvolutionLayer, CLMaxUnpoolingLayer, NESpaceToBatchLayer, NEGEMMLowpMatrixMultiplyCore, CLReductionOperation, NEGEMMConv2d, CLActivationLayer, CLArgMinMaxLayer, CLCrop, CLPadLayer, NEBatchNormalizationLayer, CLL2NormalizeLayer, CLNormalizationLayer, CLSlice, NEDepthwiseConvolutionLayer, CLDeconvolutionLayer, CLFullyConnectedLayer, CLSoftmaxLayerGeneric< IS_LOG >, NEFuseBatchNormalization, CLStackLayer, CLRNNLayer, NECropResize, NEPadLayer, CLScale, NEDetectionPostProcessLayer, NEGEMM, CLPoolingLayer, NEActivationLayer, NEAddMulAdd, CLQuantizationLayer, CLDeconvolutionLayerUpsample, CLFFT1D, CLPooling3dLayer, NEArgMinMaxLayer, NEArithmeticSubtraction, NEPoolingLayer, NEStridedSlice, CLConv3D, CLPermute, CLPReluLayer, NEGEMMLowpOutputStage, NEInstanceNormalizationLayer, CLCast, CLFFT2D, NENormalizationLayer, NEReductionOperation, NEWinogradConvolutionLayer, NEConcatenateLayer, NERange, CLConvertFullyConnectedWeights, CLDequantizationLayer, NEL2NormalizeLayer, NEMaxUnpoolingLayer, NERNNLayer, CLLogicalAnd, CLLogicalOr, CLReduceMean, NEArithmeticAddition, NECast, NEFFT1D, NESlice, NEStackLayer, CLSpaceToDepthLayer, NEDepthConvertLayer, NEScale, NESoftmaxLayerGeneric< IS_LOG >, CLCopy, CLFlattenLayer, NEConv3D, NEElementwiseMax, NEPooling3dLayer, CLFill, CLLogicalNot, CPPBoxWithNonMaximaSuppressionLimit, CLRsqrtLayer, CLFloor, CLUnstack, CPPDetectionPostProcessLayer, NEReduceMean, NEPermute, NEUnstack, CLReshapeLayer, CLTranspose, NEFFT2D, NEPReluLayer, NEConvertFullyConnectedWeights, NEDequantizationLayer, NELogicalAnd, NESpaceToDepthLayer, NEElementwiseUnaryLayer< op >, NEFlattenLayer, NEFloor, NEQuantizationLayer, NECopy, NEROIPoolingLayer, NETranspose, NEReshapeLayer, NEFill, CPPDetectionOutputLayer, NEFillBorder, CLSplit, NESplit, FusedConvolutionBatchNormalizationWithPostOpsFunction< TargetInfo, FusedLayerTypes >, FusedConvolutionBatchNormalizationFunction< TargetInfo, FusedLayerTypes >, and FusedDepthwiseConvolutionBatchNormalizationFunction< TargetInfo, FusedLayerTypes >.


The documentation for this class was generated from the following file: