1 #include "SupportF32.h" 2 #include "Error.h" 3 4 test_copy_f32()5 void SupportF32::test_copy_f32() 6 { 7 arm_copy_f32(this->pSrc,this->pDst,this->nbSamples); 8 } 9 test_fill_f32()10 void SupportF32::test_fill_f32() 11 { 12 arm_fill_f32(0,this->pDst,this->nbSamples); 13 } 14 test_q7_to_f32()15 void SupportF32::test_q7_to_f32() 16 { 17 arm_q7_to_float(this->pSrcQ7,this->pDst,this->nbSamples); 18 } 19 test_q15_to_f32()20 void SupportF32::test_q15_to_f32() 21 { 22 arm_q15_to_float(this->pSrcQ15,this->pDst,this->nbSamples); 23 } 24 test_q31_to_f32()25 void SupportF32::test_q31_to_f32() 26 { 27 arm_q31_to_float(this->pSrcQ31,this->pDst,this->nbSamples); 28 } 29 test_weighted_average_f32()30 void SupportF32::test_weighted_average_f32() 31 { 32 arm_weighted_average_f32(this->pSrc, this->pWeights,this->nbSamples); 33 } 34 setUp(Testing::testID_t id,std::vector<Testing::param_t> & params,Client::PatternMgr * mgr)35 void SupportF32::setUp(Testing::testID_t id,std::vector<Testing::param_t>& params,Client::PatternMgr *mgr) 36 { 37 38 39 std::vector<Testing::param_t>::iterator it = params.begin(); 40 this->nbSamples = *it; 41 42 output.create(this->nbSamples,SupportF32::OUT_SAMPLES_F32_ID,mgr); 43 44 switch(id) 45 { 46 case TEST_COPY_F32_1: 47 case TEST_FILL_F32_2: 48 samples.reload(SupportF32::SAMPLES_F32_ID,mgr,this->nbSamples); 49 this->pSrc=samples.ptr(); 50 break; 51 52 case TEST_Q15_TO_F32_3: 53 samplesQ15.reload(SupportF32::SAMPLES_Q15_ID,mgr,this->nbSamples); 54 this->pSrcQ15=samplesQ15.ptr(); 55 break; 56 57 case TEST_Q31_TO_F32_4: 58 samplesQ31.reload(SupportF32::SAMPLES_Q31_ID,mgr,this->nbSamples); 59 this->pSrcQ31=samplesQ31.ptr(); 60 break; 61 62 case TEST_Q7_TO_F32_5: 63 samplesQ7.reload(SupportF32::SAMPLES_Q7_ID,mgr,this->nbSamples); 64 this->pSrcQ7=samplesQ7.ptr(); 65 break; 66 67 case TEST_WEIGHTED_AVERAGE_F32_6: 68 samples.reload(SupportF32::INPUTS6_F32_ID,mgr,this->nbSamples); 69 weights.reload(SupportF32::WEIGHTS6_F32_ID,mgr,this->nbSamples); 70 71 this->pSrc=samples.ptr(); 72 this->pWeights=weights.ptr(); 73 break; 74 75 } 76 77 this->pDst=output.ptr(); 78 79 } 80 tearDown(Testing::testID_t id,Client::PatternMgr * mgr)81 void SupportF32::tearDown(Testing::testID_t id,Client::PatternMgr *mgr) 82 { 83 } 84