distance
Functions
Name | |
---|---|
void | plp_cosine_distance_f32p_xpulpv2(void * S) 32-bit floating-point parallel cosine distance between two vectors (computes power in parallel) |
void | plp_cosine_distance_f32s_rv32im(const float32_t restrict pSrcA, const float32_t restrict pSrcB, uint32_t blockSize, float32_t *restrict pRes) 32-bit floating point cosine distance between two vectors |
void | plp_cosine_distance_f32s_xpulpv2(const float32_t restrict pSrcA, const float32_t restrict pSrcB, uint32_t blockSize, float32_t *restrict pRes) 32-bit floating point cosine distance between two vectors |
void | plp_cosine_distance_q16s_rv32im(const int16_t restrict pSrcA, const int16_t restrict pSrcB, uint32_t blockSize, uint32_t fracBits, int32_t *restrict pRes) cosine distance of 16-bit fixed point vectors kernel for RV32IM extension. |
void | plp_cosine_distance_q16s_xpulpv2(const int16_t restrict pSrcA, const int16_t restrict pSrcB, uint32_t blockSize, uint32_t fracBits, int32_t *restrict pRes) cosine distance of 16-bit fixed-point vectors kernel for XPULPV2. |
void | plp_cosine_distance_q32s_rv32im(const int32_t restrict pSrcA, const int32_t restrict pSrcB, uint32_t blockSize, uint32_t fracBits, int32_t *restrict pRes) cosine distance of 32-bit fixed point vectors. |
void | plp_cosine_distance_q32s_xpulpv2(const int32_t restrict pSrcA, const int32_t restrict pSrcB, uint32_t blockSize, uint32_t fracBits, int32_t *restrict pRes) cosine distance of 32-bit fixed-point vectors kernel for XPULPV2 extension. |
void | plp_cosine_distance_f32(const float32_t restrict pSrcA, const float32_t restrict pSrcB, uint32_t blockSize, float32_t *restrict pRes) Glue code for cosine distance between 32-bit floating-point vectors. |
void | plp_cosine_distance_f32_parallel(const float32_t restrict pSrcA, const float32_t restrict pSrcB, uint32_t blockSize, uint32_t nPE, float32_t *restrict pRes) Glue code for parallel cosine distance between 32-bit float vectors. |
void | plp_cosine_distance_q16(const int16_t restrict pSrcA, const int16_t restrict pSrcB, uint16_t blockSize, uint16_t fracBits, int32_t *restrict pRes) Glue code for cosine distance of 16-bit fixed point vectors. |
void | plp_cosine_distance_q32(const int32_t restrict pSrcA, const int32_t restrict pSrcB, uint32_t blockSize, uint32_t fracBits, int32_t *restrict pRes) Glue code for cosine distance of 32-bit fixed point vectors. |
void | plp_cosine_distance_q32_parallel(const int32_t restrict pSrcA, const int32_t restrict pSrcB, uint32_t blockSize, uint32_t fracBits, uint32_t nPE, int32_t *restrict pRes) Glue code for parallel cosine distance between 32-bit fixed-point vectors. |
Detailed Description
cosine distance
Functions Documentation
function plp_cosine_distance_f32p_xpulpv2
void plp_cosine_distance_f32p_xpulpv2(
void * S
)
32-bit floating-point parallel cosine distance between two vectors (computes power in parallel)
Parameters:
- S points to the instance structure for float cosine distance
Return: none
function plp_cosine_distance_f32s_rv32im
void plp_cosine_distance_f32s_rv32im(
const float32_t *__restrict__ pSrcA,
const float32_t *__restrict__ pSrcB,
uint32_t blockSize,
float32_t *__restrict__ pRes
)
32-bit floating point cosine distance between two vectors
Parameters:
- pA First vector
- pB Second vector
- blockSize vector length
- pRes output result returned here
Return: none
function plp_cosine_distance_f32s_xpulpv2
void plp_cosine_distance_f32s_xpulpv2(
const float32_t *__restrict__ pSrcA,
const float32_t *__restrict__ pSrcB,
uint32_t blockSize,
float32_t *__restrict__ pRes
)
32-bit floating point cosine distance between two vectors
Parameters:
- pA First vector
- pB Second vector
- blockSize vector length
- pRes output result returned here
Return: none
function plp_cosine_distance_q16s_rv32im
void plp_cosine_distance_q16s_rv32im(
const int16_t *__restrict__ pSrcA,
const int16_t *__restrict__ pSrcB,
uint32_t blockSize,
uint32_t fracBits,
int32_t *__restrict__ pRes
)
cosine distance of 16-bit fixed point vectors kernel for RV32IM extension.
Parameters:
- pSrcA points to the first input vector [16 bit]
- pSrcB points to the second input vector [16 bit]
- blockSize number of samples in each vector
- fracBits decimal point for right shift
- pRes output result returned here [32 bit]
Return: none
Par: Exploiting SIMD instructions
When the ISA supports, the 16 bit values are packed two by two into 32 bit vectors and then the two dot products are performed simultaneously on 32 bit vectors, with 32 bit accumulator. RV32IM doesn't support SIMD. For SIMD, check out other ISA extensions (e.g. XPULPV2).
function plp_cosine_distance_q16s_xpulpv2
void plp_cosine_distance_q16s_xpulpv2(
const int16_t *__restrict__ pSrcA,
const int16_t *__restrict__ pSrcB,
uint32_t blockSize,
uint32_t fracBits,
int32_t *__restrict__ pRes
)
cosine distance of 16-bit fixed-point vectors kernel for XPULPV2.
Parameters:
- pSrcA points to the first input vector [16 bit]
- pSrcB points to the second input vector [16 bit]
- blockSize number of samples in each vector
- fracBits decimal point for right shift
- pRes output result returned here [32 bit]
Return: none
Par: Exploiting SIMD instructions
The 16 bit values are packed two by two into 32 bit vectors and then the sums and prducts are performed simultaneously on 32 bit vectors, with 32 bit accumulator.
cosine distance of 16-bit fixed point vectors kernel for XPULPV2.
function plp_cosine_distance_q32s_rv32im
void plp_cosine_distance_q32s_rv32im(
const int32_t *__restrict__ pSrcA,
const int32_t *__restrict__ pSrcB,
uint32_t blockSize,
uint32_t fracBits,
int32_t *__restrict__ pRes
)
cosine distance of 32-bit fixed point vectors.
Parameters:
- pSrcA points to the first input vector
- pSrcB points to the second input vector
- blockSize number of samples in each vector
- fracBits number of fixed-point fractional bits
- pRes output result returned here
Return: none
function plp_cosine_distance_q32s_xpulpv2
void plp_cosine_distance_q32s_xpulpv2(
const int32_t *__restrict__ pSrcA,
const int32_t *__restrict__ pSrcB,
uint32_t blockSize,
uint32_t fracBits,
int32_t *__restrict__ pRes
)
cosine distance of 32-bit fixed-point vectors kernel for XPULPV2 extension.
Parameters:
- pSrcA points to the first input vector
- pSrcB points to the second input vector
- blockSize number of samples in each vector
- fracBits number of fixed point fractional bits
- pRes output result returned here
Return: none
cosine distance of 32-bit fixed point vectors kernel for XPULPV2 extension.
function plp_cosine_distance_f32
void plp_cosine_distance_f32(
const float32_t *__restrict__ pSrcA,
const float32_t *__restrict__ pSrcB,
uint32_t blockSize,
float32_t *__restrict__ pRes
)
Glue code for cosine distance between 32-bit floating-point vectors.
Parameters:
- pSrcA First vector
- pSrcB Second vector
- blockSize vector length
Return: none
Glue code for cosine distance between 32-bit float vectors.
function plp_cosine_distance_f32_parallel
void plp_cosine_distance_f32_parallel(
const float32_t *__restrict__ pSrcA,
const float32_t *__restrict__ pSrcB,
uint32_t blockSize,
uint32_t nPE,
float32_t *__restrict__ pRes
)
Glue code for parallel cosine distance between 32-bit float vectors.
Parameters:
- pSrcA points to the first input vector
- pSrcB points to the second input vector
- blockSize number of samples in each vector
- nPE number of parallel processing units
- pRes output result returned here
Return: none
function plp_cosine_distance_q16
void plp_cosine_distance_q16(
const int16_t *__restrict__ pSrcA,
const int16_t *__restrict__ pSrcB,
uint16_t blockSize,
uint16_t fracBits,
int32_t *__restrict__ pRes
)
Glue code for cosine distance of 16-bit fixed point vectors.
Parameters:
- pSrcA points to the first input vector
- pSrcB points to the second input vector
- blockSize number of samples in each vector
- fracBits number of fixed point fractional bits
- pRes output result returned here
Return: none
function plp_cosine_distance_q32
void plp_cosine_distance_q32(
const int32_t *__restrict__ pSrcA,
const int32_t *__restrict__ pSrcB,
uint32_t blockSize,
uint32_t fracBits,
int32_t *__restrict__ pRes
)
Glue code for cosine distance of 32-bit fixed point vectors.
Parameters:
- pSrcA points to the first input vector
- pSrcB points to the second input vector
- blockSize number of samples in each vector
- fracBits number of fixed point fractional bits
- pRes output result returned here
Return: none
function plp_cosine_distance_q32_parallel
void plp_cosine_distance_q32_parallel(
const int32_t *__restrict__ pSrcA,
const int32_t *__restrict__ pSrcB,
uint32_t blockSize,
uint32_t fracBits,
uint32_t nPE,
int32_t *__restrict__ pRes
)
Glue code for parallel cosine distance between 32-bit fixed-point vectors.
Parameters:
- pSrcA points to the first input vector
- pSrcB points to the second input vector
- blockSize number of samples in each vector
- nPE number of parallel processing units
- pRes output result returned here
Return: none
Glue code for parallel cosine distance between 32-bit fixed-precision vectors.
Updated on 2023-03-01 at 16:16:32 +0000