StatsF32.cpp 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. #include "StatsF32.h"
  2. #include <stdio.h>
  3. #include "Error.h"
  4. #include "Test.h"
  5. void StatsF32::test_max_f32()
  6. {
  7. float32_t result;
  8. uint32_t indexval;
  9. arm_max_f32(inap,
  10. this->nb,
  11. &result,
  12. &indexval);
  13. }
  14. void StatsF32::test_max_no_idx_f32()
  15. {
  16. float32_t result;
  17. arm_max_no_idx_f32(inap,
  18. this->nb,
  19. &result);
  20. }
  21. void StatsF32::test_min_f32()
  22. {
  23. float32_t result;
  24. uint32_t indexval;
  25. arm_min_f32(inap,
  26. this->nb,
  27. &result,
  28. &indexval);
  29. }
  30. void StatsF32::test_mean_f32()
  31. {
  32. float32_t result;
  33. arm_mean_f32(inap,
  34. this->nb,
  35. &result);
  36. }
  37. void StatsF32::test_power_f32()
  38. {
  39. float32_t result;
  40. arm_power_f32(inap,
  41. this->nb,
  42. &result);
  43. }
  44. void StatsF32::test_rms_f32()
  45. {
  46. float32_t result;
  47. arm_rms_f32(inap,
  48. this->nb,
  49. &result);
  50. }
  51. void StatsF32::test_std_f32()
  52. {
  53. float32_t result;
  54. arm_std_f32(inap,
  55. this->nb,
  56. &result);
  57. }
  58. void StatsF32::test_var_f32()
  59. {
  60. float32_t result;
  61. arm_var_f32(inap,
  62. this->nb,
  63. &result);
  64. }
  65. void StatsF32::test_entropy_f32()
  66. {
  67. float32_t out;
  68. out = arm_entropy_f32(inap,this->nb);
  69. }
  70. void StatsF32::test_logsumexp_f32()
  71. {
  72. float32_t out;
  73. out = arm_logsumexp_f32(inap,this->nb);
  74. }
  75. void StatsF32::test_kullback_leibler_f32()
  76. {
  77. float32_t out;
  78. out = arm_kullback_leibler_f32(inap,inbp,this->nb);
  79. }
  80. void StatsF32::test_logsumexp_dot_prod_f32()
  81. {
  82. float32_t out;
  83. out = arm_logsumexp_dot_prod_f32(inap,inbp,this->nb,tmpp);
  84. }
  85. void StatsF32::setUp(Testing::testID_t id,std::vector<Testing::param_t>& paramsArgs,Client::PatternMgr *mgr)
  86. {
  87. std::vector<Testing::param_t>::iterator it = paramsArgs.begin();
  88. this->nb = *it;
  89. inputA.reload(StatsF32::INPUT1_F32_ID,mgr,this->nb);
  90. inap=inputA.ptr();
  91. switch(id)
  92. {
  93. case TEST_KULLBACK_LEIBLER_F32_10:
  94. inputB.reload(StatsF32::INPUT2_F32_ID,mgr,this->nb);
  95. inbp=inputB.ptr();
  96. break;
  97. case TEST_LOGSUMEXP_DOT_PROD_F32_11:
  98. inputB.reload(StatsF32::INPUT2_F32_ID,mgr,this->nb);
  99. inbp=inputB.ptr();
  100. tmp.create(this->nb,StatsF32::TMP_F32_ID,mgr);
  101. tmpp = tmp.ptr();
  102. break;
  103. }
  104. }
  105. void StatsF32::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
  106. {
  107. (void)id;
  108. }