SupportTestsF32.cpp 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807
  1. #include "SupportTestsF32.h"
  2. #include <stdio.h>
  3. #include "Error.h"
  4. #include "arm_math.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 *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. float32_t *buf = buffer.ptr();
  190. buf = (float32_t *)malloc((this->nbSamples)*sizeof(float32_t) );
  191. arm_merge_sort_instance_f32 S;
  192. arm_merge_sort_init_f32(&S, ARM_SORT_ASCENDING, buf);
  193. arm_merge_sort_f32(&S,inp,outp,this->nbSamples);
  194. ASSERT_EMPTY_TAIL(output);
  195. ASSERT_EQ(output,ref);
  196. }
  197. void SupportTestsF32::test_merge_sort_const_f32()
  198. {
  199. float32_t *inp = input.ptr();
  200. float32_t *outp = output.ptr();
  201. float32_t *buf = buffer.ptr();
  202. buf = (float32_t *)malloc((this->nbSamples)*sizeof(float32_t) );
  203. arm_merge_sort_instance_f32 S;
  204. arm_merge_sort_init_f32(&S, ARM_SORT_ASCENDING, buf);
  205. arm_merge_sort_f32(&S,inp,outp,this->nbSamples);
  206. ASSERT_EMPTY_TAIL(output);
  207. ASSERT_EQ(output,ref);
  208. }
  209. void SupportTestsF32::test_quick_sort_out_f32()
  210. {
  211. float32_t *inp = input.ptr();
  212. float32_t *outp = output.ptr();
  213. arm_sort_instance_f32 S;
  214. arm_sort_init_f32(&S, ARM_SORT_QUICK, ARM_SORT_ASCENDING);
  215. arm_sort_f32(&S,inp,outp,this->nbSamples);
  216. ASSERT_EMPTY_TAIL(output);
  217. ASSERT_EQ(output,ref);
  218. }
  219. void SupportTestsF32::test_quick_sort_in_f32()
  220. {
  221. float32_t *inp = input.ptr();
  222. arm_sort_instance_f32 S;
  223. arm_sort_init_f32(&S, ARM_SORT_QUICK, ARM_SORT_ASCENDING);
  224. arm_sort_f32(&S,inp,inp,this->nbSamples);
  225. ASSERT_EMPTY_TAIL(input);
  226. ASSERT_EQ(input,ref);
  227. }
  228. void SupportTestsF32::test_quick_sort_const_f32()
  229. {
  230. float32_t *inp = input.ptr();
  231. float32_t *outp = output.ptr();
  232. arm_sort_instance_f32 S;
  233. arm_sort_init_f32(&S, ARM_SORT_QUICK, ARM_SORT_ASCENDING);
  234. arm_sort_f32(&S,inp,outp,this->nbSamples);
  235. ASSERT_EMPTY_TAIL(output);
  236. ASSERT_EQ(output,ref);
  237. }
  238. void SupportTestsF32::test_selection_sort_out_f32()
  239. {
  240. float32_t *inp = input.ptr();
  241. float32_t *outp = output.ptr();
  242. arm_sort_instance_f32 S;
  243. arm_sort_init_f32(&S, ARM_SORT_SELECTION, ARM_SORT_ASCENDING);
  244. arm_sort_f32(&S,inp,outp,this->nbSamples);
  245. ASSERT_EMPTY_TAIL(output);
  246. ASSERT_EQ(output,ref);
  247. }
  248. void SupportTestsF32::test_selection_sort_in_f32()
  249. {
  250. float32_t *inp = input.ptr();
  251. arm_sort_instance_f32 S;
  252. arm_sort_init_f32(&S, ARM_SORT_SELECTION, ARM_SORT_ASCENDING);
  253. arm_sort_f32(&S,inp,inp,this->nbSamples);
  254. ASSERT_EMPTY_TAIL(input);
  255. ASSERT_EQ(input,ref);
  256. }
  257. void SupportTestsF32::test_selection_sort_const_f32()
  258. {
  259. float32_t *inp = input.ptr();
  260. float32_t *outp = output.ptr();
  261. arm_sort_instance_f32 S;
  262. arm_sort_init_f32(&S, ARM_SORT_SELECTION, ARM_SORT_ASCENDING);
  263. arm_sort_f32(&S,inp,outp,this->nbSamples);
  264. ASSERT_EMPTY_TAIL(output);
  265. ASSERT_EQ(output,ref);
  266. }
  267. void SupportTestsF32::test_spline_square_f32()
  268. {
  269. const float32_t *inpX = inputX.ptr();
  270. const float32_t *inpY = inputY.ptr();
  271. const float32_t *outX = outputX.ptr();
  272. float32_t *outp = output.ptr();
  273. float32_t *buf = buffer.ptr();
  274. buf=(float32_t*)malloc((3*4-1)*sizeof(float32_t));
  275. arm_spline_instance_f32 S;
  276. arm_spline_init_f32(&S, 4, ARM_SPLINE_PARABOLIC_RUNOUT, buf);
  277. arm_spline_f32(&S, inpX, inpY, outX, outp, 20);
  278. ASSERT_EMPTY_TAIL(output);
  279. ASSERT_SNR(output,ref,(float32_t)SNR_THRESHOLD);
  280. }
  281. void SupportTestsF32::test_spline_sine_f32()
  282. {
  283. const float32_t *inpX = inputX.ptr();
  284. const float32_t *inpY = inputY.ptr();
  285. const float32_t *outX = outputX.ptr();
  286. float32_t *outp = output.ptr();
  287. float32_t *buf = buffer.ptr();
  288. buf=(float32_t*)malloc((3*9-1)*sizeof(float32_t));
  289. arm_spline_instance_f32 S;
  290. arm_spline_init_f32(&S, 9, ARM_SPLINE_NATURAL, buf);
  291. arm_spline_f32(&S, inpX, inpY, outX, outp, 33);
  292. ASSERT_EMPTY_TAIL(output);
  293. ASSERT_SNR(output,ref,(float32_t)SNR_THRESHOLD);
  294. }
  295. void SupportTestsF32::test_spline_ramp_f32()
  296. {
  297. const float32_t *inpX = inputX.ptr();
  298. const float32_t *inpY = inputY.ptr();
  299. const float32_t *outX = outputX.ptr();
  300. float32_t *outp = output.ptr();
  301. float32_t *buf = buffer.ptr();
  302. buf=(float32_t*)malloc((3*3-1)*sizeof(float32_t));
  303. arm_spline_instance_f32 S;
  304. arm_spline_init_f32(&S, 3, ARM_SPLINE_PARABOLIC_RUNOUT, buf);
  305. arm_spline_f32(&S, inpX, inpY, outX, outp, 30);
  306. ASSERT_EMPTY_TAIL(output);
  307. ASSERT_SNR(output,ref,(float32_t)SNR_THRESHOLD);
  308. }
  309. void SupportTestsF32::setUp(Testing::testID_t id,std::vector<Testing::param_t>& paramsArgs,Client::PatternMgr *mgr)
  310. {
  311. switch(id)
  312. {
  313. case TEST_WEIGHTED_SUM_F32_1:
  314. this->nbSamples = 3;
  315. input.reload(SupportTestsF32::INPUTS_F32_ID,mgr,this->nbSamples);
  316. coefs.reload(SupportTestsF32::WEIGHTS_F32_ID,mgr,this->nbSamples);
  317. ref.reload(SupportTestsF32::REF_F32_ID,mgr);
  318. output.create(1,SupportTestsF32::OUT_F32_ID,mgr);
  319. this->offset=0;
  320. break;
  321. case TEST_WEIGHTED_SUM_F32_2:
  322. this->nbSamples = 8;
  323. input.reload(SupportTestsF32::INPUTS_F32_ID,mgr,this->nbSamples);
  324. coefs.reload(SupportTestsF32::WEIGHTS_F32_ID,mgr,this->nbSamples);
  325. ref.reload(SupportTestsF32::REF_F32_ID,mgr);
  326. output.create(1,SupportTestsF32::OUT_F32_ID,mgr);
  327. this->offset=1;
  328. break;
  329. case TEST_WEIGHTED_SUM_F32_3:
  330. this->nbSamples = 11;
  331. input.reload(SupportTestsF32::INPUTS_F32_ID,mgr,this->nbSamples);
  332. coefs.reload(SupportTestsF32::WEIGHTS_F32_ID,mgr,this->nbSamples);
  333. ref.reload(SupportTestsF32::REF_F32_ID,mgr);
  334. output.create(1,SupportTestsF32::OUT_F32_ID,mgr);
  335. this->offset=2;
  336. break;
  337. case TEST_COPY_F32_4:
  338. this->nbSamples = 3;
  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_COPY_F32_5:
  343. this->nbSamples = 8;
  344. input.reload(SupportTestsF32::SAMPLES_F32_ID,mgr,this->nbSamples);
  345. output.create(input.nbSamples(),SupportTestsF32::OUT_F32_ID,mgr);
  346. break;
  347. case TEST_COPY_F32_6:
  348. this->nbSamples = 11;
  349. input.reload(SupportTestsF32::SAMPLES_F32_ID,mgr,this->nbSamples);
  350. output.create(input.nbSamples(),SupportTestsF32::OUT_F32_ID,mgr);
  351. break;
  352. case TEST_FILL_F32_7:
  353. this->nbSamples = 3;
  354. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  355. break;
  356. case TEST_FILL_F32_8:
  357. this->nbSamples = 8;
  358. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  359. break;
  360. case TEST_FILL_F32_9:
  361. this->nbSamples = 11;
  362. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  363. break;
  364. case TEST_FLOAT_TO_Q15_10:
  365. this->nbSamples = 7;
  366. input.reload(SupportTestsF32::SAMPLES_F32_ID,mgr,this->nbSamples);
  367. refQ15.reload(SupportTestsF32::SAMPLES_Q15_ID,mgr,this->nbSamples);
  368. outputQ15.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  369. break;
  370. case TEST_FLOAT_TO_Q15_11:
  371. this->nbSamples = 16;
  372. input.reload(SupportTestsF32::SAMPLES_F32_ID,mgr,this->nbSamples);
  373. refQ15.reload(SupportTestsF32::SAMPLES_Q15_ID,mgr,this->nbSamples);
  374. outputQ15.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  375. break;
  376. case TEST_FLOAT_TO_Q15_12:
  377. this->nbSamples = 17;
  378. input.reload(SupportTestsF32::SAMPLES_F32_ID,mgr,this->nbSamples);
  379. refQ15.reload(SupportTestsF32::SAMPLES_Q15_ID,mgr,this->nbSamples);
  380. outputQ15.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  381. break;
  382. case TEST_FLOAT_TO_Q31_13:
  383. this->nbSamples = 3;
  384. input.reload(SupportTestsF32::SAMPLES_F32_ID,mgr,this->nbSamples);
  385. refQ31.reload(SupportTestsF32::SAMPLES_Q31_ID,mgr,this->nbSamples);
  386. outputQ31.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  387. break;
  388. case TEST_FLOAT_TO_Q31_14:
  389. this->nbSamples = 8;
  390. input.reload(SupportTestsF32::SAMPLES_F32_ID,mgr,this->nbSamples);
  391. refQ31.reload(SupportTestsF32::SAMPLES_Q31_ID,mgr,this->nbSamples);
  392. outputQ31.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  393. break;
  394. case TEST_FLOAT_TO_Q31_15:
  395. this->nbSamples = 11;
  396. input.reload(SupportTestsF32::SAMPLES_F32_ID,mgr,this->nbSamples);
  397. refQ31.reload(SupportTestsF32::SAMPLES_Q31_ID,mgr,this->nbSamples);
  398. outputQ31.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  399. break;
  400. case TEST_FLOAT_TO_Q7_16:
  401. this->nbSamples = 15;
  402. input.reload(SupportTestsF32::SAMPLES_F32_ID,mgr,this->nbSamples);
  403. refQ7.reload(SupportTestsF32::SAMPLES_Q7_ID,mgr,this->nbSamples);
  404. outputQ7.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  405. break;
  406. case TEST_FLOAT_TO_Q7_17:
  407. this->nbSamples = 32;
  408. input.reload(SupportTestsF32::SAMPLES_F32_ID,mgr,this->nbSamples);
  409. refQ7.reload(SupportTestsF32::SAMPLES_Q7_ID,mgr,this->nbSamples);
  410. outputQ7.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  411. break;
  412. case TEST_FLOAT_TO_Q7_18:
  413. this->nbSamples = 33;
  414. input.reload(SupportTestsF32::SAMPLES_F32_ID,mgr,this->nbSamples);
  415. refQ7.reload(SupportTestsF32::SAMPLES_Q7_ID,mgr,this->nbSamples);
  416. outputQ7.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  417. break;
  418. case TEST_BITONIC_SORT_OUT_F32_19:
  419. this->nbSamples = 16;
  420. input.reload(SupportTestsF32::INPUT_BITONIC_SORT_16_F32_ID,mgr,this->nbSamples);
  421. ref.reload(SupportTestsF32::REF_BITONIC_SORT_16_F32_ID,mgr);
  422. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  423. break;
  424. case TEST_BITONIC_SORT_OUT_F32_20:
  425. this->nbSamples = 32;
  426. input.reload(SupportTestsF32::INPUT_BITONIC_SORT_32_F32_ID,mgr,this->nbSamples);
  427. ref.reload(SupportTestsF32::REF_BITONIC_SORT_32_F32_ID,mgr);
  428. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  429. break;
  430. case TEST_BITONIC_SORT_IN_F32_21:
  431. this->nbSamples = 32;
  432. input.reload(SupportTestsF32::INPUT_BITONIC_SORT_32_F32_ID,mgr,this->nbSamples);
  433. ref.reload(SupportTestsF32::REF_BITONIC_SORT_32_F32_ID,mgr);
  434. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  435. break;
  436. case TEST_BITONIC_SORT_CONST_F32_22:
  437. this->nbSamples = 16;
  438. input.reload(SupportTestsF32::INPUT_SORT_CONST_F32_ID,mgr,this->nbSamples);
  439. ref.reload(SupportTestsF32::REF_SORT_CONST_F32_ID,mgr);
  440. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  441. break;
  442. case TEST_BUBBLE_SORT_OUT_F32_23:
  443. this->nbSamples = 11;
  444. input.reload(SupportTestsF32::INPUT_SORT_F32_ID,mgr,this->nbSamples);
  445. ref.reload(SupportTestsF32::REF_SORT_F32_ID,mgr);
  446. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  447. break;
  448. case TEST_BUBBLE_SORT_IN_F32_24:
  449. this->nbSamples = 11;
  450. input.reload(SupportTestsF32::INPUT_SORT_F32_ID,mgr,this->nbSamples);
  451. ref.reload(SupportTestsF32::REF_SORT_F32_ID,mgr);
  452. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  453. break;
  454. case TEST_BUBBLE_SORT_CONST_F32_25:
  455. this->nbSamples = 16;
  456. input.reload(SupportTestsF32::INPUT_SORT_CONST_F32_ID,mgr,this->nbSamples);
  457. ref.reload(SupportTestsF32::REF_SORT_CONST_F32_ID,mgr);
  458. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  459. break;
  460. case TEST_HEAP_SORT_OUT_F32_26:
  461. this->nbSamples = 11;
  462. input.reload(SupportTestsF32::INPUT_SORT_F32_ID,mgr,this->nbSamples);
  463. ref.reload(SupportTestsF32::REF_SORT_F32_ID,mgr);
  464. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  465. break;
  466. case TEST_HEAP_SORT_IN_F32_27:
  467. this->nbSamples = 11;
  468. input.reload(SupportTestsF32::INPUT_SORT_F32_ID,mgr,this->nbSamples);
  469. ref.reload(SupportTestsF32::REF_SORT_F32_ID,mgr);
  470. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  471. break;
  472. case TEST_HEAP_SORT_CONST_F32_28:
  473. this->nbSamples = 16;
  474. input.reload(SupportTestsF32::INPUT_SORT_CONST_F32_ID,mgr,this->nbSamples);
  475. ref.reload(SupportTestsF32::REF_SORT_CONST_F32_ID,mgr);
  476. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  477. break;
  478. case TEST_INSERTION_SORT_OUT_F32_29:
  479. this->nbSamples = 11;
  480. input.reload(SupportTestsF32::INPUT_SORT_F32_ID,mgr,this->nbSamples);
  481. ref.reload(SupportTestsF32::REF_SORT_F32_ID,mgr);
  482. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  483. break;
  484. case TEST_INSERTION_SORT_IN_F32_30:
  485. this->nbSamples = 11;
  486. input.reload(SupportTestsF32::INPUT_SORT_F32_ID,mgr,this->nbSamples);
  487. ref.reload(SupportTestsF32::REF_SORT_F32_ID,mgr);
  488. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  489. break;
  490. case TEST_INSERTION_SORT_CONST_F32_31:
  491. this->nbSamples = 16;
  492. input.reload(SupportTestsF32::INPUT_SORT_CONST_F32_ID,mgr,this->nbSamples);
  493. ref.reload(SupportTestsF32::REF_SORT_CONST_F32_ID,mgr);
  494. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  495. break;
  496. case TEST_MERGE_SORT_OUT_F32_32:
  497. this->nbSamples = 11;
  498. input.reload(SupportTestsF32::INPUT_SORT_F32_ID,mgr,this->nbSamples);
  499. ref.reload(SupportTestsF32::REF_SORT_F32_ID,mgr);
  500. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  501. break;
  502. case TEST_MERGE_SORT_CONST_F32_33:
  503. this->nbSamples = 16;
  504. input.reload(SupportTestsF32::INPUT_SORT_CONST_F32_ID,mgr,this->nbSamples);
  505. ref.reload(SupportTestsF32::REF_SORT_CONST_F32_ID,mgr);
  506. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  507. break;
  508. case TEST_QUICK_SORT_OUT_F32_34:
  509. this->nbSamples = 11;
  510. input.reload(SupportTestsF32::INPUT_SORT_F32_ID,mgr,this->nbSamples);
  511. ref.reload(SupportTestsF32::REF_SORT_F32_ID,mgr);
  512. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  513. break;
  514. case TEST_QUICK_SORT_IN_F32_35:
  515. this->nbSamples = 11;
  516. input.reload(SupportTestsF32::INPUT_SORT_F32_ID,mgr,this->nbSamples);
  517. ref.reload(SupportTestsF32::REF_SORT_F32_ID,mgr);
  518. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  519. break;
  520. case TEST_QUICK_SORT_CONST_F32_36:
  521. this->nbSamples = 16;
  522. input.reload(SupportTestsF32::INPUT_SORT_CONST_F32_ID,mgr,this->nbSamples);
  523. ref.reload(SupportTestsF32::REF_SORT_CONST_F32_ID,mgr);
  524. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  525. break;
  526. case TEST_SELECTION_SORT_OUT_F32_37:
  527. this->nbSamples = 11;
  528. input.reload(SupportTestsF32::INPUT_SORT_F32_ID,mgr,this->nbSamples);
  529. ref.reload(SupportTestsF32::REF_SORT_F32_ID,mgr);
  530. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  531. break;
  532. case TEST_SELECTION_SORT_IN_F32_38:
  533. this->nbSamples = 11;
  534. input.reload(SupportTestsF32::INPUT_SORT_F32_ID,mgr,this->nbSamples);
  535. ref.reload(SupportTestsF32::REF_SORT_F32_ID,mgr);
  536. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  537. break;
  538. case TEST_SELECTION_SORT_CONST_F32_39:
  539. this->nbSamples = 16;
  540. input.reload(SupportTestsF32::INPUT_SORT_CONST_F32_ID,mgr,this->nbSamples);
  541. ref.reload(SupportTestsF32::REF_SORT_CONST_F32_ID,mgr);
  542. output.create(this->nbSamples,SupportTestsF32::OUT_F32_ID,mgr);
  543. break;
  544. case TEST_SPLINE_SQUARE_F32_40:
  545. inputX.reload(SupportTestsF32::INPUT_SPLINE_SQU_X_F32_ID,mgr,4);
  546. inputY.reload(SupportTestsF32::INPUT_SPLINE_SQU_Y_F32_ID,mgr,4);
  547. outputX.reload(SupportTestsF32::OUTPUT_SPLINE_SQU_X_F32_ID,mgr,20);
  548. ref.reload(SupportTestsF32::REF_SPLINE_SQU_F32_ID,mgr,20);
  549. output.create(20,SupportTestsF32::OUT_F32_ID,mgr);
  550. break;
  551. case TEST_SPLINE_SINE_F32_41:
  552. inputX.reload(SupportTestsF32::INPUT_SPLINE_SIN_X_F32_ID,mgr,9);
  553. inputY.reload(SupportTestsF32::INPUT_SPLINE_SIN_Y_F32_ID,mgr,9);
  554. outputX.reload(SupportTestsF32::OUTPUT_SPLINE_SIN_X_F32_ID,mgr,33);
  555. ref.reload(SupportTestsF32::REF_SPLINE_SIN_F32_ID,mgr,33);
  556. output.create(33,SupportTestsF32::OUT_F32_ID,mgr);
  557. break;
  558. case TEST_SPLINE_RAMP_F32_42:
  559. inputX.reload(SupportTestsF32::INPUT_SPLINE_RAM_X_F32_ID,mgr,3);
  560. inputY.reload(SupportTestsF32::INPUT_SPLINE_RAM_Y_F32_ID,mgr,3);
  561. outputX.reload(SupportTestsF32::OUTPUT_SPLINE_RAM_X_F32_ID,mgr,30);
  562. ref.reload(SupportTestsF32::REF_SPLINE_RAM_F32_ID,mgr,30);
  563. output.create(30,SupportTestsF32::OUT_F32_ID,mgr);
  564. break;
  565. }
  566. }
  567. void SupportTestsF32::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
  568. {
  569. output.dump(mgr);
  570. }