Simd Library Documentation.

Home | Release Notes | Download | Documentation | Issues | GitHub
Quantized multiplication framework

A framework to accelerate Quantized multiplication in Synet Framework. More...

Functions

SIMD_API void SimdSynetQuantizedMulForward (void *context, const uint8_t *a, const uint8_t *b, uint8_t *dst)
 Performs element-wise quantized multiplication. More...
 

Detailed Description

A framework to accelerate Quantized multiplication in Synet Framework.

Function Documentation

◆ SimdSynetQuantizedMulForward()

void SimdSynetQuantizedMulForward ( void *  context,
const uint8_t *  a,
const uint8_t *  b,
uint8_t *  dst 
)

Performs element-wise quantized multiplication.

Algorithm's details for UINT8 output:

for(i = 0; i < size; ++i)
{
    _a = (a[i] - aZero)*aScale;
    _b = (b[i] - bZero)*bScale;
    dst[i] = RestrictRange(Round((_a * _b)/dstScale) + dstZero, 0, 255);
}
Parameters
[in]context- a pointer to quantized multiplication context. It must be created by function SimdSynetQuantizedMulInit and released by function SimdRelease.
[in]a- a pointer to input A tensor data. Its type is defined by parameter aType of SimdSynetQuantizedMulInit.
[in]b- a pointer to input B tensor data. Its type is defined by parameter bType of SimdSynetQuantizedMulInit.
[out]dst- a pointer to output tensor data. Its type is defined by parameter dstType of SimdSynetQuantizedMulInit.