StatsF16.cpp 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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_max_no_idx_f16()
  15. {
  16. float16_t result;
  17. arm_max_no_idx_f16(inap,
  18. this->nb,
  19. &result);
  20. }
  21. void StatsF16::test_min_f16()
  22. {
  23. float16_t result;
  24. uint32_t indexval;
  25. arm_min_f16(inap,
  26. this->nb,
  27. &result,
  28. &indexval);
  29. }
  30. void StatsF16::test_mean_f16()
  31. {
  32. float16_t result;
  33. arm_mean_f16(inap,
  34. this->nb,
  35. &result);
  36. }
  37. void StatsF16::test_power_f16()
  38. {
  39. float16_t result;
  40. arm_power_f16(inap,
  41. this->nb,
  42. &result);
  43. }
  44. void StatsF16::test_rms_f16()
  45. {
  46. float16_t result;
  47. arm_rms_f16(inap,
  48. this->nb,
  49. &result);
  50. }
  51. void StatsF16::test_std_f16()
  52. {
  53. float16_t result;
  54. arm_std_f16(inap,
  55. this->nb,
  56. &result);
  57. }
  58. void StatsF16::test_var_f16()
  59. {
  60. float16_t result;
  61. arm_var_f16(inap,
  62. this->nb,
  63. &result);
  64. }
  65. void StatsF16::test_entropy_f16()
  66. {
  67. float16_t out;
  68. out = arm_entropy_f16(inap,this->nb);
  69. }
  70. void StatsF16::test_logsumexp_f16()
  71. {
  72. float16_t out;
  73. out = arm_logsumexp_f16(inap,this->nb);
  74. }
  75. void StatsF16::test_kullback_leibler_f16()
  76. {
  77. float16_t out;
  78. out = arm_kullback_leibler_f16(inap,inbp,this->nb);
  79. }
  80. void StatsF16::test_logsumexp_dot_prod_f16()
  81. {
  82. float16_t out;
  83. out = arm_logsumexp_dot_prod_f16(inap,inbp,this->nb,tmpp);
  84. }
  85. void StatsF16::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(StatsF16::INPUT1_F16_ID,mgr,this->nb);
  90. inap=inputA.ptr();
  91. switch(id)
  92. {
  93. case TEST_KULLBACK_LEIBLER_F16_10:
  94. inputB.reload(StatsF16::INPUT2_F16_ID,mgr,this->nb);
  95. inbp=inputB.ptr();
  96. break;
  97. case TEST_LOGSUMEXP_DOT_PROD_F16_11:
  98. inputB.reload(StatsF16::INPUT2_F16_ID,mgr,this->nb);
  99. inbp=inputB.ptr();
  100. tmp.create(this->nb,StatsF16::TMP_F16_ID,mgr);
  101. tmpp = tmp.ptr();
  102. break;
  103. }
  104. }
  105. void StatsF16::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
  106. {
  107. (void)id;
  108. (void)mgr;
  109. }