1 #include "ComplexMathsBenchmarksQ31.h"
2 #include "Error.h"
3 
4 
vec_conj_q31()5     void ComplexMathsBenchmarksQ31::vec_conj_q31()
6     {
7        arm_cmplx_conj_q31(this->inp1,this->outp,this->nb);
8     }
9 
vec_dot_prod_q31()10     void ComplexMathsBenchmarksQ31::vec_dot_prod_q31()
11     {
12        q63_t real,imag;
13 
14        arm_cmplx_dot_prod_q31(this->inp1,this->inp2,this->nb,&real,&imag);
15     }
16 
vec_mag_q31()17     void ComplexMathsBenchmarksQ31::vec_mag_q31()
18     {
19        arm_cmplx_mag_q31(this->inp1,this->outp,this->nb);
20     }
21 
vec_mag_squared_q31()22     void ComplexMathsBenchmarksQ31::vec_mag_squared_q31()
23     {
24        arm_cmplx_mag_squared_q31(this->inp1,this->outp,this->nb);
25     }
26 
vec_mult_cmplx_q31()27     void ComplexMathsBenchmarksQ31::vec_mult_cmplx_q31()
28     {
29        arm_cmplx_mult_cmplx_q31(this->inp1,this->inp2,this->outp,this->nb);
30     }
31 
vec_mult_real_q31()32     void ComplexMathsBenchmarksQ31::vec_mult_real_q31()
33     {
34        arm_cmplx_mult_real_q31(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 ComplexMathsBenchmarksQ31::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(ComplexMathsBenchmarksQ31::INPUT1_Q31_ID,mgr,this->nb);
46        input2.reload(ComplexMathsBenchmarksQ31::INPUT2_Q31_ID,mgr,this->nb);
47        input3.reload(ComplexMathsBenchmarksQ31::INPUT3_Q31_ID,mgr,this->nb);
48 
49        output.create(this->nb,ComplexMathsBenchmarksQ31::OUT_SAMPLES_Q31_ID,mgr);
50 
51        switch(id){
52          case ComplexMathsBenchmarksQ31::VEC_CONJ_Q31_1:
53          case ComplexMathsBenchmarksQ31::VEC_MAG_Q31_3:
54          case ComplexMathsBenchmarksQ31::VEC_MAG_SQUARED_Q31_4:
55              this->inp1=input1.ptr();
56              this->outp=output.ptr();
57          break;
58 
59          case ComplexMathsBenchmarksQ31::VEC_DOT_PROD_Q31_2:
60             this->inp1=input1.ptr();
61             this->inp2=input2.ptr();
62          break;
63 
64          case ComplexMathsBenchmarksQ31::VEC_MULT_CMPLX_Q31_5:
65             this->inp1=input1.ptr();
66             this->inp2=input2.ptr();
67             this->outp=output.ptr();
68          break;
69 
70          case ComplexMathsBenchmarksQ31::VEC_MULT_REAL_Q31_6:
71             this->inp1=input1.ptr();
72             // Real input
73             this->inp3=input3.ptr();
74             this->outp=output.ptr();
75          break;
76        }
77     }
78 
tearDown(Testing::testID_t id,Client::PatternMgr * mgr)79     void ComplexMathsBenchmarksQ31::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
80     {
81     }
82