You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
1.7 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. #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. }