UnaryQ15.cpp 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #include "UnaryQ15.h"
  2. #include "Error.h"
  3. void UnaryQ15::test_mat_scale_q15()
  4. {
  5. arm_mat_scale_q15(&this->in1,0x4000,1,&this->out);
  6. }
  7. void UnaryQ15::test_mat_trans_q15()
  8. {
  9. arm_mat_trans_q15(&this->in1,&this->out);
  10. }
  11. void UnaryQ15::test_mat_cmplx_trans_q15()
  12. {
  13. arm_mat_cmplx_trans_q15(&this->in1,&this->out);
  14. }
  15. void UnaryQ15::test_mat_add_q15()
  16. {
  17. arm_mat_add_q15(&this->in1,&this->in1,&this->out);
  18. }
  19. void UnaryQ15::test_mat_sub_q15()
  20. {
  21. arm_mat_sub_q15(&this->in1,&this->in1,&this->out);
  22. }
  23. void UnaryQ15::test_mat_vec_mult_q15()
  24. {
  25. arm_mat_vec_mult_q15(&this->in1, vecp, outp);
  26. }
  27. void UnaryQ15::setUp(Testing::testID_t id,std::vector<Testing::param_t>& params,Client::PatternMgr *mgr)
  28. {
  29. std::vector<Testing::param_t>::iterator it = params.begin();
  30. this->nbr = *it++;
  31. this->nbc = *it;
  32. switch(id)
  33. {
  34. case TEST_MAT_VEC_MULT_Q15_5:
  35. input1.reload(UnaryQ15::INPUTA_Q15_ID,mgr,this->nbr*this->nbc);
  36. vec.reload(UnaryQ15::INPUTVEC1_Q15_ID,mgr,this->nbc);
  37. output.create(this->nbr,UnaryQ15::OUT_Q15_ID,mgr);
  38. vecp=vec.ptr();
  39. outp=output.ptr();
  40. break;
  41. case TEST_MAT_TRANS_Q15_2:
  42. input1.reload(UnaryQ15::INPUTA_Q15_ID,mgr,this->nbr*this->nbc);
  43. output.create(this->nbr*this->nbc,UnaryQ15::OUT_Q15_ID,mgr);
  44. this->out.numRows = this->nbc;
  45. this->out.numCols = this->nbr;
  46. this->out.pData = output.ptr();
  47. break;
  48. case TEST_MAT_CMPLX_TRANS_Q15_6:
  49. input1.reload(UnaryQ15::INPUTAC_Q15_ID,mgr,2*this->nbr*this->nbc);
  50. output.create(2*this->nbr*this->nbc,UnaryQ15::OUT_Q15_ID,mgr);
  51. this->out.numRows = this->nbc;
  52. this->out.numCols = this->nbr;
  53. this->out.pData = output.ptr();
  54. break;
  55. default:
  56. input1.reload(UnaryQ15::INPUTA_Q15_ID,mgr,this->nbr*this->nbc);
  57. output.create(this->nbr*this->nbc,UnaryQ15::OUT_Q15_ID,mgr);
  58. this->out.numRows = this->nbr;
  59. this->out.numCols = this->nbc;
  60. this->out.pData = output.ptr();
  61. break;
  62. }
  63. this->in1.numRows = this->nbr;
  64. this->in1.numCols = this->nbc;
  65. this->in1.pData = input1.ptr();
  66. }
  67. void UnaryQ15::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
  68. {
  69. }