StatsF16.cpp 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. #include "StatsF16.h"
  2. #include <stdio.h>
  3. #include "Error.h"
  4. #include "Test.h"
  5. void StatsF16::test_max_f16()
  6. {
  7. float16_t result;
  8. uint32_t indexval;
  9. arm_max_f16(inap,
  10. this->nb,
  11. &result,
  12. &indexval);
  13. }
  14. void StatsF16::test_absmax_f16()
  15. {
  16. float16_t result;
  17. uint32_t indexval;
  18. arm_absmax_f16(inap,
  19. this->nb,
  20. &result,
  21. &indexval);
  22. }
  23. void StatsF16::test_max_no_idx_f16()
  24. {
  25. float16_t result;
  26. arm_max_no_idx_f16(inap,
  27. this->nb,
  28. &result);
  29. }
  30. void StatsF16::test_min_f16()
  31. {
  32. float16_t result;
  33. uint32_t indexval;
  34. arm_min_f16(inap,
  35. this->nb,
  36. &result,
  37. &indexval);
  38. }
  39. void StatsF16::test_absmin_f16()
  40. {
  41. float16_t result;
  42. uint32_t indexval;
  43. arm_absmin_f16(inap,
  44. this->nb,
  45. &result,
  46. &indexval);
  47. }
  48. void StatsF16::test_mean_f16()
  49. {
  50. float16_t result;
  51. arm_mean_f16(inap,
  52. this->nb,
  53. &result);
  54. }
  55. void StatsF16::test_power_f16()
  56. {
  57. float16_t result;
  58. arm_power_f16(inap,
  59. this->nb,
  60. &result);
  61. }
  62. void StatsF16::test_rms_f16()
  63. {
  64. float16_t result;
  65. arm_rms_f16(inap,
  66. this->nb,
  67. &result);
  68. }
  69. void StatsF16::test_std_f16()
  70. {
  71. float16_t result;
  72. arm_std_f16(inap,
  73. this->nb,
  74. &result);
  75. }
  76. void StatsF16::test_var_f16()
  77. {
  78. float16_t result;
  79. arm_var_f16(inap,
  80. this->nb,
  81. &result);
  82. }
  83. void StatsF16::test_entropy_f16()
  84. {
  85. float16_t out;
  86. out = arm_entropy_f16(inap,this->nb);
  87. }
  88. void StatsF16::test_logsumexp_f16()
  89. {
  90. float16_t out;
  91. out = arm_logsumexp_f16(inap,this->nb);
  92. }
  93. void StatsF16::test_kullback_leibler_f16()
  94. {
  95. float16_t out;
  96. out = arm_kullback_leibler_f16(inap,inbp,this->nb);
  97. }
  98. void StatsF16::test_logsumexp_dot_prod_f16()
  99. {
  100. float16_t out;
  101. out = arm_logsumexp_dot_prod_f16(inap,inbp,this->nb,tmpp);
  102. }
  103. void StatsF16::setUp(Testing::testID_t id,std::vector<Testing::param_t>& paramsArgs,Client::PatternMgr *mgr)
  104. {
  105. std::vector<Testing::param_t>::iterator it = paramsArgs.begin();
  106. this->nb = *it;
  107. inputA.reload(StatsF16::INPUT1_F16_ID,mgr,this->nb);
  108. inap=inputA.ptr();
  109. switch(id)
  110. {
  111. case TEST_KULLBACK_LEIBLER_F16_10:
  112. inputB.reload(StatsF16::INPUT2_F16_ID,mgr,this->nb);
  113. inbp=inputB.ptr();
  114. break;
  115. case TEST_LOGSUMEXP_DOT_PROD_F16_11:
  116. inputB.reload(StatsF16::INPUT2_F16_ID,mgr,this->nb);
  117. inbp=inputB.ptr();
  118. tmp.create(this->nb,StatsF16::TMP_F16_ID,mgr);
  119. tmpp = tmp.ptr();
  120. break;
  121. }
  122. }
  123. void StatsF16::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
  124. {
  125. (void)id;
  126. (void)mgr;
  127. }