source: trunk/test/benchsuite.cpp @ 2297

Last change on this file since 2297 was 2297, checked in by sam, 7 years ago

base: implement UNUSED() macro and put it here and there.

  • Property svn:keywords set to Id
File size: 1.9 KB
Line 
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
11#if defined HAVE_CONFIG_H
12#   include "config.h"
13#endif
14
15#include <cstdio>
16
17#include "core.h"
18
19using namespace std;
20using namespace lol;
21
22void bench_real(int mode);
23void bench_trig(int mode);
24void bench_matrix(int mode);
25void bench_half(int mode);
26
27int main(int argc, char **argv)
28{
29    UNUSED(argc, argv);
30
31    Log::Info("-----------------------\n");
32    Log::Info(" High precision floats\n");
33    Log::Info("-----------------------\n");
34    bench_real(1);
35
36    Log::Info("--------------------------\n");
37    Log::Info(" Trigonometry [-1e5, 1e5]\n");
38    Log::Info("--------------------------\n");
39    bench_trig(1);
40
41    Log::Info("------------------------\n");
42    Log::Info(" Trigonometry [-pi, pi]\n");
43    Log::Info("------------------------\n");
44    bench_trig(2);
45
46    Log::Info("----------------------------\n");
47    Log::Info(" Trigonometry [-1e-2, 1e-2]\n");
48    Log::Info("----------------------------\n");
49    bench_trig(3);
50
51    Log::Info("----------------------------\n");
52    Log::Info(" Float matrices [-2.0, 2.0]\n");
53    Log::Info("----------------------------\n");
54    bench_matrix(1);
55
56    Log::Info("-------------------------------------\n");
57    Log::Info(" Half precision floats (random bits)\n");
58    Log::Info("-------------------------------------\n");
59    bench_half(1);
60
61    Log::Info("-----------------------------------\n");
62    Log::Info(" Half precision floats [-2.0, 2.0]\n");
63    Log::Info("-----------------------------------\n");
64    bench_half(2);
65
66#if defined _WIN32
67    getchar();
68#endif
69
70    return EXIT_SUCCESS;
71}
72
Note: See TracBrowser for help on using the repository browser.