BinaryQ15.cpp 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #include "BinaryQ15.h"
  2. #include "Error.h"
  3. void BinaryQ15::test_mat_mult_q15()
  4. {
  5. arm_mat_mult_q15(&this->in1,&this->in2,&this->out,this->pState);
  6. }
  7. void BinaryQ15::test_mat_cmplx_mult_q15()
  8. {
  9. arm_mat_cmplx_mult_q15(&this->in1,&this->in2,&this->out,this->pState);
  10. }
  11. void BinaryQ15::test_mat_mult_fast_q15()
  12. {
  13. arm_mat_mult_fast_q15(&this->in1,&this->in2,&this->out,this->pState);
  14. }
  15. void BinaryQ15::setUp(Testing::testID_t id,std::vector<Testing::param_t>& params,Client::PatternMgr *mgr)
  16. {
  17. std::vector<Testing::param_t>::iterator it = params.begin();
  18. this->nbr = *it++;
  19. this->nbi = *it++;
  20. this->nbc = *it;
  21. switch(id)
  22. {
  23. case BinaryQ15::TEST_MAT_CMPLX_MULT_Q15_2:
  24. input1.reload(BinaryQ15::INPUTAC_Q15_ID,mgr,2*this->nbr*this->nbi);
  25. input2.reload(BinaryQ15::INPUTBC_Q15_ID,mgr,2*this->nbi*this->nbc);
  26. output.create(2*this->nbr*this->nbc,BinaryQ15::OUT_Q15_ID,mgr);
  27. state.create(2*this->nbi*this->nbc,BinaryQ15::OUT_Q15_ID,mgr);
  28. break;
  29. default:
  30. input1.reload(BinaryQ15::INPUTA_Q15_ID,mgr,this->nbr*this->nbi);
  31. input2.reload(BinaryQ15::INPUTB_Q15_ID,mgr,this->nbi*this->nbc);
  32. state.create(this->nbi*this->nbc,BinaryQ15::OUT_Q15_ID,mgr);
  33. output.create(this->nbr*this->nbc,BinaryQ15::OUT_Q15_ID,mgr);
  34. }
  35. this->in1.numRows = this->nbr;
  36. this->in1.numCols = this->nbi;
  37. this->in1.pData = input1.ptr();
  38. this->in2.numRows = this->nbi;
  39. this->in2.numCols = this->nbc;
  40. this->in2.pData = input2.ptr();
  41. this->out.numRows = this->nbr;
  42. this->out.numCols = this->nbc;
  43. this->out.pData = output.ptr();
  44. this->pState = state.ptr();
  45. }
  46. void BinaryQ15::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
  47. {
  48. }