ComplexMathsBenchmarksQ15.cpp 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #include "ComplexMathsBenchmarksQ15.h"
  2. #include "Error.h"
  3. void ComplexMathsBenchmarksQ15::vec_conj_q15()
  4. {
  5. const q15_t *inp1=input1.ptr();
  6. q15_t *outp=output.ptr();
  7. arm_cmplx_conj_q15(inp1,outp,this->nb);
  8. }
  9. void ComplexMathsBenchmarksQ15::vec_dot_prod_q15()
  10. {
  11. const q15_t *inp1=input1.ptr();
  12. const q15_t *inp2=input2.ptr();
  13. q31_t real,imag;
  14. arm_cmplx_dot_prod_q15(inp1,inp2,this->nb,&real,&imag);
  15. }
  16. void ComplexMathsBenchmarksQ15::vec_mag_q15()
  17. {
  18. const q15_t *inp1=input1.ptr();
  19. q15_t *outp=output.ptr();
  20. arm_cmplx_mag_q15(inp1,outp,this->nb);
  21. }
  22. void ComplexMathsBenchmarksQ15::vec_mag_squared_q15()
  23. {
  24. const q15_t *inp1=input1.ptr();
  25. q15_t *outp=output.ptr();
  26. arm_cmplx_mag_squared_q15(inp1,outp,this->nb);
  27. }
  28. void ComplexMathsBenchmarksQ15::vec_mult_cmplx_q15()
  29. {
  30. const q15_t *inp1=input1.ptr();
  31. const q15_t *inp2=input2.ptr();
  32. q15_t *outp=output.ptr();
  33. arm_cmplx_mult_cmplx_q15(inp1,inp2,outp,this->nb);
  34. }
  35. void ComplexMathsBenchmarksQ15::vec_mult_real_q15()
  36. {
  37. const q15_t *inp1=input1.ptr();
  38. // Real input
  39. const q15_t *inp3=input3.ptr();
  40. q15_t *outp=output.ptr();
  41. arm_cmplx_mult_real_q15(inp1,inp3,outp,this->nb);
  42. }
  43. void ComplexMathsBenchmarksQ15::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(ComplexMathsBenchmarksQ15::INPUT1_Q15_ID,mgr,this->nb);
  48. input2.reload(ComplexMathsBenchmarksQ15::INPUT2_Q15_ID,mgr,this->nb);
  49. input3.reload(ComplexMathsBenchmarksQ15::INPUT3_Q15_ID,mgr,this->nb);
  50. output.create(this->nb,ComplexMathsBenchmarksQ15::OUT_SAMPLES_Q15_ID,mgr);
  51. }
  52. void ComplexMathsBenchmarksQ15::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
  53. {
  54. }