25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

71 lines
1.9 KiB

  1. //
  2. // Lol Engine - Benchmark program
  3. //
  4. // Copyright: (c) 2005-2011 Sam Hocevar <sam@hocevar.net>
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the Do What The Fuck You Want To
  7. // Public License, Version 2, as published by Sam Hocevar. See
  8. // http://sam.zoy.org/projects/COPYING.WTFPL for more details.
  9. //
  10. #if defined HAVE_CONFIG_H
  11. # include "config.h"
  12. #endif
  13. #include <cstdio>
  14. #include "core.h"
  15. using namespace std;
  16. using namespace lol;
  17. void bench_real(int mode);
  18. void bench_trig(int mode);
  19. void bench_matrix(int mode);
  20. void bench_half(int mode);
  21. int main(int argc, char **argv)
  22. {
  23. Log::Info("-----------------------\n");
  24. Log::Info(" High precision floats\n");
  25. Log::Info("-----------------------\n");
  26. bench_real(1);
  27. Log::Info("--------------------------\n");
  28. Log::Info(" Trigonometry [-1e5, 1e5]\n");
  29. Log::Info("--------------------------\n");
  30. bench_trig(1);
  31. Log::Info("------------------------\n");
  32. Log::Info(" Trigonometry [-pi, pi]\n");
  33. Log::Info("------------------------\n");
  34. bench_trig(2);
  35. Log::Info("----------------------------\n");
  36. Log::Info(" Trigonometry [-1e-2, 1e-2]\n");
  37. Log::Info("----------------------------\n");
  38. bench_trig(3);
  39. Log::Info("----------------------------\n");
  40. Log::Info(" Float matrices [-2.0, 2.0]\n");
  41. Log::Info("----------------------------\n");
  42. bench_matrix(1);
  43. Log::Info("-------------------------------------\n");
  44. Log::Info(" Half precision floats (random bits)\n");
  45. Log::Info("-------------------------------------\n");
  46. bench_half(1);
  47. Log::Info("-----------------------------------\n");
  48. Log::Info(" Half precision floats [-2.0, 2.0]\n");
  49. Log::Info("-----------------------------------\n");
  50. bench_half(2);
  51. #if defined _WIN32
  52. getchar();
  53. #endif
  54. return EXIT_SUCCESS;
  55. }