Compute Library
 19.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()

virtual void prepare ( )
inlinevirtual

Prepare the function for executing.

Any one off pre-processing step required by the function is handled here

Note
Prepare stage might not need all the function's buffers' backing memory to be available in order to execute

Reimplemented in NEDepthwiseConvolutionLayer, NEDepthwiseConvolutionLayerOptimized, CLDepthwiseConvolutionLayer, CLLSTMLayer, CLGEMMConvolutionLayer, NEGEMMConvolutionLayer, NEConvolutionLayer, NELSTMLayer, CLConvolutionLayer, NELSTMLayerQuantized, CLLSTMLayerQuantized, CLFullyConnectedLayer, NEFullyConnectedLayer, NEGEMMInterleavedWrapper, NEGEMMAssemblyDispatch, CLDirectDeconvolutionLayer, FusedConvolutionBatchNormalizationFunction< TargetInfo, FusedLayerTypes >, CLGEMMDeconvolutionLayer, NEDeconvolutionLayer, FusedDepthwiseConvolutionBatchNormalizationFunction< TargetInfo, FusedLayerTypes >, GCConvolutionLayer, CLFFTConvolutionLayer, NEFFTConvolutionLayer, NEDepthwiseConvolutionAssemblyDispatch, CLGEMM, NEDepthwiseConvolutionLayer3x3, NEGEMMLowpMatrixMultiplyCore, CLDepthwiseConvolutionLayer3x3, CLWinogradConvolutionLayer, CLGEMMLowpMatrixMultiplyCore, GCGEMM, NEGEMM, CLLocallyConnectedLayer, NELocallyConnectedLayer, GCFullyConnectedLayer, NERNNLayer, NEWinogradConvolutionLayer, CLDeconvolutionLayer, CLDepthwiseSeparableConvolutionLayer, NEDepthwiseSeparableConvolutionLayer, and CLRNNLayer.

Definition at line 57 of file IFunction.h.

58  {
59  }

Referenced by NEDepthwiseSeparableConvolutionLayer::prepare(), and CLDepthwiseSeparableConvolutionLayer::prepare().

◆ run()

virtual void run ( )
pure virtual

Run the kernels contained in the function.

For NEON 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 NEDepthwiseConvolutionLayer, NEDepthwiseConvolutionLayerOptimized, CLDepthwiseConvolutionLayer, CLLSTMLayer, CLGEMMConvolutionLayer, NEGEMMConvolutionLayer, NEConvolutionLayer, NELSTMLayer, CLConvolutionLayer, NELSTMLayerQuantized, CLLSTMLayerQuantized, CLFullyConnectedLayer, NEFullyConnectedLayer, CLSynthetizeFunctionInitOutputWithZeroAndWithZeroConstantBorder< K, bordersize >, NEGEMMAssemblyDispatch, NEGEMMInterleavedWrapper, NEGaussianPyramidOrb, CLDirectDeconvolutionLayer, CLGaussianPyramidOrb, CLGEMMDeconvolutionLayer, NEDeconvolutionLayer, GCConvolutionLayer, FusedConvolutionBatchNormalizationFunction< TargetInfo, FusedLayerTypes >, CLFFTConvolutionLayer, CLGenerateProposalsLayer, NEFFTConvolutionLayer, FusedDepthwiseConvolutionBatchNormalizationFunction< TargetInfo, FusedLayerTypes >, NEDepthwiseConvolutionAssemblyDispatch, CLGEMM, NEDepthwiseConvolutionLayer3x3, NEGEMMLowpMatrixMultiplyCore, CLDepthwiseConvolutionLayer3x3, CLWinogradConvolutionLayer, CLSpaceToBatchLayer, CLGEMMLowpMatrixMultiplyCore, NESpaceToBatchLayer, CLCropResize, NEDirectConvolutionLayer, CLOpticalFlow, GCGEMM, NECropResize, NEFuseBatchNormalization, NEGEMM, CLFuseBatchNormalization, CLLocallyConnectedLayer, NELocallyConnectedLayer, NEGaussianPyramidHalf, CLGaussianPyramidHalf, CLConvolutionSquare< matrix_size >, CLHOGMultiDetection, NEConvolutionSquare< matrix_size >, NEHOGMultiDetection, GCFullyConnectedLayer, NEHarrisCorners, NESoftmaxLayer, CLHarrisCorners, CPPDetectionPostProcessLayer, NEOpticalFlow, CLBatchNormalizationLayer, NEBatchNormalizationLayer, CLLaplacianReconstruct, NELaplacianReconstruct, NECannyEdge, NEConcatenateLayer, NERNNLayer, CLConcatenateLayer, CLDeconvolutionLayerUpsample, CLPadLayer, CLConvolutionLayerReshapeWeights, CLSoftmaxLayer, CLBatchToSpaceLayer, CLDirectConvolutionLayer, NEWinogradConvolutionLayer, CLUpsampleLayer, NEScale, CLDeconvolutionLayer, CLFastCorners, CLL2NormalizeLayer, CLReductionOperation, NEConvolutionLayerReshapeWeights, NEIm2Col, NENormalizationLayer, NEPadLayer, CLCannyEdge, CLDepthwiseSeparableConvolutionLayer, CLNormalizationLayer, NESpaceToDepthLayer, CLLaplacianPyramid, CLStackLayer, NEDepthwiseSeparableConvolutionLayer, NELaplacianPyramid, NEStackLayer, GCDirectConvolutionLayer, NEL2NormalizeLayer, CLMeanStdDev, CLMinMaxLocation, CLRNNLayer, NEFastCorners, NEFFT1D, CLFFT1D, CLSobel5x5, CLSobel7x7, CLHOGDetector, CLNormalizePlanarYUVLayer, CLUnstack, CPPDetectionOutputLayer, GCNormalizePlanarYUVLayer, NEArgMinMaxLayer, NEPoolingLayer, NEReductionOperation, CLSplit, NEReduceMean, NESobel5x5, NESobel7x7, NESplit, NEUnstack, CLFFT2D, CLGaussian5x5, CLReduceMean, NEFFT2D, CLHOGGradient, GCPoolingLayer, NEUpsampleLayer, GCDepthwiseConvolutionLayer3x3, GCSoftmaxLayer, NEGaussian5x5, NEHOGGradient, NERange, CLHOGDescriptor, NEMinMaxLocation, GCBatchNormalizationLayer, GCNormalizationLayer, NEDerivative, NEEqualizeHistogram, NEHOGDescriptor, NEROIPoolingLayer, GCConvolutionLayerReshapeWeights, CLDepthToSpaceLayer, CLHistogram, CLSpaceToDepthLayer, GCConcatenateLayer, CLEqualizeHistogram, NEConvertFullyConnectedWeights, NEGEMMLowpAssemblyMatrixMultiplyCore, GCDropoutLayer, NEMeanStdDev, CLIntegralImage, NEFillBorder, NEHistogram, NESimpleAssemblyFunction, ICLSimpleFunction, IGCSimpleFunction, INESimpleFunction, ICPPSimpleFunction, and INESimpleFunctionNoBorder.


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