ComplexMathsBenchmarksQ31.cpp 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #include "ComplexMathsBenchmarksQ31.h"
  2. #include "Error.h"
  3. void ComplexMathsBenchmarksQ31::vec_conj_q31()
  4. {
  5. arm_cmplx_conj_q31(this->inp1,this->outp,this->nb);
  6. }
  7. void ComplexMathsBenchmarksQ31::vec_dot_prod_q31()
  8. {
  9. q63_t real,imag;
  10. arm_cmplx_dot_prod_q31(this->inp1,this->inp2,this->nb,&real,&imag);
  11. }
  12. void ComplexMathsBenchmarksQ31::vec_mag_q31()
  13. {
  14. arm_cmplx_mag_q31(this->inp1,this->outp,this->nb);
  15. }
  16. void ComplexMathsBenchmarksQ31::vec_mag_squared_q31()
  17. {
  18. arm_cmplx_mag_squared_q31(this->inp1,this->outp,this->nb);
  19. }
  20. void ComplexMathsBenchmarksQ31::vec_mult_cmplx_q31()
  21. {
  22. arm_cmplx_mult_cmplx_q31(this->inp1,this->inp2,this->outp,this->nb);
  23. }
  24. void ComplexMathsBenchmarksQ31::vec_mult_real_q31()
  25. {
  26. arm_cmplx_mult_real_q31(this->inp1,this->inp3,this->outp,this->nb);
  27. }
  28. void ComplexMathsBenchmarksQ31::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(ComplexMathsBenchmarksQ31::INPUT1_Q31_ID,mgr,this->nb);
  33. input2.reload(ComplexMathsBenchmarksQ31::INPUT2_Q31_ID,mgr,this->nb);
  34. input3.reload(ComplexMathsBenchmarksQ31::INPUT3_Q31_ID,mgr,this->nb);
  35. output.create(this->nb,ComplexMathsBenchmarksQ31::OUT_SAMPLES_Q31_ID,mgr);
  36. switch(id){
  37. case ComplexMathsBenchmarksQ31::VEC_CONJ_Q31_1:
  38. case ComplexMathsBenchmarksQ31::VEC_MAG_Q31_3:
  39. case ComplexMathsBenchmarksQ31::VEC_MAG_SQUARED_Q31_4:
  40. this->inp1=input1.ptr();
  41. this->outp=output.ptr();
  42. break;
  43. case ComplexMathsBenchmarksQ31::VEC_DOT_PROD_Q31_2:
  44. this->inp1=input1.ptr();
  45. this->inp2=input2.ptr();
  46. break;
  47. case ComplexMathsBenchmarksQ31::VEC_MULT_CMPLX_Q31_5:
  48. this->inp1=input1.ptr();
  49. this->inp2=input2.ptr();
  50. this->outp=output.ptr();
  51. break;
  52. case ComplexMathsBenchmarksQ31::VEC_MULT_REAL_Q31_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 ComplexMathsBenchmarksQ31::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
  61. {
  62. }