1 #include "BasicMathsBenchmarksQ7.h"
2 #include "Error.h"
3 
4 
vec_mult_q7()5     void BasicMathsBenchmarksQ7::vec_mult_q7()
6     {
7        arm_mult_q7(this->inp1,this->inp2,this->outp,this->nb);
8     }
9 
vec_add_q7()10     void BasicMathsBenchmarksQ7::vec_add_q7()
11     {
12        arm_add_q7(this->inp1,this->inp2,this->outp,this->nb);
13     }
14 
vec_sub_q7()15     void BasicMathsBenchmarksQ7::vec_sub_q7()
16     {
17        arm_sub_q7(this->inp1,this->inp2,this->outp,this->nb);
18     }
19 
vec_abs_q7()20     void BasicMathsBenchmarksQ7::vec_abs_q7()
21     {
22        arm_abs_q7(this->inp1,this->outp,this->nb);
23     }
24 
vec_negate_q7()25     void BasicMathsBenchmarksQ7::vec_negate_q7()
26     {
27        arm_negate_q7(this->inp1,this->outp,this->nb);
28     }
29 
vec_offset_q7()30     void BasicMathsBenchmarksQ7::vec_offset_q7()
31     {
32        arm_offset_q7(this->inp1,1.0,this->outp,this->nb);
33     }
34 
vec_scale_q7()35    void BasicMathsBenchmarksQ7::vec_scale_q7()
36     {
37        arm_scale_q7(this->inp1,0x45,1,this->outp,this->nb);
38     }
39 
vec_dot_q7()40     void BasicMathsBenchmarksQ7::vec_dot_q7()
41     {
42 
43        q31_t result;
44 
45        arm_dot_prod_q7(this->inp1,this->inp2,this->nb,&result);
46 
47     }
48 
49 
50 
setUp(Testing::testID_t id,std::vector<Testing::param_t> & params,Client::PatternMgr * mgr)51     void BasicMathsBenchmarksQ7::setUp(Testing::testID_t id,std::vector<Testing::param_t>& params,Client::PatternMgr *mgr)
52     {
53 
54 
55        std::vector<Testing::param_t>::iterator it = params.begin();
56        this->nb = *it;
57 
58        input1.reload(BasicMathsBenchmarksQ7::INPUT1_Q7_ID,mgr,this->nb);
59        input2.reload(BasicMathsBenchmarksQ7::INPUT2_Q7_ID,mgr,this->nb);
60 
61 
62        output.create(this->nb,BasicMathsBenchmarksQ7::OUT_SAMPLES_Q7_ID,mgr);
63 
64        switch(id)
65        {
66           case BasicMathsBenchmarksQ7::VEC_MULT_Q7_1:
67           case BasicMathsBenchmarksQ7::VEC_ADD_Q7_2:
68           case BasicMathsBenchmarksQ7::VEC_SUB_Q7_3:
69           case BasicMathsBenchmarksQ7::VEC_ABS_Q7_4:
70           case BasicMathsBenchmarksQ7::VEC_OFFSET_Q7_6:
71           case BasicMathsBenchmarksQ7::VEC_SCALE_Q7_7:
72              this->inp1=input1.ptr();
73              this->inp2=input2.ptr();
74              this->outp=output.ptr();
75           break;
76           case BasicMathsBenchmarksQ7::VEC_NEGATE_Q7_5:
77              this->inp1=input1.ptr();
78              this->outp=output.ptr();
79           break;
80           case BasicMathsBenchmarksQ7::VEC_DOT_Q7_8:
81              this->inp1=input1.ptr();
82              this->inp2=input2.ptr();
83           break;
84        }
85 
86     }
87 
tearDown(Testing::testID_t id,Client::PatternMgr * mgr)88     void BasicMathsBenchmarksQ7::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
89     {
90     }
91