Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

benchsuite.cpp 1.7 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. #if USE_SDL && defined __APPLE__
  15. # include <SDL_main.h>
  16. #endif
  17. #include "core.h"
  18. using namespace std;
  19. using namespace lol;
  20. void bench_trig(int mode);
  21. void bench_matrix(int mode);
  22. void bench_half(int mode);
  23. int main(int argc, char **argv)
  24. {
  25. Log::Info("--------------------------\n");
  26. Log::Info(" Trigonometry [-1e5, 1e5]\n");
  27. Log::Info("--------------------------\n");
  28. bench_trig(1);
  29. Log::Info("------------------------\n");
  30. Log::Info(" Trigonometry [-pi, pi]\n");
  31. Log::Info("------------------------\n");
  32. bench_trig(2);
  33. Log::Info("----------------------------\n");
  34. Log::Info(" Trigonometry [-1e-2, 1e-2]\n");
  35. Log::Info("----------------------------\n");
  36. bench_trig(3);
  37. Log::Info("----------------------------\n");
  38. Log::Info(" Float matrices [-2.0, 2.0]\n");
  39. Log::Info("----------------------------\n");
  40. bench_matrix(1);
  41. Log::Info("-------------------------------------\n");
  42. Log::Info(" Half precision floats (random bits)\n");
  43. Log::Info("-------------------------------------\n");
  44. bench_half(1);
  45. Log::Info("-----------------------------------\n");
  46. Log::Info(" Half precision floats [-2.0, 2.0]\n");
  47. Log::Info("-----------------------------------\n");
  48. bench_half(2);
  49. #if defined _WIN32
  50. getchar();
  51. #endif
  52. return EXIT_SUCCESS;
  53. }