#include "dsp_dot_prod.h"
[code]#include "dsp_dot_prod.h"
void dap_dot_prod_test(void)
{
static float32_t pSrcA[5]={1.1f,1.2f,1.3f,1.4f,1.5f};
static float32_t pSrcB[5]={1.5f,1.6f,1.7f,1.8f,1.9f};
static float32_t result;
static q31_t pSrcA1[5]={1,2,3,4,5};
static q31_t pSrcB1[5]={5,4,3,2,1};
static q63_t result1;
static q15_t pSrcA2[5]={1,2,3,2,1};
static q15_t pSrcB2[5]={3,2,1,2,3};
static q63_t result2;
static q7_t pSrcA3[5]={1,1,1,1,1};
static q7_t pSrcB3[5]={1,1,1,1,1};
static q31_t result3;
arm_dot_prod_f32(pSrcA,pSrcB,5,&result);
printf("1.1*1.5+1.2*1.6+...+1.5*1.9=%f\r\n",result);
arm_dot_prod_q31(pSrcA1,pSrcB1,5,&result1);
printf("1*5+2*4+...+5*9=%lld\r\n",result1);
arm_dot_prod_q15(pSrcA2,pSrcB2,5,&result2);
printf("1*3+2*2+...+5*1=%lld\r\n",result2);
arm_dot_prod_q7(pSrcA3,pSrcB3,5,&result3);
printf("1*1+1*1+...+1*1=%d\r\n",result3);
printf("*********点乘测试结束!********\r\n");
}