ComplexMathsBenchmarksF32.cpp 2.1 KB

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