1 #include "SupportF16.h"
2 #include "Error.h"
3 
4 
test_copy_f16()5     void SupportF16::test_copy_f16()
6     {
7        arm_copy_f16(this->pSrc,this->pDst,this->nbSamples);
8     }
9 
test_fill_f16()10     void SupportF16::test_fill_f16()
11     {
12        arm_fill_f16(0,this->pDst,this->nbSamples);
13     }
14 
test_q15_to_f16()15     void SupportF16::test_q15_to_f16()
16     {
17       arm_q15_to_f16(this->pSrcQ15,this->pDst,this->nbSamples);
18     }
19 
20 
test_f32_to_f16()21     void SupportF16::test_f32_to_f16()
22     {
23       arm_float_to_f16(this->pSrcF32,this->pDst,this->nbSamples);
24     }
25 
test_weighted_average_f16()26     void SupportF16::test_weighted_average_f16()
27     {
28       arm_weighted_average_f16(this->pSrc, this->pWeights,this->nbSamples);
29     }
30 
setUp(Testing::testID_t id,std::vector<Testing::param_t> & params,Client::PatternMgr * mgr)31     void SupportF16::setUp(Testing::testID_t id,std::vector<Testing::param_t>& params,Client::PatternMgr *mgr)
32     {
33 
34 
35        std::vector<Testing::param_t>::iterator it = params.begin();
36        this->nbSamples = *it;
37 
38        output.create(this->nbSamples,SupportF16::OUT_SAMPLES_F16_ID,mgr);
39 
40        switch(id)
41        {
42            case TEST_COPY_F16_1:
43            case TEST_FILL_F16_2:
44              samples.reload(SupportF16::SAMPLES_F16_ID,mgr,this->nbSamples);
45              this->pSrc=samples.ptr();
46            break;
47 
48            case TEST_Q15_TO_F16_3:
49              samplesQ15.reload(SupportF16::SAMPLES_Q15_ID,mgr,this->nbSamples);
50              this->pSrcQ15=samplesQ15.ptr();
51            break;
52 
53            case TEST_F32_TO_F16_4:
54              samplesF32.reload(SupportF16::SAMPLES_F32_ID,mgr,this->nbSamples);
55              this->pSrcF32=samplesF32.ptr();
56            break;
57 
58 
59            case TEST_WEIGHTED_AVERAGE_F16_5:
60               samples.reload(SupportF16::INPUTS6_F16_ID,mgr,this->nbSamples);
61               weights.reload(SupportF16::WEIGHTS6_F16_ID,mgr,this->nbSamples);
62 
63               this->pSrc=samples.ptr();
64               this->pWeights=weights.ptr();
65            break;
66 
67        }
68 
69        this->pDst=output.ptr();
70 
71     }
72 
tearDown(Testing::testID_t id,Client::PatternMgr * mgr)73     void SupportF16::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
74     {
75        (void)id;
76        (void)mgr;
77     }
78