Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

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