SupportTestsF32.cpp 25 KB

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