ComplexMathsBenchmarksF32.cpp 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #include "ComplexMathsBenchmarksF32.h"
  2. #include "Error.h"
  3. void ComplexMathsBenchmarksF32::vec_conj_f32()
  4. {
  5. arm_cmplx_conj_f32(this->inp1,this->outp,this->nb);
  6. }
  7. void ComplexMathsBenchmarksF32::vec_dot_prod_f32()
  8. {
  9. float32_t real,imag;
  10. arm_cmplx_dot_prod_f32(this->inp1,this->inp2,this->nb,&real,&imag);
  11. }
  12. void ComplexMathsBenchmarksF32::vec_mag_f32()
  13. {
  14. arm_cmplx_mag_f32(this->inp1,this->outp,this->nb);
  15. }
  16. void ComplexMathsBenchmarksF32::vec_mag_squared_f32()
  17. {
  18. arm_cmplx_mag_squared_f32(this->inp1,this->outp,this->nb);
  19. }
  20. void ComplexMathsBenchmarksF32::vec_mult_cmplx_f32()
  21. {
  22. arm_cmplx_mult_cmplx_f32(this->inp1,this->inp2,this->outp,this->nb);
  23. }
  24. void ComplexMathsBenchmarksF32::vec_mult_real_f32()
  25. {
  26. arm_cmplx_mult_real_f32(this->inp1,this->inp3,this->outp,this->nb);
  27. }
  28. void ComplexMathsBenchmarksF32::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(ComplexMathsBenchmarksF32::INPUT1_F32_ID,mgr,this->nb);
  33. input2.reload(ComplexMathsBenchmarksF32::INPUT2_F32_ID,mgr,this->nb);
  34. input3.reload(ComplexMathsBenchmarksF32::INPUT3_F32_ID,mgr,this->nb);
  35. output.create(this->nb,ComplexMathsBenchmarksF32::OUT_SAMPLES_F32_ID,mgr);
  36. switch(id){
  37. case ComplexMathsBenchmarksF32::VEC_CONJ_F32_1:
  38. case ComplexMathsBenchmarksF32::VEC_MAG_F32_3:
  39. case ComplexMathsBenchmarksF32::VEC_MAG_SQUARED_F32_4:
  40. this->inp1=input1.ptr();
  41. this->outp=output.ptr();
  42. break;
  43. case ComplexMathsBenchmarksF32::VEC_DOT_PROD_F32_2:
  44. this->inp1=input1.ptr();
  45. this->inp2=input2.ptr();
  46. break;
  47. case ComplexMathsBenchmarksF32::VEC_MULT_CMPLX_F32_5:
  48. this->inp1=input1.ptr();
  49. this->inp2=input2.ptr();
  50. this->outp=output.ptr();
  51. break;
  52. case ComplexMathsBenchmarksF32::VEC_MULT_REAL_F32_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 ComplexMathsBenchmarksF32::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
  61. {
  62. }