1 #include "StatsF32.h" 2 #include <stdio.h> 3 #include "Error.h" 4 #include "Test.h" 5 6 7 test_max_f32()8 void StatsF32::test_max_f32() 9 { 10 11 float32_t result; 12 uint32_t indexval; 13 14 arm_max_f32(inap, 15 this->nb, 16 &result, 17 &indexval); 18 19 } 20 test_absmax_f32()21 void StatsF32::test_absmax_f32() 22 { 23 24 float32_t result; 25 uint32_t indexval; 26 27 arm_absmax_f32(inap, 28 this->nb, 29 &result, 30 &indexval); 31 32 } 33 test_max_no_idx_f32()34 void StatsF32::test_max_no_idx_f32() 35 { 36 37 float32_t result; 38 39 40 arm_max_no_idx_f32(inap, 41 this->nb, 42 &result); 43 44 45 46 } 47 test_min_f32()48 void StatsF32::test_min_f32() 49 { 50 51 float32_t result; 52 uint32_t indexval; 53 54 55 arm_min_f32(inap, 56 this->nb, 57 &result, 58 &indexval); 59 60 61 62 } 63 test_absmin_f32()64 void StatsF32::test_absmin_f32() 65 { 66 67 float32_t result; 68 uint32_t indexval; 69 70 71 arm_absmin_f32(inap, 72 this->nb, 73 &result, 74 &indexval); 75 76 77 78 } 79 test_mean_f32()80 void StatsF32::test_mean_f32() 81 { 82 83 float32_t result; 84 85 arm_mean_f32(inap, 86 this->nb, 87 &result); 88 89 } 90 test_power_f32()91 void StatsF32::test_power_f32() 92 { 93 94 float32_t result; 95 96 97 arm_power_f32(inap, 98 this->nb, 99 &result); 100 101 102 103 } 104 test_rms_f32()105 void StatsF32::test_rms_f32() 106 { 107 108 float32_t result; 109 110 111 arm_rms_f32(inap, 112 this->nb, 113 &result); 114 115 116 } 117 test_std_f32()118 void StatsF32::test_std_f32() 119 { 120 121 float32_t result; 122 123 124 arm_std_f32(inap, 125 this->nb, 126 &result); 127 128 129 } 130 test_var_f32()131 void StatsF32::test_var_f32() 132 { 133 134 float32_t result; 135 136 137 arm_var_f32(inap, 138 this->nb, 139 &result); 140 141 142 } 143 144 145 146 test_entropy_f32()147 void StatsF32::test_entropy_f32() 148 { 149 (void)arm_entropy_f32(inap,this->nb); 150 151 152 } 153 test_logsumexp_f32()154 void StatsF32::test_logsumexp_f32() 155 { 156 157 (void)arm_logsumexp_f32(inap,this->nb); 158 159 } 160 161 test_kullback_leibler_f32()162 void StatsF32::test_kullback_leibler_f32() 163 { 164 165 166 (void)arm_kullback_leibler_f32(inap,inbp,this->nb); 167 168 } 169 test_logsumexp_dot_prod_f32()170 void StatsF32::test_logsumexp_dot_prod_f32() 171 { 172 173 (void)arm_logsumexp_dot_prod_f32(inap,inbp,this->nb,tmpp); 174 175 } 176 177 178 setUp(Testing::testID_t id,std::vector<Testing::param_t> & paramsArgs,Client::PatternMgr * mgr)179 void StatsF32::setUp(Testing::testID_t id,std::vector<Testing::param_t>& paramsArgs,Client::PatternMgr *mgr) 180 { 181 std::vector<Testing::param_t>::iterator it = paramsArgs.begin(); 182 this->nb = *it; 183 184 inputA.reload(StatsF32::INPUT1_F32_ID,mgr,this->nb); 185 186 inap=inputA.ptr(); 187 188 switch(id) 189 { 190 case TEST_KULLBACK_LEIBLER_F32_10: 191 inputB.reload(StatsF32::INPUT2_F32_ID,mgr,this->nb); 192 193 inbp=inputB.ptr(); 194 break; 195 196 case TEST_LOGSUMEXP_DOT_PROD_F32_11: 197 inputB.reload(StatsF32::INPUT2_F32_ID,mgr,this->nb); 198 199 inbp=inputB.ptr(); 200 201 tmp.create(this->nb,StatsF32::TMP_F32_ID,mgr); 202 203 tmpp = tmp.ptr(); 204 205 break; 206 207 } 208 209 } 210 tearDown(Testing::testID_t id,Client::PatternMgr * mgr)211 void StatsF32::tearDown(Testing::testID_t id,Client::PatternMgr *mgr) 212 { 213 (void)id; 214 215 } 216