BinaryQ31.cpp 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #include "BinaryQ31.h"
  2. #include "Error.h"
  3. void BinaryQ31::test_mat_mult_q31()
  4. {
  5. arm_mat_mult_q31(&this->in1,&this->in2,&this->out);
  6. }
  7. void BinaryQ31::test_mat_cmplx_mult_q31()
  8. {
  9. arm_mat_cmplx_mult_q31(&this->in1,&this->in2,&this->out);
  10. }
  11. void BinaryQ31::test_mat_mult_fast_q31()
  12. {
  13. arm_mat_mult_fast_q31(&this->in1,&this->in2,&this->out);
  14. }
  15. void BinaryQ31::test_mat_mult_opt_q31()
  16. {
  17. arm_mat_mult_opt_q31(&this->in1,&this->in2,&this->out,this->tmpPtr);
  18. }
  19. void BinaryQ31::setUp(Testing::testID_t id,std::vector<Testing::param_t>& params,Client::PatternMgr *mgr)
  20. {
  21. std::vector<Testing::param_t>::iterator it = params.begin();
  22. this->nbr = *it++;
  23. this->nbi = *it++;
  24. this->nbc = *it;
  25. switch(id)
  26. {
  27. case BinaryQ31::TEST_MAT_CMPLX_MULT_Q31_2:
  28. input1.reload(BinaryQ31::INPUTAC_Q31_ID,mgr,2*this->nbr*this->nbi);
  29. input2.reload(BinaryQ31::INPUTBC_Q31_ID,mgr,2*this->nbi*this->nbc);
  30. output.create(2*this->nbr*this->nbc,BinaryQ31::OUT_Q31_ID,mgr);
  31. break;
  32. case BinaryQ31::TEST_MAT_MULT_OPT_Q31_4:
  33. input1.reload(BinaryQ31::INPUTA_Q31_ID,mgr,this->nbr*this->nbi);
  34. input2.reload(BinaryQ31::INPUTB_Q31_ID,mgr,this->nbi*this->nbc);
  35. output.create(this->nbr*this->nbc,BinaryQ31::OUT_Q31_ID,mgr);
  36. tmp.create(this->nbi*this->nbc,BinaryQ31::TMP_Q31_ID,mgr);
  37. this->tmpPtr=tmp.ptr();
  38. break;
  39. default:
  40. input1.reload(BinaryQ31::INPUTA_Q31_ID,mgr,this->nbr*this->nbi);
  41. input2.reload(BinaryQ31::INPUTB_Q31_ID,mgr,this->nbi*this->nbc);
  42. output.create(this->nbr*this->nbc,BinaryQ31::OUT_Q31_ID,mgr);
  43. }
  44. this->in1.numRows = this->nbr;
  45. this->in1.numCols = this->nbi;
  46. this->in1.pData = input1.ptr();
  47. this->in2.numRows = this->nbi;
  48. this->in2.numCols = this->nbc;
  49. this->in2.pData = input2.ptr();
  50. this->out.numRows = this->nbr;
  51. this->out.numCols = this->nbc;
  52. this->out.pData = output.ptr();
  53. }
  54. void BinaryQ31::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
  55. {
  56. }