Simd Library Documentation.

Home | Release Notes | Download | Documentation | Issues | GitHub
Convolution framework

A framework to accelerate convolution in Synet Framework. More...

Functions

SIMD_API void * SimdSynetConvolution32fInit (size_t batch, const SimdConvolutionParameters *conv, SimdGemm32fNNPtr gemm)
 Initilizes FP32 convolution algorithm. More...
 
SIMD_API size_t SimdSynetConvolution32fExternalBufferSize (const void *context)
 Gets size of external temporary buffer required for FP32 convolution algorithm. More...
 
SIMD_API size_t SimdSynetConvolution32fInternalBufferSize (const void *context)
 Gets size of internal buffer used inside FP32 convolution algorithm. More...
 
SIMD_API void SimdSynetConvolution32fSetParams (void *context, const float *weight, SimdBool *internal, const float *bias, const float *params)
 Sets weights, beases and parameters of activation function required for FP32 convolution algorithm. More...
 
SIMD_API void SimdSynetConvolution32fForward (void *context, const float *src, float *buf, float *dst)
 Performs forward propagation of FP32 convolution algorithm. More...
 
SIMD_API void * SimdSynetConvolution8iInit (size_t batch, const SimdConvolutionParameters *conv, SimdSynetCompatibilityType compatibility)
 Initilizes INT8 convolution algorithm. More...
 
SIMD_API size_t SimdSynetConvolution8iExternalBufferSize (const void *context)
 Gets size in bytes of external temporary buffer required for INT8 convolution algorithm. More...
 
SIMD_API size_t SimdSynetConvolution8iInternalBufferSize (const void *context)
 Gets size of internal buffer used inside INT8 convolution algorithm. More...
 
SIMD_API void SimdSynetConvolution8iSetParams (void *context, const float *weight, const float *bias, const float *params, const float *const *stats)
 Sets weights, beases, parameters of activation function, input/output tensor statistics required for INT8 convolution algorithm. More...
 
SIMD_API void SimdSynetConvolution8iForward (void *context, const uint8_t *src, uint8_t *buf, uint8_t *dst)
 Performs forward propagation of INT8 convolution algorithm. More...
 

Detailed Description

A framework to accelerate convolution in Synet Framework.

Function Documentation

◆ SimdSynetConvolution32fInit()

void * SimdSynetConvolution32fInit ( size_t  batch,
const SimdConvolutionParameters conv,
SimdGemm32fNNPtr  gemm 
)

Initilizes FP32 convolution algorithm.

Parameters
[in]batch- a batch size.
[in]conv- a pointer to convolution parameters.
[in]gemm- a pointer to external function of matrix multiplication. Can be NULL.
Returns
a pointer to FP32 convolution context. On error it returns NULL. It must be released with using of function SimdRelease. This pointer is used in functions SimdSynetConvolution32fExternalBufferSize, SimdSynetConvolution32fInternalBufferSize, SimdSynetConvolution32fSetParams and SimdSynetConvolution32fForward.

◆ SimdSynetConvolution32fExternalBufferSize()

size_t SimdSynetConvolution32fExternalBufferSize ( const void *  context)

Gets size of external temporary buffer required for FP32 convolution algorithm.

Parameters
[in]context- a pointer to FP32 convolution context. It must be created by function SimdSynetConvolution32fInit and released by function SimdRelease.
Returns
size of external temporary buffer required for FP32 convolution algorithm.

◆ SimdSynetConvolution32fInternalBufferSize()

size_t SimdSynetConvolution32fInternalBufferSize ( const void *  context)

Gets size of internal buffer used inside FP32 convolution algorithm.

Parameters
[in]context- a pointer to FP32 convolution context. It must be created by function SimdSynetConvolution32fInit and released by function SimdRelease.
Returns
size of internal buffer used inside FP32 convolution algorithm.

◆ SimdSynetConvolution32fSetParams()

void SimdSynetConvolution32fSetParams ( void *  context,
const float *  weight,
SimdBool internal,
const float *  bias,
const float *  params 
)

Sets weights, beases and parameters of activation function required for FP32 convolution algorithm.

