Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

benchsuite.cpp 1.9 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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://www.wtfpl.net/ 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. UNUSED(argc, argv);
  24. Log::Info("-----------------------\n");
  25. Log::Info(" High precision floats\n");
  26. Log::Info("-----------------------\n");
  27. bench_real(1);
  28. Log::Info("--------------------------\n");
  29. Log::Info(" Trigonometry [-1e5, 1e5]\n");
  30. Log::Info("--------------------------\n");
  31. bench_trig(1);
  32. Log::Info("------------------------\n");
  33. Log::Info(" Trigonometry [-pi, pi]\n");
  34. Log::Info("------------------------\n");
  35. bench_trig(2);
  36. Log::Info("----------------------------\n");
  37. Log::Info(" Trigonometry [-1e-2, 1e-2]\n");
  38. Log::Info("----------------------------\n");
  39. bench_trig(3);
  40. Log::Info("----------------------------\n");
  41. Log::Info(" Float matrices [-2.0, 2.0]\n");
  42. Log::Info("----------------------------\n");
  43. bench_matrix(1);
  44. Log::Info("-------------------------------------\n");
  45. Log::Info(" Half precision floats (random bits)\n");
  46. Log::Info("-------------------------------------\n");
  47. bench_half(1);
  48. Log::Info("-----------------------------------\n");
  49. Log::Info(" Half precision floats [-2.0, 2.0]\n");
  50. Log::Info("-----------------------------------\n");
  51. bench_half(2);
  52. #if defined _WIN32
  53. getchar();
  54. #endif
  55. return EXIT_SUCCESS;
  56. }