ComplexMathsBenchmarksF16.cpp 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #include "ComplexMathsBenchmarksF16.h"
  2. #include "Error.h"
  3. void ComplexMathsBenchmarksF16::vec_conj_f16()
  4. {
  5. arm_cmplx_conj_f16(this->inp1,this->outp,this->nb);
  6. }
  7. void ComplexMathsBenchmarksF16::vec_dot_prod_f16()
  8. {
  9. float16_t real,imag;
  10. arm_cmplx_dot_prod_f16(this->inp1,this->inp2,this->nb,&real,&imag);
  11. }
  12. void ComplexMathsBenchmarksF16::vec_mag_f16()
  13. {
  14. arm_cmplx_mag_f16(this->inp1,this->outp,this->nb);
  15. }
  16. void ComplexMathsBenchmarksF16::vec_mag_squared_f16()
  17. {
  18. arm_cmplx_mag_squared_f16(this->inp1,this->outp,this->nb);
  19. }
  20. void ComplexMathsBenchmarksF16::vec_mult_cmplx_f16()
  21. {
  22. arm_cmplx_mult_cmplx_f16(this->inp1,this->inp2,this->outp,this->nb);
  23. }
  24. void ComplexMathsBenchmarksF16::vec_mult_real_f16()
  25. {
  26. arm_cmplx_mult_real_f16(this->inp1,this->inp3,this->outp,this->nb);
  27. }
  28. void ComplexMathsBenchmarksF16::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(ComplexMathsBenchmarksF16::INPUT1_F16_ID,mgr,this->nb);
  33. input2.reload(ComplexMathsBenchmarksF16::INPUT2_F16_ID,mgr,this->nb);
  34. input3.reload(ComplexMathsBenchmarksF16::INPUT3_F16_ID,mgr,this->nb);
  35. output.create(this->nb,ComplexMathsBenchmarksF16::OUT_SAMPLES_F16_ID,mgr);
  36. switch(id){
  37. case ComplexMathsBenchmarksF16::VEC_CONJ_F16_1:
  38. case ComplexMathsBenchmarksF16::VEC_MAG_F16_3:
  39. case ComplexMathsBenchmarksF16::VEC_MAG_SQUARED_F16_4:
  40. this->inp1=input1.ptr();
  41. this->outp=output.ptr();
  42. break;
  43. case ComplexMathsBenchmarksF16::VEC_DOT_PROD_F16_2:
  44. this->inp1=input1.ptr();
  45. this->inp2=input2.ptr();
  46. break;
  47. case ComplexMathsBenchmarksF16::VEC_MULT_CMPLX_F16_5:
  48. this->inp1=input1.ptr();
  49. this->inp2=input2.ptr();
  50. this->outp=output.ptr();
  51. break;
  52. case ComplexMathsBenchmarksF16::VEC_MULT_REAL_F16_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 ComplexMathsBenchmarksF16::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
  61. {
  62. (void)id;
  63. (void)mgr;
  64. }