source: trunk/test/benchsuite.cpp @ 1309

Last change on this file since 1309 was 977, checked in by sam, 9 years ago

core: new benchmark snippet for operations on reals.

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