SupportF16.cpp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #include "SupportF16.h"
  2. #include "Error.h"
  3. void SupportF16::test_copy_f16()
  4. {
  5. arm_copy_f16(this->pSrc,this->pDst,this->nbSamples);
  6. }
  7. void SupportF16::test_fill_f16()
  8. {
  9. arm_fill_f16(0,this->pDst,this->nbSamples);
  10. }
  11. void SupportF16::test_q15_to_f16()
  12. {
  13. arm_q15_to_f16(this->pSrcQ15,this->pDst,this->nbSamples);
  14. }
  15. void SupportF16::test_f32_to_f16()
  16. {
  17. arm_float_to_f16(this->pSrcF32,this->pDst,this->nbSamples);
  18. }
  19. void SupportF16::test_weighted_sum_f16()
  20. {
  21. arm_weighted_sum_f16(this->pSrc, this->pWeights,this->nbSamples);
  22. }
  23. void SupportF16::setUp(Testing::testID_t id,std::vector<Testing::param_t>& params,Client::PatternMgr *mgr)
  24. {
  25. std::vector<Testing::param_t>::iterator it = params.begin();
  26. this->nbSamples = *it;
  27. output.create(this->nbSamples,SupportF16::OUT_SAMPLES_F16_ID,mgr);
  28. switch(id)
  29. {
  30. case TEST_COPY_F16_1:
  31. case TEST_FILL_F16_2:
  32. samples.reload(SupportF16::SAMPLES_F16_ID,mgr,this->nbSamples);
  33. this->pSrc=samples.ptr();
  34. break;
  35. case TEST_Q15_TO_F16_3:
  36. samplesQ15.reload(SupportF16::SAMPLES_Q15_ID,mgr,this->nbSamples);
  37. this->pSrcQ15=samplesQ15.ptr();
  38. break;
  39. case TEST_F32_TO_F16_4:
  40. samplesF32.reload(SupportF16::SAMPLES_F32_ID,mgr,this->nbSamples);
  41. this->pSrcF32=samplesF32.ptr();
  42. break;
  43. case TEST_WEIGHTED_SUM_F16_5:
  44. samples.reload(SupportF16::INPUTS6_F16_ID,mgr,this->nbSamples);
  45. weights.reload(SupportF16::WEIGHTS6_F16_ID,mgr,this->nbSamples);
  46. this->pSrc=samples.ptr();
  47. this->pWeights=weights.ptr();
  48. break;
  49. }
  50. this->pDst=output.ptr();
  51. }
  52. void SupportF16::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
  53. {
  54. (void)id;
  55. (void)mgr;
  56. }