Parameters
[in,out]context- a pointer to FP32 convolution context. It must be created by function SimdSynetConvolution32fInit and released by function SimdRelease.
[in]weight- a pointer to convolution weights.
[out]internal- a flag signalized that weight is stored in the internal buffer. Can be NULL.
[in]bias- a pointer to bias. Can be NULL.
[in]params- a pointer to parameters of activation functions (see SimdConvolutionActivationType). Can be NULL.

◆ SimdSynetConvolution32fForward()

void SimdSynetConvolution32fForward ( void *  context,
const float *  src,
float *  buf,
float *  dst 
)

Performs forward propagation of FP32 convolution algorithm.

Parameters
[in]context- a pointer to FP32 convolution context. It must be created by function SimdSynetConvolution32fInit and released by function SimdRelease.
[in]src- a pointer to input tensor.
[out]buf- a pointer to external temporary buffer. The size of the external temporary buffer is determined by function SimdSynetConvolution32fExternalBufferSize. Can be NULL (it causes usage of internal buffer).
[out]dst- a pointer to output tensor.

◆ SimdSynetConvolution8iInit()

void * SimdSynetConvolution8iInit ( size_t  batch,
const SimdConvolutionParameters conv,
SimdSynetCompatibilityType  compatibility 
)

Initilizes INT8 convolution algorithm.

Parameters
[in]batch- a batch size.
[in]conv- a pointer to convolution parameters.
[in]compatibility- a flags of bitwise compatibility.
Returns
a pointer to INT8 convolution context. On error it returns NULL. It must be released with using of function SimdRelease. This pointer is used in functions SimdSynetConvolution8iExternalBufferSize, SimdSynetConvolution8iInternalBufferSize, SimdSynetConvolution8iSetParams and SimdSynetConvolution8iForward.

◆ SimdSynetConvolution8iExternalBufferSize()

size_t SimdSynetConvolution8iExternalBufferSize ( const void *  context)

Gets size in bytes of external temporary buffer required for INT8 convolution algorithm.

Parameters
[in]context- a pointer to INT8 convolution context. It must be created by function SimdSynetConvolution8iInit and released by function SimdRelease.
Returns
size of external temporary buffer required for INT8 convolution algorithm.

◆ SimdSynetConvolution8iInternalBufferSize()

size_t SimdSynetConvolution8iInternalBufferSize ( const void *  context)

Gets size of internal buffer used inside INT8 convolution algorithm.

Parameters
[in]context- a pointer to INT8 convolution context. It must be created by function SimdSynetConvolution8iInit and released by function SimdRelease.
Returns
size of internal buffer used inside INT8 convolution algorithm.

◆ SimdSynetConvolution8iSetParams()

void SimdSynetConvolution8iSetParams ( void *  context,
const float *  weight,
const float *  bias,
const float *  params,
const float *const *  stats 
)

Sets weights, beases, parameters of activation function, input/output tensor statistics required for INT8 convolution algorithm.

Parameters
[in,out]context- a pointer to INT8 convolution context. It must be created by function SimdSynetConvolution8iInit and released by function SimdRelease.
[in]weight- a pointer to original (32-bit float point) convolution weights.
[in]bias- a pointer to original (32-bit float point) bias. Can be NULL.
[in]params- a pointer to original (32-bit float point) parameters of activation functions (see SimdConvolutionActivationType). Can be NULL.
[in]stats- a pointer to pointers with statistics of input(min - stats[0], max - stats[1]) and output(min - stats[2], max - stats[3]) tensors.

◆ SimdSynetConvolution8iForward()

void SimdSynetConvolution8iForward ( void *  context,
const uint8_t *  src,
uint8_t *  buf,
uint8_t *  dst 
)

Performs forward propagation of INT8 convolution algorithm.

Parameters
[in]context- a pointer to INT8 convolution context. It must be created by function SimdSynetConvolution8iInit and released by function SimdRelease.
[in]src- a pointer to input tensor.
[out]buf- a pointer to external temporary buffer. The size of the external temporary buffer is determined by function SimdSynetConvolution8iExternalBufferSize. Can be NULL (it causes usage of internal buffer).
[out]dst- a pointer to output tensor.