SupportF32.cpp 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #include "SupportF32.h"
  2. #include "Error.h"
  3. void SupportF32::test_copy_f32()
  4. {
  5. arm_copy_f32(this->pSrc,this->pDst,this->nbSamples);
  6. }
  7. void SupportF32::test_fill_f32()
  8. {
  9. arm_fill_f32(0,this->pDst,this->nbSamples);
  10. }
  11. void SupportF32::test_q7_to_f32()
  12. {
  13. arm_q7_to_float(this->pSrcQ7,this->pDst,this->nbSamples);
  14. }
  15. void SupportF32::test_q15_to_f32()
  16. {
  17. arm_q15_to_float(this->pSrcQ15,this->pDst,this->nbSamples);
  18. }
  19. void SupportF32::test_q31_to_f32()
  20. {
  21. arm_q31_to_float(this->pSrcQ31,this->pDst,this->nbSamples);
  22. }
  23. void SupportF32::test_weighted_sum_f32()
  24. {
  25. arm_weighted_sum_f32(this->pSrc, this->pWeights,this->nbSamples);
  26. }
  27. void SupportF32::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->nbSamples = *it;
  31. output.create(this->nbSamples,SupportF32::OUT_SAMPLES_F32_ID,mgr);
  32. switch(id)
  33. {
  34. case TEST_COPY_F32_1:
  35. case TEST_FILL_F32_2:
  36. samples.reload(SupportF32::SAMPLES_F32_ID,mgr,this->nbSamples);
  37. this->pSrc=samples.ptr();
  38. break;
  39. case TEST_Q15_TO_F32_3:
  40. samplesQ15.reload(SupportF32::SAMPLES_Q15_ID,mgr,this->nbSamples);
  41. this->pSrcQ15=samplesQ15.ptr();
  42. break;
  43. case TEST_Q31_TO_F32_4:
  44. samplesQ31.reload(SupportF32::SAMPLES_Q31_ID,mgr,this->nbSamples);
  45. this->pSrcQ31=samplesQ31.ptr();
  46. break;
  47. case TEST_Q7_TO_F32_5:
  48. samplesQ7.reload(SupportF32::SAMPLES_Q7_ID,mgr,this->nbSamples);
  49. this->pSrcQ7=samplesQ7.ptr();
  50. break;
  51. case TEST_WEIGHTED_SUM_F32_6:
  52. samples.reload(SupportF32::INPUTS6_F32_ID,mgr,this->nbSamples);
  53. weights.reload(SupportF32::WEIGHTS6_F32_ID,mgr,this->nbSamples);
  54. this->pSrc=samples.ptr();
  55. this->pWeights=weights.ptr();
  56. break;
  57. }
  58. this->pDst=output.ptr();
  59. }
  60. void SupportF32::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
  61. {
  62. }