1 #include "ComplexMathsBenchmarksF32.h"
2 #include "Error.h"
3 
4 
vec_conj_f32()5     void ComplexMathsBenchmarksF32::vec_conj_f32()
6     {
7        arm_cmplx_conj_f32(this->inp1,this->outp,this->nb);
8     }
9 
vec_dot_prod_f32()10     void ComplexMathsBenchmarksF32::vec_dot_prod_f32()
11     {
12        float32_t real,imag;
13        arm_cmplx_dot_prod_f32(this->inp1,this->inp2,this->nb,&real,&imag);
14     }
15 
vec_mag_f32()16     void ComplexMathsBenchmarksF32::vec_mag_f32()
17     {
18        arm_cmplx_mag_f32(this->inp1,this->outp,this->nb);
19     }
20 
vec_mag_squared_f32()21     void ComplexMathsBenchmarksF32::vec_mag_squared_f32()
22     {
23        arm_cmplx_mag_squared_f32(this->inp1,this->outp,this->nb);
24     }
25 
vec_mult_cmplx_f32()26     void ComplexMathsBenchmarksF32::vec_mult_cmplx_f32()
27     {
28       arm_cmplx_mult_cmplx_f32(this->inp1,this->inp2,this->outp,this->nb);
29     }
30 
vec_mult_real_f32()31     void ComplexMathsBenchmarksF32::vec_mult_real_f32()
32     {
33        arm_cmplx_mult_real_f32(this->inp1,this->inp3,this->outp,this->nb);
34     }
35 
36 
setUp(Testing::testID_t id,std::vector<Testing::param_t> & params,Client::PatternMgr * mgr)37     void ComplexMathsBenchmarksF32::setUp(Testing::testID_t id,std::vector<Testing::param_t>& params,Client::PatternMgr *mgr)
38     {
39 
40 
41        std::vector<Testing::param_t>::iterator it = params.begin();
42        this->nb = *it;
43 
44        input1.reload(ComplexMathsBenchmarksF32::INPUT1_F32_ID,mgr,this->nb);
45        input2.reload(ComplexMathsBenchmarksF32::INPUT2_F32_ID,mgr,this->nb);
46        input3.reload(ComplexMathsBenchmarksF32::INPUT3_F32_ID,mgr,this->nb);
47 
48        output.create(this->nb,ComplexMathsBenchmarksF32::OUT_SAMPLES_F32_ID,mgr);
49 
50 
51        switch(id){
52          case ComplexMathsBenchmarksF32::VEC_CONJ_F32_1:
53          case ComplexMathsBenchmarksF32::VEC_MAG_F32_3:
54          case ComplexMathsBenchmarksF32::VEC_MAG_SQUARED_F32_4:
55              this->inp1=input1.ptr();
56              this->outp=output.ptr();
57          break;
58 
59          case ComplexMathsBenchmarksF32::VEC_DOT_PROD_F32_2:
60             this->inp1=input1.ptr();
61             this->inp2=input2.ptr();
62          break;
63 
64          case ComplexMathsBenchmarksF32::VEC_MULT_CMPLX_F32_5:
65             this->inp1=input1.ptr();
66             this->inp2=input2.ptr();
67             this->outp=output.ptr();
68          break;
69 
70          case ComplexMathsBenchmarksF32::VEC_MULT_REAL_F32_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 ComplexMathsBenchmarksF32::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
81     {
82     }
83