TransformF16.cpp 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #include "TransformF16.h"
  2. #include "Error.h"
  3. void TransformF16::test_cfft_f16()
  4. {
  5. arm_cfft_f16(&(this->cfftInstance), this->pDst, this->ifft,this->bitRev);
  6. }
  7. void TransformF16::test_rfft_f16()
  8. {
  9. arm_rfft_fast_f16(&this->rfftFastInstance, this->pSrc, this->pDst, this->ifft);
  10. }
  11. void TransformF16::test_cfft_radix4_f16()
  12. {
  13. arm_cfft_radix4_f16(&this->cfftRadix4Instance,this->pDst);
  14. }
  15. void TransformF16::test_cfft_radix2_f16()
  16. {
  17. arm_cfft_radix2_f16(&this->cfftRadix2Instance,this->pDst);
  18. }
  19. void TransformF16::setUp(Testing::testID_t id,std::vector<Testing::param_t>& params,Client::PatternMgr *mgr)
  20. {
  21. std::vector<Testing::param_t>::iterator it = params.begin();
  22. this->nbSamples = *it++;
  23. this->ifft = *it++;
  24. this->bitRev = *it;
  25. switch(id)
  26. {
  27. case TEST_CFFT_F16_1:
  28. samples.reload(TransformF16::INPUTC_F16_ID,mgr,2*this->nbSamples);
  29. output.create(2*this->nbSamples,TransformF16::OUT_F16_ID,mgr);
  30. this->pSrc=samples.ptr();
  31. this->pDst=output.ptr();
  32. status=arm_cfft_init_f16(&cfftInstance,this->nbSamples);
  33. memcpy(this->pDst,this->pSrc,2*sizeof(float16_t)*this->nbSamples);
  34. break;
  35. case TEST_RFFT_F16_2:
  36. samples.reload(TransformF16::INPUTR_F16_ID,mgr,this->nbSamples);
  37. output.create(this->nbSamples,TransformF16::OUT_F16_ID,mgr);
  38. this->pSrc=samples.ptr();
  39. this->pDst=output.ptr();
  40. arm_rfft_fast_init_f16(&this->rfftFastInstance, this->nbSamples);
  41. break;
  42. case TEST_CFFT_RADIX4_F16_3:
  43. samples.reload(TransformF16::INPUTC_F16_ID,mgr,2*this->nbSamples);
  44. output.create(2*this->nbSamples,TransformF16::OUT_F16_ID,mgr);
  45. this->pSrc=samples.ptr();
  46. this->pDst=output.ptr();
  47. memcpy(this->pDst,this->pSrc,2*sizeof(float16_t)*this->nbSamples);
  48. arm_cfft_radix4_init_f16(&this->cfftRadix4Instance,
  49. this->nbSamples,
  50. this->ifft,
  51. this->bitRev);
  52. break;
  53. case TEST_CFFT_RADIX2_F16_4:
  54. samples.reload(TransformF16::INPUTC_F16_ID,mgr,2*this->nbSamples);
  55. output.create(2*this->nbSamples,TransformF16::OUT_F16_ID,mgr);
  56. this->pSrc=samples.ptr();
  57. this->pDst=output.ptr();
  58. memcpy(this->pDst,this->pSrc,2*sizeof(float16_t)*this->nbSamples);
  59. arm_cfft_radix2_init_f16(&this->cfftRadix2Instance,
  60. this->nbSamples,
  61. this->ifft,
  62. this->bitRev);
  63. break;
  64. }
  65. }
  66. void TransformF16::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
  67. {
  68. }