UnaryQ31.cpp 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #include "UnaryQ31.h"
  2. #include "Error.h"
  3. void UnaryQ31::test_mat_scale_q31()
  4. {
  5. arm_mat_scale_q31(&this->in1,0x40000000,1,&this->out);
  6. }
  7. void UnaryQ31::test_mat_trans_q31()
  8. {
  9. arm_mat_trans_q31(&this->in1,&this->out);
  10. }
  11. void UnaryQ31::test_mat_cmplx_trans_q31()
  12. {
  13. arm_mat_cmplx_trans_q31(&this->in1,&this->out);
  14. }
  15. void UnaryQ31::test_mat_add_q31()
  16. {
  17. arm_mat_add_q31(&this->in1,&this->in1,&this->out);
  18. }
  19. void UnaryQ31::test_mat_sub_q31()
  20. {
  21. arm_mat_sub_q31(&this->in1,&this->in1,&this->out);
  22. }
  23. void UnaryQ31::test_mat_vec_mult_q31()
  24. {
  25. arm_mat_vec_mult_q31(&this->in1, vecp, outp);
  26. }
  27. void UnaryQ31::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_Q31_5:
  35. input1.reload(UnaryQ31::INPUTA_Q31_ID,mgr,this->nbr*this->nbc);
  36. vec.reload(UnaryQ31::INPUTVEC1_Q31_ID,mgr,this->nbc);
  37. output.create(this->nbr,UnaryQ31::OUT_Q31_ID,mgr);
  38. vecp=vec.ptr();
  39. outp=output.ptr();
  40. break;
  41. case TEST_MAT_TRANS_Q31_2:
  42. input1.reload(UnaryQ31::INPUTA_Q31_ID,mgr,this->nbr*this->nbc);
  43. output.create(this->nbr*this->nbc,UnaryQ31::OUT_Q31_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_Q31_6:
  49. input1.reload(UnaryQ31::INPUTAC_Q31_ID,mgr,2*this->nbr*this->nbc);
  50. output.create(2*this->nbr*this->nbc,UnaryQ31::OUT_Q31_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(UnaryQ31::INPUTA_Q31_ID,mgr,this->nbr*this->nbc);
  57. output.create(this->nbr*this->nbc,UnaryQ31::OUT_Q31_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 UnaryQ31::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
  68. {
  69. }