UnaryF32.cpp 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. #include "UnaryF32.h"
  2. #include "Error.h"
  3. void UnaryF32::test_mat_scale_f32()
  4. {
  5. arm_mat_scale_f32(&this->in1,0.5,&this->out);
  6. }
  7. void UnaryF32::test_mat_inverse_f32()
  8. {
  9. arm_mat_inverse_f32(&this->in1,&this->out);
  10. }
  11. void UnaryF32::test_mat_trans_f32()
  12. {
  13. arm_mat_trans_f32(&this->in1,&this->out);
  14. }
  15. void UnaryF32::test_mat_cmplx_trans_f32()
  16. {
  17. arm_mat_cmplx_trans_f32(&this->in1,&this->out);
  18. }
  19. void UnaryF32::test_mat_add_f32()
  20. {
  21. arm_mat_add_f32(&this->in1,&this->in1,&this->out);
  22. }
  23. void UnaryF32::test_mat_sub_f32()
  24. {
  25. arm_mat_sub_f32(&this->in1,&this->in1,&this->out);
  26. }
  27. void UnaryF32::test_mat_vec_mult_f32()
  28. {
  29. arm_mat_vec_mult_f32(&this->in1, vecp, outp);
  30. }
  31. void UnaryF32::setUp(Testing::testID_t id,std::vector<Testing::param_t>& params,Client::PatternMgr *mgr)
  32. {
  33. std::vector<Testing::param_t>::iterator it = params.begin();
  34. this->nbr = *it++;
  35. this->nbc = *it;
  36. switch(id)
  37. {
  38. case TEST_MAT_VEC_MULT_F32_6:
  39. input1.reload(UnaryF32::INPUTA_F32_ID,mgr,this->nbr*this->nbc);
  40. vec.reload(UnaryF32::INPUTVEC1_F32_ID,mgr,this->nbc);
  41. output.create(this->nbr,UnaryF32::OUT_F32_ID,mgr);
  42. vecp=vec.ptr();
  43. outp=output.ptr();
  44. break;
  45. case TEST_MAT_TRANS_F32_3:
  46. input1.reload(UnaryF32::INPUTA_F32_ID,mgr,this->nbr*this->nbc);
  47. output.create(this->nbr*this->nbc,UnaryF32::OUT_F32_ID,mgr);
  48. this->out.numRows = this->nbc;
  49. this->out.numCols = this->nbr;
  50. this->out.pData = output.ptr();
  51. break;
  52. case TEST_MAT_CMPLX_TRANS_F32_7:
  53. input1.reload(UnaryF32::INPUTAC_F32_ID,mgr,2*this->nbr*this->nbc);
  54. output.create(2*this->nbr*this->nbc,UnaryF32::OUT_F32_ID,mgr);
  55. this->out.numRows = this->nbc;
  56. this->out.numCols = this->nbr;
  57. this->out.pData = output.ptr();
  58. break;
  59. default:
  60. input1.reload(UnaryF32::INPUTA_F32_ID,mgr,this->nbr*this->nbc);
  61. output.create(this->nbr*this->nbc,UnaryF32::OUT_F32_ID,mgr);
  62. this->out.numRows = this->nbr;
  63. this->out.numCols = this->nbc;
  64. this->out.pData = output.ptr();
  65. break;
  66. }
  67. this->in1.numRows = this->nbr;
  68. this->in1.numCols = this->nbc;
  69. this->in1.pData = input1.ptr();
  70. }
  71. void UnaryF32::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
  72. {
  73. }