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.
 
 
 

73 rindas
1.8 KiB

  1. //
  2. // Lol Engine — Benchmark program
  3. //
  4. // Copyright: © 2005—2015 Sam Hocevar <sam@hocevar.net>
  5. //
  6. // This program is free software; you can redistribute it and/or
  7. // modify it under the terms of the Do What The Fuck You Want To
  8. // Public License, Version 2, as published by Sam Hocevar. See
  9. // http://www.wtfpl.net/ for more details.
  10. //
  11. #if HAVE_CONFIG_H
  12. # include "config.h"
  13. #endif
  14. #include <cstdio>
  15. #include <lol/engine.h>
  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. msg::info("-----------------------\n");
  25. msg::info(" High precision floats\n");
  26. msg::info("-----------------------\n");
  27. bench_real(1);
  28. msg::info("--------------------------\n");
  29. msg::info(" Trigonometry [-1e5, 1e5]\n");
  30. msg::info("--------------------------\n");
  31. bench_trig(1);
  32. msg::info("------------------------\n");
  33. msg::info(" Trigonometry [-pi, pi]\n");
  34. msg::info("------------------------\n");
  35. bench_trig(2);
  36. msg::info("----------------------------\n");
  37. msg::info(" Trigonometry [-1e-2, 1e-2]\n");
  38. msg::info("----------------------------\n");
  39. bench_trig(3);
  40. msg::info("----------------------------\n");
  41. msg::info(" Float matrices [-2.0, 2.0]\n");
  42. msg::info("----------------------------\n");
  43. bench_matrix(1);
  44. msg::info("-------------------------------------\n");
  45. msg::info(" Half precision floats (random bits)\n");
  46. msg::info("-------------------------------------\n");
  47. bench_half(1);
  48. msg::info("-----------------------------------\n");
  49. msg::info(" Half precision floats [-2.0, 2.0]\n");
  50. msg::info("-----------------------------------\n");
  51. bench_half(2);
  52. #if defined _WIN32
  53. getchar();
  54. #endif
  55. return EXIT_SUCCESS;
  56. }