1 #include "ComplexMathsBenchmarksQ15.h" 2 #include "Error.h" 3 4 vec_conj_q15()5 void ComplexMathsBenchmarksQ15::vec_conj_q15() 6 { 7 arm_cmplx_conj_q15(this->inp1,this->outp,this->nb); 8 } 9 vec_dot_prod_q15()10 void ComplexMathsBenchmarksQ15::vec_dot_prod_q15() 11 { 12 q31_t real,imag; 13 14 arm_cmplx_dot_prod_q15(this->inp1,this->inp2,this->nb,&real,&imag); 15 } 16 vec_mag_q15()17 void ComplexMathsBenchmarksQ15::vec_mag_q15() 18 { 19 arm_cmplx_mag_q15(this->inp1,this->outp,this->nb); 20 } 21 vec_mag_squared_q15()22 void ComplexMathsBenchmarksQ15::vec_mag_squared_q15() 23 { 24 arm_cmplx_mag_squared_q15(this->inp1,this->outp,this->nb); 25 } 26 vec_mult_cmplx_q15()27 void ComplexMathsBenchmarksQ15::vec_mult_cmplx_q15() 28 { 29 arm_cmplx_mult_cmplx_q15(this->inp1,this->inp2,this->outp,this->nb); 30 } 31 vec_mult_real_q15()32 void ComplexMathsBenchmarksQ15::vec_mult_real_q15() 33 { 34 arm_cmplx_mult_real_q15(this->inp1,this->inp3,this->outp,this->nb); 35 } 36 37 setUp(Testing::testID_t id,std::vector<Testing::param_t> & params,Client::PatternMgr * mgr)38 void ComplexMathsBenchmarksQ15::setUp(Testing::testID_t id,std::vector<Testing::param_t>& params,Client::PatternMgr *mgr) 39 { 40 41 42 std::vector<Testing::param_t>::iterator it = params.begin(); 43 this->nb = *it; 44 45 input1.reload(ComplexMathsBenchmarksQ15::INPUT1_Q15_ID,mgr,this->nb); 46 input2.reload(ComplexMathsBenchmarksQ15::INPUT2_Q15_ID,mgr,this->nb); 47 input3.reload(ComplexMathsBenchmarksQ15::INPUT3_Q15_ID,mgr,this->nb); 48 49 output.create(this->nb,ComplexMathsBenchmarksQ15::OUT_SAMPLES_Q15_ID,mgr); 50 51 switch(id){ 52 case ComplexMathsBenchmarksQ15::VEC_CONJ_Q15_1: 53 case ComplexMathsBenchmarksQ15::VEC_MAG_Q15_3: 54 case ComplexMathsBenchmarksQ15::VEC_MAG_SQUARED_Q15_4: 55 this->inp1=input1.ptr(); 56 this->outp=output.ptr(); 57 break; 58 59 case ComplexMathsBenchmarksQ15::VEC_DOT_PROD_Q15_2: 60 this->inp1=input1.ptr(); 61 this->inp2=input2.ptr(); 62 break; 63 64 case ComplexMathsBenchmarksQ15::VEC_MULT_CMPLX_Q15_5: 65 this->inp1=input1.ptr(); 66 this->inp2=input2.ptr(); 67 this->outp=output.ptr(); 68 break; 69 70 case ComplexMathsBenchmarksQ15::VEC_MULT_REAL_Q15_6: 71 this->inp1=input1.ptr(); 72 // Real input 73 this->inp3=input3.ptr(); 74 this->outp=output.ptr(); 75 break; 76 } 77 78 } 79 tearDown(Testing::testID_t id,Client::PatternMgr * mgr)80 void ComplexMathsBenchmarksQ15::tearDown(Testing::testID_t id,Client::PatternMgr *mgr) 81 { 82 } 83