1 #include "TransformF16.h" 2 #include "Error.h" 3 test_cfft_f16()4 void TransformF16::test_cfft_f16() 5 { 6 arm_cfft_f16(&(this->cfftInstance), this->pDst, this->ifft,this->bitRev); 7 } 8 test_rfft_f16()9 void TransformF16::test_rfft_f16() 10 { 11 arm_rfft_fast_f16(&this->rfftFastInstance, this->pTmp, this->pDst, this->ifft); 12 } 13 test_cfft_radix4_f16()14 void TransformF16::test_cfft_radix4_f16() 15 { 16 arm_cfft_radix4_f16(&this->cfftRadix4Instance,this->pDst); 17 } 18 test_cfft_radix2_f16()19 void TransformF16::test_cfft_radix2_f16() 20 { 21 arm_cfft_radix2_f16(&this->cfftRadix2Instance,this->pDst); 22 } 23 24 setUp(Testing::testID_t id,std::vector<Testing::param_t> & params,Client::PatternMgr * mgr)25 void TransformF16::setUp(Testing::testID_t id,std::vector<Testing::param_t>& params,Client::PatternMgr *mgr) 26 { 27 28 29 std::vector<Testing::param_t>::iterator it = params.begin(); 30 this->nbSamples = *it++; 31 this->ifft = *it++; 32 this->bitRev = *it; 33 34 switch(id) 35 { 36 case TEST_CFFT_F16_1: 37 samples.reload(TransformF16::INPUTC_F16_ID,mgr,2*this->nbSamples); 38 output.create(2*this->nbSamples,TransformF16::OUT_F16_ID,mgr); 39 40 this->pSrc=samples.ptr(); 41 this->pDst=output.ptr(); 42 43 status=arm_cfft_init_f16(&cfftInstance,this->nbSamples); 44 memcpy(this->pDst,this->pSrc,2*sizeof(float16_t)*this->nbSamples); 45 break; 46 47 case TEST_RFFT_F16_2: 48 { 49 // Factor 2 for irfft 50 samples.reload(TransformF16::INPUTR_F16_ID,mgr,2*this->nbSamples); 51 output.create(2*this->nbSamples,TransformF16::OUT_F16_ID,mgr); 52 tmp.create(2*this->nbSamples,TransformF16::TMP_F16_ID,mgr); 53 54 this->pSrc=samples.ptr(); 55 this->pDst=output.ptr(); 56 this->pTmp=tmp.ptr(); 57 58 memcpy(this->pTmp,this->pSrc,sizeof(float16_t)*this->nbSamples); 59 60 61 arm_rfft_fast_init_f16(&this->rfftFastInstance, this->nbSamples); 62 } 63 break; 64 65 case TEST_CFFT_RADIX4_F16_3: 66 samples.reload(TransformF16::INPUTC_F16_ID,mgr,2*this->nbSamples); 67 output.create(2*this->nbSamples,TransformF16::OUT_F16_ID,mgr); 68 69 this->pSrc=samples.ptr(); 70 this->pDst=output.ptr(); 71 72 73 memcpy(this->pDst,this->pSrc,2*sizeof(float16_t)*this->nbSamples); 74 75 arm_cfft_radix4_init_f16(&this->cfftRadix4Instance, 76 this->nbSamples, 77 this->ifft, 78 this->bitRev); 79 80 break; 81 82 case TEST_CFFT_RADIX2_F16_4: 83 samples.reload(TransformF16::INPUTC_F16_ID,mgr,2*this->nbSamples); 84 output.create(2*this->nbSamples,TransformF16::OUT_F16_ID,mgr); 85 86 this->pSrc=samples.ptr(); 87 this->pDst=output.ptr(); 88 89 90 memcpy(this->pDst,this->pSrc,2*sizeof(float16_t)*this->nbSamples); 91 92 arm_cfft_radix2_init_f16(&this->cfftRadix2Instance, 93 this->nbSamples, 94 this->ifft, 95 this->bitRev); 96 break; 97 98 } 99 100 101 102 103 } 104 tearDown(Testing::testID_t id,Client::PatternMgr * mgr)105 void TransformF16::tearDown(Testing::testID_t id,Client::PatternMgr *mgr) 106 { 107 (void)id; 108 (void)mgr; 109 } 110