Compute Library
 21.11
ICpuWinogradConv2dTransformInputKernel Class Referenceabstract

Interface for the kernel to perform Winograd input transform. More...

#include <CpuWinogradConv2dKernel.h>

Collaboration diagram for ICpuWinogradConv2dTransformInputKernel:
[legend]

Public Member Functions

virtual unsigned int get_working_space_size (unsigned int num_threads) const =0
 Get the working space required to perform the transformation. More...
 
virtual unsigned int get_input_storage_size (int num_batches, int num_channels, int num_rows, int num_cols, bool same_padding) const =0
 Determine how much memory (in units of TIn) to allocate for the transformed input. More...
 
virtual int get_matrix_stride (int num_batches, int num_channels, int num_rows, int num_cols, bool same_padding) const =0
 Gets the stride between matrices in the input worspace. More...
 
virtual void configure (const ITensorInfo *input_nhwc, const int num_batches, const int num_rows, const int num_cols, const int num_channels, const PaddingType padding, ITensorInfo *output, const int matrix_stride, ITensorInfo *workspace)=0
 Configure the output transform kernel. More...
 
virtual ~ICpuWinogradConv2dTransformInputKernel ()
 Destructor. More...
 
- Public Member Functions inherited from ICPPKernel
virtual ~ICPPKernel ()=default
 Default destructor. More...
 
virtual void run (const Window &window, const ThreadInfo &info)
 Execute the kernel on the passed window. More...
 
virtual void run_nd (const Window &window, const ThreadInfo &info, const Window &thread_locator)
 legacy compatibility layer for implemantions which do not support thread_locator In these cases we simply narrow the interface down the legacy version More...
 
virtual void run_op (ITensorPack &tensors, const Window &window, const ThreadInfo &info)
 Execute the kernel on the passed window. More...
 
virtual size_t get_mws (const CPUInfo &platform, size_t thread_count) const
 Return minimum workload size of the relevant kernel. More...
 
virtual const char * name () const =0
 Name of the kernel. More...
 
- Public Member Functions inherited from IKernel
 IKernel ()
 Constructor. More...
 
virtual ~IKernel ()=default
 Destructor. More...
 
virtual bool is_parallelisable () const
 Indicates whether or not the kernel is parallelisable. More...
 
virtual BorderSize border_size () const
 The size of the border for that kernel. More...
 
const Windowwindow () const
 The maximum window the kernel can be executed on. More...
 
bool is_window_configured () const
 Function to check if the embedded window of this kernel has been configured. More...
 

Additional Inherited Members

- Static Public Attributes inherited from ICPPKernel
static constexpr size_t default_mws = 128
 
static constexpr size_t small_network_mws = 256
 

Detailed Description

Interface for the kernel to perform Winograd input transform.

Definition at line 38 of file CpuWinogradConv2dKernel.h.

Constructor & Destructor Documentation

◆ ~ICpuWinogradConv2dTransformInputKernel()

virtual ~ICpuWinogradConv2dTransformInputKernel ( )
inlinevirtual

Destructor.

Definition at line 93 of file CpuWinogradConv2dKernel.h.

94  {
95  }

Member Function Documentation

◆ configure()

virtual void configure ( const ITensorInfo input_nhwc,
const int  num_batches,
const int  num_rows,
const int  num_cols,
const int  num_channels,
const PaddingType  padding,
ITensorInfo output,
const int  matrix_stride,
ITensorInfo workspace 
)
pure virtual

Configure the output transform kernel.

Parameters
[in]input_nhwcInput tensor in NHWC data layout format.
[in]num_batchesNumber of batches in input tensor.
[in]num_rowsNumber of rows in input tensor.
[in]num_colsNumber of columns in input tensor.
[in]num_channelsNumber of channels in input tensor.
[in]paddingPadding type.
[out]outputBase of output matrices.
[in]matrix_strideStride between output matrices.
[in]workspaceTensor to be used as the working space during the computation.

Implemented in CpuWinogradConv2dTransformInputKernel< T, OutputTileRows, OutputTileCols, KernelRows, KernelCols >.

Referenced by CpuWinogradConv2dTransformInputKernel< T, OutputTileRows, OutputTileCols, KernelRows, KernelCols >::name(), CpuWinogradConv2dTransformOutputKernel< T, OutputTileRows, OutputTileCols, KernelRows, KernelCols >::name(), CpuWinogradConv2dTransformWeightsKernel< T, OutputTileRows, OutputTileCols, KernelRows, KernelCols >::name(), and ICpuWinogradConv2dTransformWeightsKernel::~ICpuWinogradConv2dTransformWeightsKernel().

◆ get_input_storage_size()

virtual unsigned int get_input_storage_size ( int  num_batches,
int  num_channels,
int  num_rows,
int  num_cols,
bool  same_padding 
) const
pure virtual

Determine how much memory (in units of TIn) to allocate for the transformed input.

Parameters
[in]num_batchesNumber of batches in the input tensor.
[in]num_channelsNumber of feature maps in the input tensor.
[in]num_rowsNumber of rows in each feature map.
[in]num_colsNumber of columns in each feature map.
[in]same_paddingUse "SAME" padding, otherwise use "VALID".
Returns
Storage size (in units of TIn) required.

Implemented in CpuWinogradConv2dTransformInputKernel< T, OutputTileRows, OutputTileCols, KernelRows, KernelCols >.

◆ get_matrix_stride()

virtual int get_matrix_stride ( int  num_batches,
int  num_channels,
int  num_rows,
int  num_cols,
bool  same_padding 
) const
pure virtual

Gets the stride between matrices in the input worspace.

Parameters
[in]num_batchesNumber of batches in the input tensor.
[in]num_channelsNumber of feature maps in the input tensor.
[in]num_rowsNumber of rows in each feature map.
[in]num_colsNumber of columns in each feature map.
[in]same_paddingUse "SAME" padding, otherwise use "VALID".
Returns
Stride expressed in bytes.

Implemented in CpuWinogradConv2dTransformInputKernel< T, OutputTileRows, OutputTileCols, KernelRows, KernelCols >.

Referenced by CpuWinogradConv2dTransformOutputKernel< T, OutputTileRows, OutputTileCols, KernelRows, KernelCols >::name(), CpuWinogradConv2dTransformWeightsKernel< T, OutputTileRows, OutputTileCols, KernelRows, KernelCols >::name(), and ICpuWinogradConv2dTransformWeightsKernel::~ICpuWinogradConv2dTransformWeightsKernel().

◆ get_working_space_size()

virtual unsigned int get_working_space_size ( unsigned int  num_threads) const
pure virtual

Get the working space required to perform the transformation.

Note, the working space is only required when performing the transformation - hence it can be reused whenever the transformation is not running.

Parameters
num_threadsThe greatest number of threads that will be used to execute the transform.
Returns
Size of working space required in bytes.

Implemented in CpuWinogradConv2dTransformInputKernel< T, OutputTileRows, OutputTileCols, KernelRows, KernelCols >.

Referenced by CpuWinogradConv2dTransformOutputKernel< T, OutputTileRows, OutputTileCols, KernelRows, KernelCols >::name().


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