選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

74 行
1.9 KiB

  1. //
  2. // Lol Engine — Benchmark program
  3. //
  4. // Copyright © 2005—2015 Sam Hocevar <sam@hocevar.net>
  5. //
  6. // This program is free software. It comes without any warranty, to
  7. // the extent permitted by applicable law. You can redistribute it
  8. // and/or modify it under the terms of the Do What the Fuck You Want
  9. // to Public License, Version 2, as published by the WTFPL Task Force.
  10. // See http://www.wtfpl.net/ for more details.
  11. //
  12. #if HAVE_CONFIG_H
  13. # include "config.h"
  14. #endif
  15. #include <cstdio>
  16. #include <lol/engine.h>
  17. using namespace lol;
  18. void bench_real(int mode);
  19. void bench_trig(int mode);
  20. void bench_matrix(int mode);
  21. void bench_half(int mode);
  22. int main(int argc, char **argv)
  23. {
  24. UNUSED(argc, argv);
  25. msg::info("-----------------------\n");
  26. msg::info(" High precision floats\n");
  27. msg::info("-----------------------\n");
  28. bench_real(1);
  29. msg::info("--------------------------\n");
  30. msg::info(" Trigonometry [-1e5, 1e5]\n");
  31. msg::info("--------------------------\n");
  32. bench_trig(1);
  33. msg::info("------------------------\n");
  34. msg::info(" Trigonometry [-pi, pi]\n");
  35. msg::info("------------------------\n");
  36. bench_trig(2);
  37. msg::info("----------------------------\n");
  38. msg::info(" Trigonometry [-1e-2, 1e-2]\n");
  39. msg::info("----------------------------\n");
  40. bench_trig(3);
  41. msg::info("----------------------------\n");
  42. msg::info(" Float matrices [-2.0, 2.0]\n");
  43. msg::info("----------------------------\n");
  44. bench_matrix(1);
  45. msg::info("-------------------------------------\n");
  46. msg::info(" Half precision floats (random bits)\n");
  47. msg::info("-------------------------------------\n");
  48. bench_half(1);
  49. msg::info("-----------------------------------\n");
  50. msg::info(" Half precision floats [-2.0, 2.0]\n");
  51. msg::info("-----------------------------------\n");
  52. bench_half(2);
  53. #if defined _WIN32
  54. getchar();
  55. #endif
  56. return EXIT_SUCCESS;
  57. }