forked from vlfeat/vlfeat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_mathop.c
78 lines (66 loc) · 1.53 KB
/
test_mathop.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#include <vl/generic.h>
#include <vl/mathop.h>
#include <math.h>
#include <float.h>
int
main (int argc VL_UNUSED, char** argv VL_UNUSED)
{
int error = 0 ;
/* -----------------------------------------------------------------
* vl_fast_resqrt_*
* -------------------------------------------------------------- */
VL_PRINTF ("%20s %10s %10s %10s\n", "func", "elaps [s]", "eval/s", "chksum") ;
#define SFX f
#define SFX2 FLT
#define T float
#define SQRT sqrtf
#define ABS fabsf
#define ONE 1.0F
#include "test_mathop_fast_resqrt.tc"
#undef ONE
#undef ABS
#undef SQRT
#undef T
#undef SFX2
#undef SFX
#define SFX d
#define SFX2 DBL
#define T float
#define SQRT sqrt
#define ABS fabs
#define ONE 1.0
#include "test_mathop_fast_resqrt.tc"
#undef ONE
#undef ABS
#undef SQRT
#undef T
#undef SFX2
#undef SFX
VL_PRINTF("\n") ;
/* -----------------------------------------------------------------
* vl_fast_sqrt_ui*
* -------------------------------------------------------------- */
VL_PRINTF ("%20s %10s %10s %10s\n", "func", "elaps [s]", "eval/s", "chksum") ;
#undef SFX
#undef T
#undef STEP
#define SFX 32
#define T vl_uint32
#define STEP 7
#include "test_mathop_fast_sqrt_ui.tc"
#undef SFX
#undef T
#undef STEP
#define SFX 16
#define T vl_uint16
#define STEP 0
#include "test_mathop_fast_sqrt_ui.tc"
#undef SFX
#undef T
#undef STEP
#define SFX 8
#define T vl_uint8
#define STEP 0
#include "test_mathop_fast_sqrt_ui.tc"
return error ;
}