ComplexMathsBenchmarksQ31.cpp 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #include "ComplexMathsBenchmarksQ31.h"
  2. #include "Error.h"
  3. void ComplexMathsBenchmarksQ31::vec_conj_q31()
  4. {
  5. const q31_t *inp1=input1.ptr();
  6. q31_t *outp=output.ptr();
  7. arm_cmplx_conj_q31(inp1,outp,this->nb);
  8. }
  9. void ComplexMathsBenchmarksQ31::vec_dot_prod_q31()
  10. {
  11. const q31_t *inp1=input1.ptr();
  12. const q31_t *inp2=input2.ptr();
  13. q63_t real,imag;
  14. arm_cmplx_dot_prod_q31(inp1,inp2,this->nb,&real,&imag);
  15. }
  16. void ComplexMathsBenchmarksQ31::vec_mag_q31()
  17. {
  18. const q31_t *inp1=input1.ptr();
  19. q31_t *outp=output.ptr();
  20. arm_cmplx_mag_q31(inp1,outp,this->nb);
  21. }
  22. void ComplexMathsBenchmarksQ31::vec_mag_squared_q31()
  23. {
  24. const q31_t *inp1=input1.ptr();
  25. q31_t *outp=output.ptr();
  26. arm_cmplx_mag_squared_q31(inp1,outp,this->nb);
  27. }
  28. void ComplexMathsBenchmarksQ31::vec_mult_cmplx_q31()
  29. {
  30. const q31_t *inp1=input1.ptr();
  31. const q31_t *inp2=input2.ptr();
  32. q31_t *outp=output.ptr();
  33. arm_cmplx_mult_cmplx_q31(inp1,inp2,outp,this->nb);
  34. }
  35. void ComplexMathsBenchmarksQ31::vec_mult_real_q31()
  36. {
  37. const q31_t *inp1=input1.ptr();
  38. // Real input
  39. const q31_t *inp3=input3.ptr();
  40. q31_t *outp=output.ptr();
  41. arm_cmplx_mult_real_q31(inp1,inp3,outp,this->nb);
  42. }
  43. void ComplexMathsBenchmarksQ31::setUp(Testing::testID_t id,std::vector<Testing::param_t>& params,Client::PatternMgr *mgr)
  44. {
  45. std::vector<Testing::param_t>::iterator it = params.begin();
  46. this->nb = *it;
  47. input1.reload(ComplexMathsBenchmarksQ31::INPUT1_Q31_ID,mgr,this->nb);
  48. input2.reload(ComplexMathsBenchmarksQ31::INPUT2_Q31_ID,mgr,this->nb);
  49. input3.reload(ComplexMathsBenchmarksQ31::INPUT3_Q31_ID,mgr,this->nb);
  50. output.create(this->nb,ComplexMathsBenchmarksQ31::OUT_SAMPLES_Q31_ID,mgr);
  51. }
  52. void ComplexMathsBenchmarksQ31::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
  53. {
  54. }