ComplexMathsBenchmarksQ15.cpp 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #include "ComplexMathsBenchmarksQ15.h"
  2. #include "Error.h"
  3. void ComplexMathsBenchmarksQ15::vec_conj_q15()
  4. {
  5. arm_cmplx_conj_q15(this->inp1,this->outp,this->nb);
  6. }
  7. void ComplexMathsBenchmarksQ15::vec_dot_prod_q15()
  8. {
  9. q31_t real,imag;
  10. arm_cmplx_dot_prod_q15(this->inp1,this->inp2,this->nb,&real,&imag);
  11. }
  12. void ComplexMathsBenchmarksQ15::vec_mag_q15()
  13. {
  14. arm_cmplx_mag_q15(this->inp1,this->outp,this->nb);
  15. }
  16. void ComplexMathsBenchmarksQ15::vec_mag_squared_q15()
  17. {
  18. arm_cmplx_mag_squared_q15(this->inp1,this->outp,this->nb);
  19. }
  20. void ComplexMathsBenchmarksQ15::vec_mult_cmplx_q15()
  21. {
  22. arm_cmplx_mult_cmplx_q15(this->inp1,this->inp2,this->outp,this->nb);
  23. }
  24. void ComplexMathsBenchmarksQ15::vec_mult_real_q15()
  25. {
  26. arm_cmplx_mult_real_q15(this->inp1,this->inp3,this->outp,this->nb);
  27. }
  28. void ComplexMathsBenchmarksQ15::setUp(Testing::testID_t id,std::vector<Testing::param_t>& params,Client::PatternMgr *mgr)
  29. {
  30. std::vector<Testing::param_t>::iterator it = params.begin();
  31. this->nb = *it;
  32. input1.reload(ComplexMathsBenchmarksQ15::INPUT1_Q15_ID,mgr,this->nb);
  33. input2.reload(ComplexMathsBenchmarksQ15::INPUT2_Q15_ID,mgr,this->nb);
  34. input3.reload(ComplexMathsBenchmarksQ15::INPUT3_Q15_ID,mgr,this->nb);
  35. output.create(this->nb,ComplexMathsBenchmarksQ15::OUT_SAMPLES_Q15_ID,mgr);
  36. switch(id){
  37. case ComplexMathsBenchmarksQ15::VEC_CONJ_Q15_1:
  38. case ComplexMathsBenchmarksQ15::VEC_MAG_Q15_3:
  39. case ComplexMathsBenchmarksQ15::VEC_MAG_SQUARED_Q15_4:
  40. this->inp1=input1.ptr();
  41. this->outp=output.ptr();
  42. break;
  43. case ComplexMathsBenchmarksQ15::VEC_DOT_PROD_Q15_2:
  44. this->inp1=input1.ptr();
  45. this->inp2=input2.ptr();
  46. break;
  47. case ComplexMathsBenchmarksQ15::VEC_MULT_CMPLX_Q15_5:
  48. this->inp1=input1.ptr();
  49. this->inp2=input2.ptr();
  50. this->outp=output.ptr();
  51. break;
  52. case ComplexMathsBenchmarksQ15::VEC_MULT_REAL_Q15_6:
  53. this->inp1=input1.ptr();
  54. // Real input
  55. this->inp3=input3.ptr();
  56. this->outp=output.ptr();
  57. break;
  58. }
  59. }
  60. void ComplexMathsBenchmarksQ15::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
  61. {
  62. }