common_tests.cpp 839 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #include "allocator.h"
  2. #include <dsppp/arch.hpp>
  3. #include <dsppp/fixed_point.hpp>
  4. #include <dsppp/matrix.hpp>
  5. #include "cmsis_tests.h"
  6. extern "C" {
  7. void memory_pool_stats();
  8. }
  9. #if 0
  10. template<>
  11. void init_array(Vector_Base<float16_t> &pDst,std::size_t nb)
  12. {
  13. for(std::size_t i=0;i<nb;i++)
  14. {
  15. pDst[i] = 0.1*i;
  16. }
  17. }
  18. #endif
  19. template<>
  20. bool validate(const float32_t* a,
  21. const float32_t* b,
  22. std::size_t nb,
  23. float abser,
  24. float reler)
  25. {
  26. for(std::size_t i=0;i<nb;i++)
  27. {
  28. if (ERROR(a[i],b[i],abser,reler) )
  29. {
  30. std::cout << "Error at :" << i << " ; res=" << a[i] << " ; ref=" << b[i] << "\r\n";
  31. ERRVAL(a[i],b[i],abser,reler);
  32. return(false);
  33. }
  34. }
  35. return(true);
  36. }
  37. void memory_pool_stats()
  38. {
  39. print_map("Stats");
  40. }