1 #include "ComplexMathsBenchmarksF16.h"
2 #include "Error.h"
3 
4 
vec_conj_f16()5     void ComplexMathsBenchmarksF16::vec_conj_f16()
6     {
7        arm_cmplx_conj_f16(this->inp1,this->outp,this->nb);
8     }
9 
vec_dot_prod_f16()10     void ComplexMathsBenchmarksF16::vec_dot_prod_f16()
11     {
12        float16_t real,imag;
13        arm_cmplx_dot_prod_f16(this->inp1,this->inp2,this->nb,&real,&imag);
14     }
15 
vec_mag_f16()16     void ComplexMathsBenchmarksF16::vec_mag_f16()
17     {
18        arm_cmplx_mag_f16(this->inp1,this->outp,this->nb);
19     }
20 
vec_mag_squared_f16()21     void ComplexMathsBenchmarksF16::vec_mag_squared_f16()
22     {
23        arm_cmplx_mag_squared_f16(this->inp1,this->outp,this->nb);
24     }
25 
vec_mult_cmplx_f16()26     void ComplexMathsBenchmarksF16::vec_mult_cmplx_f16()
27     {
28       arm_cmplx_mult_cmplx_f16(this->inp1,this->inp2,this->outp,this->nb);
29     }
30 
vec_mult_real_f16()31     void ComplexMathsBenchmarksF16::vec_mult_real_f16()
32     {
33        arm_cmplx_mult_real_f16(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 ComplexMathsBenchmarksF16::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(ComplexMathsBenchmarksF16::INPUT1_F16_ID,mgr,this->nb);
45        input2.reload(ComplexMathsBenchmarksF16::INPUT2_F16_ID,mgr,this->nb);
46        input3.reload(ComplexMathsBenchmarksF16::INPUT3_F16_ID,mgr,this->nb);
47 
48        output.create(this->nb,ComplexMathsBenchmarksF16::OUT_SAMPLES_F16_ID,mgr);
49 
50 
51        switch(id){
52          case ComplexMathsBenchmarksF16::VEC_CONJ_F16_1:
53          case ComplexMathsBenchmarksF16::VEC_MAG_F16_3:
54          case ComplexMathsBenchmarksF16::VEC_MAG_SQUARED_F16_4:
55              this->inp1=input1.ptr();
56              this->outp=output.ptr();
57          break;
58 
59          case ComplexMathsBenchmarksF16::VEC_DOT_PROD_F16_2:
60             this->inp1=input1.ptr();
61             this->inp2=input2.ptr();
62          break;
63 
64          case ComplexMathsBenchmarksF16::VEC_MULT_CMPLX_F16_5:
65             this->inp1=input1.ptr();
66             this->inp2=input2.ptr();
67             this->outp=output.ptr();
68          break;
69 
70          case ComplexMathsBenchmarksF16::VEC_MULT_REAL_F16_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 ComplexMathsBenchmarksF16::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
81     {
82       (void)id;
83       (void)mgr;
84     }
85