1 #include "BinaryQ31.h" 2 #include "Error.h" 3 4 test_mat_mult_q31()5 void BinaryQ31::test_mat_mult_q31() 6 { 7 arm_mat_mult_q31(&this->in1,&this->in2,&this->out); 8 } 9 test_mat_cmplx_mult_q31()10 void BinaryQ31::test_mat_cmplx_mult_q31() 11 { 12 arm_mat_cmplx_mult_q31(&this->in1,&this->in2,&this->out); 13 } 14 test_mat_mult_fast_q31()15 void BinaryQ31::test_mat_mult_fast_q31() 16 { 17 arm_mat_mult_fast_q31(&this->in1,&this->in2,&this->out); 18 } 19 test_mat_mult_opt_q31()20 void BinaryQ31::test_mat_mult_opt_q31() 21 { 22 arm_mat_mult_opt_q31(&this->in1,&this->in2,&this->out,this->tmpPtr); 23 } 24 25 setUp(Testing::testID_t id,std::vector<Testing::param_t> & params,Client::PatternMgr * mgr)26 void BinaryQ31::setUp(Testing::testID_t id,std::vector<Testing::param_t>& params,Client::PatternMgr *mgr) 27 { 28 29 30 std::vector<Testing::param_t>::iterator it = params.begin(); 31 this->nbr = *it++; 32 this->nbi = *it++; 33 this->nbc = *it; 34 35 switch(id) 36 { 37 case BinaryQ31::TEST_MAT_CMPLX_MULT_Q31_2: 38 input1.reload(BinaryQ31::INPUTAC_Q31_ID,mgr,2*this->nbr*this->nbi); 39 input2.reload(BinaryQ31::INPUTBC_Q31_ID,mgr,2*this->nbi*this->nbc); 40 output.create(2*this->nbr*this->nbc,BinaryQ31::OUT_Q31_ID,mgr); 41 break; 42 43 case BinaryQ31::TEST_MAT_MULT_OPT_Q31_4: 44 input1.reload(BinaryQ31::INPUTA_Q31_ID,mgr,this->nbr*this->nbi); 45 input2.reload(BinaryQ31::INPUTB_Q31_ID,mgr,this->nbi*this->nbc); 46 output.create(this->nbr*this->nbc,BinaryQ31::OUT_Q31_ID,mgr); 47 tmp.create(this->nbi*this->nbc,BinaryQ31::TMP_Q31_ID,mgr); 48 this->tmpPtr=tmp.ptr(); 49 break; 50 51 default: 52 input1.reload(BinaryQ31::INPUTA_Q31_ID,mgr,this->nbr*this->nbi); 53 input2.reload(BinaryQ31::INPUTB_Q31_ID,mgr,this->nbi*this->nbc); 54 output.create(this->nbr*this->nbc,BinaryQ31::OUT_Q31_ID,mgr); 55 56 } 57 58 59 60 61 this->in1.numRows = this->nbr; 62 this->in1.numCols = this->nbi; 63 this->in1.pData = input1.ptr(); 64 65 this->in2.numRows = this->nbi; 66 this->in2.numCols = this->nbc; 67 this->in2.pData = input2.ptr(); 68 69 this->out.numRows = this->nbr; 70 this->out.numCols = this->nbc; 71 this->out.pData = output.ptr(); 72 } 73 tearDown(Testing::testID_t id,Client::PatternMgr * mgr)74 void BinaryQ31::tearDown(Testing::testID_t id,Client::PatternMgr *mgr) 75 { 76 } 77