SupportTestsF32.cpp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770
  1. #include "SupportTestsF32.h"
  2. #include <stdlib.h>
  3. #include <stdio.h>
  4. #include "Error.h"
  5. #include "Test.h"
  6. #define SNR_THRESHOLD 120
  7. #define REL_ERROR (1.0e-5)
  8. #define ABS_Q15_ERROR ((q15_t)10)
  9. #define ABS_Q31_ERROR ((q31_t)80)
  10. #define ABS_Q7_ERROR ((q7_t)10)
  11. void SupportTestsF32::test_weighted_sum_f32()
  12. {
  13. const float32_t *inp = input.ptr();
  14. const float32_t *coefsp = coefs.ptr();
  15. float32_t *refp = ref.ptr();
  16. float32_t *outp = output.ptr();
  17. *outp=arm_weighted_sum_f32(inp, coefsp,this->nbSamples);
  18. ASSERT_REL_ERROR(*outp,refp[this->offset],REL_ERROR);
  19. ASSERT_EMPTY_TAIL(output);
  20. }
  21. void SupportTestsF32::test_copy_f32()
  22. {
  23. const float32_t *inp = input.ptr();
  24. float32_t *outp = output.ptr();
  25. arm_copy_f32(inp, outp,this->nbSamples);
  26. ASSERT_EQ(input,output);
  27. ASSERT_EMPTY_TAIL(output);
  28. }
  29. void SupportTestsF32::test_fill_f32()
  30. {
  31. float32_t *outp = output.ptr();
  32. float32_t val = 1.1;
  33. int i;
  34. arm_fill_f32(val, outp,this->nbSamples);
  35. for(i=0 ; i < this->nbSamples; i++)
  36. {
  37. ASSERT_EQ(val,outp[i]);
  38. }
  39. ASSERT_EMPTY_TAIL(output);
  40. }
  41. void SupportTestsF32::test_float_to_q15()
  42. {
  43. const float32_t *inp = input.ptr();
  44. q15_t *outp = outputQ15.ptr();
  45. arm_float_to_q15(inp, outp,this->nbSamples);
  46. ASSERT_NEAR_EQ(refQ15,outputQ15,ABS_Q15_ERROR);
  47. ASSERT_EMPTY_TAIL(outputQ15);
  48. }
  49. void SupportTestsF32::test_float_to_f64()
  50. {
  51. const float32_t *inp = input.ptr();
  52. float64_t *outp = outputF64.ptr();
  53. arm_float_to_f64(inp, outp,this->nbSamples);
  54. ASSERT_REL_ERROR(refF64,outputF64,REL_ERROR);
  55. ASSERT_EMPTY_TAIL(outputF64);
  56. }
  57. void SupportTestsF32::test_float_to_q31()
  58. {
  59. const float32_t *inp = input.ptr();
  60. q31_t *outp = outputQ31.ptr();
  61. arm_float_to_q31(inp, outp,this->nbSamples);
  62. ASSERT_NEAR_EQ(refQ31,outputQ31,ABS_Q31_ERROR);
  63. ASSERT_EMPTY_TAIL(outputQ31);
  64. }
  65. void SupportTestsF32::test_float_to_q7()
  66. {
  67. const float32_t *inp = input.ptr();
  68. q7_t *outp = outputQ7.ptr();
  69. arm_float_to_q7(inp, outp,this->nbSamples);
  70. ASSERT_NEAR_EQ(refQ7,outputQ7,ABS_Q7_ERROR);
  71. ASSERT_EMPTY_TAIL(outputQ7);
  72. }
  73. void SupportTestsF32::test_bitonic_sort_out_f32()
  74. {
  75. float32_t *inp = input.ptr();
  76. float32_t *outp = output.ptr();
  77. arm_sort_instance_f32 S;
  78. arm_sort_init_f32(&S, ARM_SORT_BITONIC, ARM_SORT_ASCENDING);
  79. arm_sort_f32(&S,inp,outp,this->nbSamples);
  80. ASSERT_EMPTY_TAIL(output);
  81. ASSERT_EQ(output,ref);
  82. }
  83. void SupportTestsF32::test_bitonic_sort_in_f32()
  84. {
  85. float32_t *inp = input.ptr();
  86. arm_sort_instance_f32 S;
  87. arm_sort_init_f32(&S, ARM_SORT_BITONIC, ARM_SORT_ASCENDING);
  88. arm_sort_f32(&S,inp,inp,this->nbSamples);
  89. ASSERT_EMPTY_TAIL(input);
  90. ASSERT_EQ(input,ref);
  91. }
  92. void SupportTestsF32::test_bitonic_sort_const_f32()
  93. {
  94. float32_t *inp = input.ptr();
  95. float32_t *outp = output.ptr();
  96. arm_sort_instance_f32 S;
  97. arm_sort_init_f32(&S, ARM_SORT_BITONIC, ARM_SORT_ASCENDING);
  98. arm_sort_f32(&S,inp,outp,this->nbSamples);
  99. ASSERT_EMPTY_TAIL(output);
  100. ASSERT_EQ(output,ref);
  101. }
  102. void SupportTestsF32::test_bubble_sort_out_f32()
  103. {
  104. float32_t *inp = input.ptr();
  105. float32_t *outp = output.ptr();
  106. arm_sort_instance_f32 S;
  107. arm_sort_init_f32(&S, ARM_SORT_BUBBLE, ARM_SORT_ASCENDING);
  108. arm_sort_f32(&S,inp,outp,this->nbSamples);
  109. ASSERT_EMPTY_TAIL(output);
  110. ASSERT_EQ(output,ref);
  111. }
  112. void SupportTestsF32::test_bubble_sort_in_f32()
  113. {
  114. float32_t *inp = input.ptr();
  115. arm_sort_instance_f32 S;
  116. arm_sort_init_f32(&S, ARM_SORT_BUBBLE, ARM_SORT_ASCENDING);
  117. arm_sort_f32(&S,inp,inp,this->nbSamples);
  118. ASSERT_EMPTY_TAIL(input);
  119. ASSERT_EQ(input,ref);
  120. }
  121. void SupportTestsF32::test_bubble_sort_const_f32()
  122. {
  123. float32_t *inp = input.ptr();
  124. float32_t *outp = output.ptr();
  125. arm_sort_instance_f32 S;
  126. arm_sort_init_f32(&S, ARM_SORT_BUBBLE, ARM_SORT_ASCENDING);
  127. arm_sort_f32(&S,inp,outp,this->nbSamples);
  128. ASSERT_EMPTY_TAIL(output);
  129. ASSERT_EQ(output,ref);
  130. }
  131. void SupportTestsF32::test_heap_sort_out_f32()
  132. {
  133. float32_t *inp = input.ptr();
  134. float32_t *outp = output.ptr();
  135. arm_sort_instance_f32 S;
  136. arm_sort_init_f32(&S, ARM_SORT_HEAP, ARM_SORT_ASCENDING);
  137. arm_sort_f32(&S,inp,outp,this->nbSamples);
  138. ASSERT_EMPTY_TAIL(output);
  139. ASSERT_EQ(output,ref);
  140. }
  141. void SupportTestsF32::test_heap_sort_in_f32()
  142. {
  143. float32_t *inp = input.ptr();
  144. arm_sort_instance_f32 S;
  145. arm_sort_init_f32(&S, ARM_SORT_HEAP, ARM_SORT_ASCENDING);
  146. arm_sort_f32(&S,inp,inp,this->nbSamples);
  147. ASSERT_EMPTY_TAIL(input);
  148. ASSERT_EQ(input,ref);
  149. }
  150. void SupportTestsF32::test_heap_sort_const_f32()
  151. {
  152. float32_t *inp = input.ptr();
  153. float32_t *outp = output.ptr();
  154. arm_sort_instance_f32 S;
  155. arm_sort_init_f32(&S, ARM_SORT_HEAP, ARM_SORT_ASCENDING);
  156. arm_sort_f32(&S,inp,outp,this->nbSamples);
  157. ASSERT_EMPTY_TAIL(output);
  158. ASSERT_EQ(output,ref);
  159. }
  160. void SupportTestsF32::test_insertion_sort_out_f32()
  161. {
  162. float32_t *inp = input.ptr();
  163. float32_t *outp = output.ptr();
  164. arm_sort_instance_f32 S;
  165. arm_sort_init_f32(&S, ARM_SORT_INSERTION, ARM_SORT_ASCENDING);
  166. arm_sort_f32(&S,inp,outp,this->nbSamples);
  167. ASSERT_EMPTY_TAIL(output);
  168. ASSERT_EQ(output,ref);
  169. }
  170. void SupportTestsF32::test_insertion_sort_in_f32()
  171. {
  172. float32_t *inp = input.ptr();
  173. arm_sort_instance_f32 S;
  174. arm_sort_init_f32(&S, ARM_SORT_INSERTION, ARM_SORT_ASCENDING);
  175. arm_sort_f32(&S,inp,inp,this->nbSamples);
  176. ASSERT_EMPTY_TAIL(input);
  177. ASSERT_EQ(input,ref);
  178. }
  179. void SupportTestsF32::test_insertion_sort_const_f32()
  180. {
  181. float32_t *inp = input.ptr();
  182. float32_t *outp = output.ptr();
  183. arm_sort_instance_f32 S;
  184. arm_sort_init_f32(&S, ARM_SORT_INSERTION, ARM_SORT_ASCENDING);
  185. arm_sort_f32(&S,inp,outp,this->nbSamples);
  186. ASSERT_EMPTY_TAIL(output);
  187. ASSERT_EQ(output,ref);
  188. }
  189. void SupportTestsF32::test_merge_sort_out_f32()
  190. {
  191. float32_t *inp = input.ptr();
  192. float32_t *outp = output.ptr();
  193. float32_t *buf = buffer.ptr();
  194. buf = (float32_t *)malloc((this->nbSamples)*sizeof(float32_t) );
  195. arm_merge_sort_instance_f32 S;
  196. arm_merge_sort_init_f32(&S, ARM_SORT_ASCENDING, buf);
  197. arm_merge_sort_f32(&S,inp,outp,this->nbSamples);
  198. ASSERT_EMPTY_TAIL(output);
  199. ASSERT_EQ(output,ref);
  200. }
  201. void SupportTestsF32::test_merge_sort_const_f32()
  202. {
  203. float32_t *inp = input.ptr();
  204. float32_t *outp = output.ptr();
  205. float32_t *buf = buffer.ptr();
  206. buf = (float32_t *)malloc((this->nbSamples)*sizeof(float32_t) );
  207. arm_merge_sort_instance_f32 S;
  208. arm_merge_sort_init_f32(&S, ARM_SORT_ASCENDING, buf);
  209. arm_merge_sort_f32(&S,inp,outp,this->nbSamples);
  210. ASSERT_EMPTY_TAIL(output);
  211. ASSERT_EQ(output,ref);
  212. }
  213. void SupportTestsF32::test_quick_sort_out_f32()
  214. {
  215. float32_t *inp = input.ptr();
  216. float32_t *outp = output.ptr();
  217. arm_sort_instance_f32 S;
  218. arm_sort_init_f32(&S, ARM_SORT_QUICK, ARM_SORT_ASCENDING);
  219. arm_sort_f32(&S,inp,outp,this->nbSamples);
  220. ASSERT_EMPTY_TAIL(output);
  221. ASSERT_EQ(output,ref);
  222. }
  223. void SupportTestsF32::test_quick_sort_in_f32()
  224. {
  225. float32_t *inp = input.ptr();
  226. arm_sort_instance_f32 S;
  227. arm_sort_init_f32(&S, ARM_SORT_QUICK, ARM_SORT_ASCENDING);
  228. arm_sort_f32(&S,inp,inp,this->nbSamples);
  229. ASSERT_EMPTY_TAIL(input);
  230. ASSERT_EQ(input,ref);
  231. }
  232. void SupportTestsF32::test_quick_sort_const_f32()
  233. {
  234. float32_t *inp = input.ptr();
  235. float32_t *outp = output.ptr();
  236. arm_sort_instance_f32 S;
  237. arm_sort_init_f32(&S, ARM_SORT_QUICK, ARM_SORT_ASCENDING);
  238. arm_sort_f32(&S,inp,outp,this->nbSamples);
  239. ASSERT_EMPTY_TAIL(output);
  240. ASSERT_EQ(output,ref);
  241. }
  242. void SupportTestsF32::test_selection_sort_out_f32()
  243. {
  244. float32_t *inp = input.ptr();
  245. float32_t *outp = output.ptr();
  246. arm_sort_instance_f32 S;
  247. arm_sort_init_f32(&S, ARM_SORT_SELECTION, ARM_SORT_ASCENDING);
  248. arm_sort_f32(&S,inp,outp,this->nbSamples);
  249. ASSERT_EMPTY_TAIL(output);
  250. ASSERT_EQ(output,ref);
  251. }
  252. void SupportTestsF32::test_selection_sort_in_f32()
  253. {
  254. float32_t *inp = input.ptr();
  255. arm_sort_instance_f32 S;
  256. arm_sort_init_f32(&S, ARM_SORT_SELECTION, ARM_SORT_ASCENDING);
  257. arm_sort_f32(&S,inp,inp,this->nbSamples);
  258. ASSERT_EMPTY_TAIL(input);
  259. ASSERT_EQ(input,ref);
  260. }
  261. void SupportTestsF32::test_selection_sort_const_f32()
  262. {
  263. float32_t *inp = input.ptr();
  264. float32_t *outp = output.ptr();
  265. arm_sort_instance_f32 S;
  266. arm_sort_init_f32(&S, ARM_SORT_SELECTION, ARM_SORT_ASCENDING);
  267. arm_sort_f32(&S,inp,outp,this->nbSamples);
  268. ASSERT_EMPTY_TAIL(output);
  269. ASSERT_EQ(output,ref);
  270. }
  271. void SupportTestsF32::setUp(Testing::testID_t id,std::vector<Testing::param_t>& paramsArgs,Client::PatternMgr *mgr)
  272. {
  273. (void)paramsArgs;
  274. switch(id)
  275. {
  276. case TEST_WEIGHTED_SUM_F32_1:
  277. this->nbSamples = 3;
  278. input.reload(SupportTestsF32::INPUTS_F32_ID,mgr,this->nbSamples);
  279. coefs.reload(SupportTestsF32::WEIGHTS_F32_ID,mgr,this->nbSamples);
  280. ref.reload(SupportTestsF32::REF_F32_ID,mgr);
  281. output.create(1,SupportTestsF32::OUT_F32_ID,mgr);
  282. this->offset=0;
  283. break;
  284. case TEST_WEIGHTED_SUM_F32_2:
  285. this->nbSamples = 8;
  286. input.reload(SupportTestsF32::INPUTS_F32_ID,mgr,this->nbSamples);
  287. coefs.reload(SupportTestsF32::WEIGHTS_F32_ID,mgr,this->nbSamples);
  288. ref.reload(SupportTestsF32::REF_F32_ID,mgr);
  289. output.create(1,SupportTestsF32::OUT_F32_ID,mgr);
  290. this->offset=1;
  291. break;
  292. case TEST_WEIGHTED_SUM_F32_3:
  293. this->nbSamples = 11;
  294. input.reload(SupportTestsF32::INPUTS_F32_ID,mgr,this->nbSamples);
  295. coefs.reload(SupportTestsF32::WEIGHTS_F32_ID,mgr,this->nbSamples);
  296. ref.reload(SupportTestsF32::REF_F32_ID,mgr);
  297. output.create(1,SupportTestsF32::OUT_F32_ID,mgr);
  298. this->offset=2;
  299. break;
  300. case TEST_COPY_F32_4:
  301. this->nbSamples = 3;
  302. input.reload(SupportTestsF32::SAMPLES_F32_ID,mgr,this->nbSamples);
  303. output.create(input.nbSamples(),SupportTestsF32::OUT_F32_ID,mgr);
  304. break;
  305. case TEST_COPY_F32_5:
  306. this->nbSamples = 8;
  307. input.reload(SupportTestsF32::SAMPLES_F32_ID,mgr,this->nbSamples);
  308. output.create(input.nbSamples(),SupportTestsF32::OUT_F32_ID,mgr);
  309. break;
  310. case TEST_COPY_F32_6:
  311. this->nbSamples = 11;
  312. input.reload(SupportTestsF32::SAMPLES_F32_ID,mgr,this->nbSamples);
  313. output.create(input.nbSamples(),SupportTestsF32::OUT_F32_ID,mgr);
  314. break;
  315. case TEST_FILL_F32_7:
  316. this->nbSamples = 3;
  317. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  318. break;
  319. case TEST_FILL_F32_8:
  320. this->nbSamples = 8;
  321. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  322. break;
  323. case TEST_FILL_F32_9:
  324. this->nbSamples = 11;
  325. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  326. break;
  327. case TEST_FLOAT_TO_Q15_10:
  328. this->nbSamples = 7;
  329. input.reload(SupportTestsF32::SAMPLES_F32_ID,mgr,this->nbSamples);
  330. refQ15.reload(SupportTestsF32::SAMPLES_Q15_ID,mgr,this->nbSamples);
  331. outputQ15.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  332. break;
  333. case TEST_FLOAT_TO_Q15_11:
  334. this->nbSamples = 16;
  335. input.reload(SupportTestsF32::SAMPLES_F32_ID,mgr,this->nbSamples);
  336. refQ15.reload(SupportTestsF32::SAMPLES_Q15_ID,mgr,this->nbSamples);
  337. outputQ15.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  338. break;
  339. case TEST_FLOAT_TO_Q15_12:
  340. this->nbSamples = 17;
  341. input.reload(SupportTestsF32::SAMPLES_F32_ID,mgr,this->nbSamples);
  342. refQ15.reload(SupportTestsF32::SAMPLES_Q15_ID,mgr,this->nbSamples);
  343. outputQ15.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  344. break;
  345. case TEST_FLOAT_TO_Q31_13:
  346. this->nbSamples = 3;
  347. input.reload(SupportTestsF32::SAMPLES_F32_ID,mgr,this->nbSamples);
  348. refQ31.reload(SupportTestsF32::SAMPLES_Q31_ID,mgr,this->nbSamples);
  349. outputQ31.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  350. break;
  351. case TEST_FLOAT_TO_Q31_14:
  352. this->nbSamples = 8;
  353. input.reload(SupportTestsF32::SAMPLES_F32_ID,mgr,this->nbSamples);
  354. refQ31.reload(SupportTestsF32::SAMPLES_Q31_ID,mgr,this->nbSamples);
  355. outputQ31.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  356. break;
  357. case TEST_FLOAT_TO_Q31_15:
  358. this->nbSamples = 11;
  359. input.reload(SupportTestsF32::SAMPLES_F32_ID,mgr,this->nbSamples);
  360. refQ31.reload(SupportTestsF32::SAMPLES_Q31_ID,mgr,this->nbSamples);
  361. outputQ31.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  362. break;
  363. case TEST_FLOAT_TO_Q7_16:
  364. this->nbSamples = 15;
  365. input.reload(SupportTestsF32::SAMPLES_F32_ID,mgr,this->nbSamples);
  366. refQ7.reload(SupportTestsF32::SAMPLES_Q7_ID,mgr,this->nbSamples);
  367. outputQ7.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  368. break;
  369. case TEST_FLOAT_TO_Q7_17:
  370. this->nbSamples = 32;
  371. input.reload(SupportTestsF32::SAMPLES_F32_ID,mgr,this->nbSamples);
  372. refQ7.reload(SupportTestsF32::SAMPLES_Q7_ID,mgr,this->nbSamples);
  373. outputQ7.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  374. break;
  375. case TEST_FLOAT_TO_Q7_18:
  376. this->nbSamples = 33;
  377. input.reload(SupportTestsF32::SAMPLES_F32_ID,mgr,this->nbSamples);
  378. refQ7.reload(SupportTestsF32::SAMPLES_Q7_ID,mgr,this->nbSamples);
  379. outputQ7.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  380. break;
  381. case TEST_BITONIC_SORT_OUT_F32_19:
  382. this->nbSamples = 16;
  383. input.reload(SupportTestsF32::INPUT_BITONIC_SORT_16_F32_ID,mgr,this->nbSamples);
  384. ref.reload(SupportTestsF32::REF_BITONIC_SORT_16_F32_ID,mgr);
  385. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  386. break;
  387. case TEST_BITONIC_SORT_OUT_F32_20:
  388. this->nbSamples = 32;
  389. input.reload(SupportTestsF32::INPUT_BITONIC_SORT_32_F32_ID,mgr,this->nbSamples);
  390. ref.reload(SupportTestsF32::REF_BITONIC_SORT_32_F32_ID,mgr);
  391. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  392. break;
  393. case TEST_BITONIC_SORT_IN_F32_21:
  394. this->nbSamples = 32;
  395. input.reload(SupportTestsF32::INPUT_BITONIC_SORT_32_F32_ID,mgr,this->nbSamples);
  396. ref.reload(SupportTestsF32::REF_BITONIC_SORT_32_F32_ID,mgr);
  397. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  398. break;
  399. case TEST_BITONIC_SORT_CONST_F32_22:
  400. this->nbSamples = 16;
  401. input.reload(SupportTestsF32::INPUT_SORT_CONST_F32_ID,mgr,this->nbSamples);
  402. ref.reload(SupportTestsF32::REF_SORT_CONST_F32_ID,mgr);
  403. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  404. break;
  405. case TEST_BUBBLE_SORT_OUT_F32_23:
  406. this->nbSamples = 11;
  407. input.reload(SupportTestsF32::INPUT_SORT_F32_ID,mgr,this->nbSamples);
  408. ref.reload(SupportTestsF32::REF_SORT_F32_ID,mgr);
  409. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  410. break;
  411. case TEST_BUBBLE_SORT_IN_F32_24:
  412. this->nbSamples = 11;
  413. input.reload(SupportTestsF32::INPUT_SORT_F32_ID,mgr,this->nbSamples);
  414. ref.reload(SupportTestsF32::REF_SORT_F32_ID,mgr);
  415. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  416. break;
  417. case TEST_BUBBLE_SORT_CONST_F32_25:
  418. this->nbSamples = 16;
  419. input.reload(SupportTestsF32::INPUT_SORT_CONST_F32_ID,mgr,this->nbSamples);
  420. ref.reload(SupportTestsF32::REF_SORT_CONST_F32_ID,mgr);
  421. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  422. break;
  423. case TEST_HEAP_SORT_OUT_F32_26:
  424. this->nbSamples = 11;
  425. input.reload(SupportTestsF32::INPUT_SORT_F32_ID,mgr,this->nbSamples);
  426. ref.reload(SupportTestsF32::REF_SORT_F32_ID,mgr);
  427. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  428. break;
  429. case TEST_HEAP_SORT_IN_F32_27:
  430. this->nbSamples = 11;
  431. input.reload(SupportTestsF32::INPUT_SORT_F32_ID,mgr,this->nbSamples);
  432. ref.reload(SupportTestsF32::REF_SORT_F32_ID,mgr);
  433. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  434. break;
  435. case TEST_HEAP_SORT_CONST_F32_28:
  436. this->nbSamples = 16;
  437. input.reload(SupportTestsF32::INPUT_SORT_CONST_F32_ID,mgr,this->nbSamples);
  438. ref.reload(SupportTestsF32::REF_SORT_CONST_F32_ID,mgr);
  439. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  440. break;
  441. case TEST_INSERTION_SORT_OUT_F32_29:
  442. this->nbSamples = 11;
  443. input.reload(SupportTestsF32::INPUT_SORT_F32_ID,mgr,this->nbSamples);
  444. ref.reload(SupportTestsF32::REF_SORT_F32_ID,mgr);
  445. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  446. break;
  447. case TEST_INSERTION_SORT_IN_F32_30:
  448. this->nbSamples = 11;
  449. input.reload(SupportTestsF32::INPUT_SORT_F32_ID,mgr,this->nbSamples);
  450. ref.reload(SupportTestsF32::REF_SORT_F32_ID,mgr);
  451. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  452. break;
  453. case TEST_INSERTION_SORT_CONST_F32_31:
  454. this->nbSamples = 16;
  455. input.reload(SupportTestsF32::INPUT_SORT_CONST_F32_ID,mgr,this->nbSamples);
  456. ref.reload(SupportTestsF32::REF_SORT_CONST_F32_ID,mgr);
  457. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  458. break;
  459. case TEST_MERGE_SORT_OUT_F32_32:
  460. this->nbSamples = 11;
  461. input.reload(SupportTestsF32::INPUT_SORT_F32_ID,mgr,this->nbSamples);
  462. ref.reload(SupportTestsF32::REF_SORT_F32_ID,mgr);
  463. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  464. break;
  465. case TEST_MERGE_SORT_CONST_F32_33:
  466. this->nbSamples = 16;
  467. input.reload(SupportTestsF32::INPUT_SORT_CONST_F32_ID,mgr,this->nbSamples);
  468. ref.reload(SupportTestsF32::REF_SORT_CONST_F32_ID,mgr);
  469. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  470. break;
  471. case TEST_QUICK_SORT_OUT_F32_34:
  472. this->nbSamples = 11;
  473. input.reload(SupportTestsF32::INPUT_SORT_F32_ID,mgr,this->nbSamples);
  474. ref.reload(SupportTestsF32::REF_SORT_F32_ID,mgr);
  475. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  476. break;
  477. case TEST_QUICK_SORT_IN_F32_35:
  478. this->nbSamples = 11;
  479. input.reload(SupportTestsF32::INPUT_SORT_F32_ID,mgr,this->nbSamples);
  480. ref.reload(SupportTestsF32::REF_SORT_F32_ID,mgr);
  481. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  482. break;
  483. case TEST_QUICK_SORT_CONST_F32_36:
  484. this->nbSamples = 16;
  485. input.reload(SupportTestsF32::INPUT_SORT_CONST_F32_ID,mgr,this->nbSamples);
  486. ref.reload(SupportTestsF32::REF_SORT_CONST_F32_ID,mgr);
  487. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  488. break;
  489. case TEST_SELECTION_SORT_OUT_F32_37:
  490. this->nbSamples = 11;
  491. input.reload(SupportTestsF32::INPUT_SORT_F32_ID,mgr,this->nbSamples);
  492. ref.reload(SupportTestsF32::REF_SORT_F32_ID,mgr);
  493. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  494. break;
  495. case TEST_SELECTION_SORT_IN_F32_38:
  496. this->nbSamples = 11;
  497. input.reload(SupportTestsF32::INPUT_SORT_F32_ID,mgr,this->nbSamples);
  498. ref.reload(SupportTestsF32::REF_SORT_F32_ID,mgr);
  499. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  500. break;
  501. case TEST_SELECTION_SORT_CONST_F32_39:
  502. this->nbSamples = 16;
  503. input.reload(SupportTestsF32::INPUT_SORT_CONST_F32_ID,mgr,this->nbSamples);
  504. ref.reload(SupportTestsF32::REF_SORT_CONST_F32_ID,mgr);
  505. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  506. break;
  507. case TEST_FLOAT_TO_F64_40:
  508. this->nbSamples = 7;
  509. input.reload(SupportTestsF32::SAMPLES_F32_ID,mgr,this->nbSamples);
  510. refF64.reload(SupportTestsF32::SAMPLES_F64_ID,mgr,this->nbSamples);
  511. outputF64.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  512. break;
  513. case TEST_FLOAT_TO_F64_41:
  514. this->nbSamples = 16;
  515. input.reload(SupportTestsF32::SAMPLES_F32_ID,mgr,this->nbSamples);
  516. refF64.reload(SupportTestsF32::SAMPLES_F64_ID,mgr,this->nbSamples);
  517. outputF64.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  518. break;
  519. case TEST_FLOAT_TO_F64_42:
  520. this->nbSamples = 17;
  521. input.reload(SupportTestsF32::SAMPLES_F32_ID,mgr,this->nbSamples);
  522. refF64.reload(SupportTestsF32::SAMPLES_F64_ID,mgr,this->nbSamples);
  523. outputF64.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  524. break;
  525. }
  526. }
  527. void SupportTestsF32::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
  528. {
  529. (void)id;
  530. output.dump(mgr);
  531. }