1 #include "BasicMathsBenchmarksQ15.h" 2 #include "Error.h" 3 4 vec_mult_q15()5 void BasicMathsBenchmarksQ15::vec_mult_q15() 6 { 7 arm_mult_q15(this->inp1,this->inp2,this->outp,this->nb); 8 } 9 vec_add_q15()10 void BasicMathsBenchmarksQ15::vec_add_q15() 11 { 12 arm_add_q15(this->inp1,this->inp2,this->outp,this->nb); 13 } 14 vec_sub_q15()15 void BasicMathsBenchmarksQ15::vec_sub_q15() 16 { 17 arm_sub_q15(this->inp1,this->inp2,this->outp,this->nb); 18 } 19 vec_abs_q15()20 void BasicMathsBenchmarksQ15::vec_abs_q15() 21 { 22 arm_abs_q15(this->inp1,this->outp,this->nb); 23 } 24 vec_negate_q15()25 void BasicMathsBenchmarksQ15::vec_negate_q15() 26 { 27 arm_negate_q15(this->inp1,this->outp,this->nb); 28 } 29 vec_offset_q15()30 void BasicMathsBenchmarksQ15::vec_offset_q15() 31 { 32 arm_offset_q15(this->inp1,1.0,this->outp,this->nb); 33 } 34 vec_scale_q15()35 void BasicMathsBenchmarksQ15::vec_scale_q15() 36 { 37 arm_scale_q15(this->inp1,0x45,1,this->outp,this->nb); 38 } 39 vec_dot_q15()40 void BasicMathsBenchmarksQ15::vec_dot_q15() 41 { 42 q63_t result; 43 44 arm_dot_prod_q15(this->inp1,this->inp2,this->nb,&result); 45 } 46 47 48 setUp(Testing::testID_t id,std::vector<Testing::param_t> & params,Client::PatternMgr * mgr)49 void BasicMathsBenchmarksQ15::setUp(Testing::testID_t id,std::vector<Testing::param_t>& params,Client::PatternMgr *mgr) 50 { 51 52 53 std::vector<Testing::param_t>::iterator it = params.begin(); 54 this->nb = *it; 55 56 input1.reload(BasicMathsBenchmarksQ15::INPUT1_Q15_ID,mgr,this->nb); 57 input2.reload(BasicMathsBenchmarksQ15::INPUT2_Q15_ID,mgr,this->nb); 58 59 60 output.create(this->nb,BasicMathsBenchmarksQ15::OUT_SAMPLES_Q15_ID,mgr); 61 62 switch(id) { 63 case BasicMathsBenchmarksQ15::VEC_MULT_Q15_1: 64 case BasicMathsBenchmarksQ15::VEC_ADD_Q15_2: 65 case BasicMathsBenchmarksQ15::VEC_SUB_Q15_3: 66 case BasicMathsBenchmarksQ15::VEC_ABS_Q15_4: 67 case BasicMathsBenchmarksQ15::VEC_SCALE_Q15_7: 68 case BasicMathsBenchmarksQ15::VEC_OFFSET_Q15_6: 69 this->inp1=input1.ptr(); 70 this->inp2=input2.ptr(); 71 this->outp=output.ptr(); 72 break; 73 case BasicMathsBenchmarksQ15::VEC_NEGATE_Q15_5: 74 this->inp1=input1.ptr(); 75 this->outp=output.ptr(); 76 break; 77 case BasicMathsBenchmarksQ15::VEC_DOT_Q15_8: 78 this->inp1=input1.ptr(); 79 this->inp2=input2.ptr(); 80 break; 81 } 82 83 } 84 tearDown(Testing::testID_t id,Client::PatternMgr * mgr)85 void BasicMathsBenchmarksQ15::tearDown(Testing::testID_t id,Client::PatternMgr *mgr) 86 { 87 } 88