SupportTestsF32.cpp 24 KB

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