-
Notifications
You must be signed in to change notification settings - Fork 107
Expand file tree
/
Copy pathtime_test.c
More file actions
71 lines (54 loc) · 1.23 KB
/
Copy pathtime_test.c
File metadata and controls
71 lines (54 loc) · 1.23 KB
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
#include <stdio.h>
#include "computepi.h"
int main(int argc, char const *argv[])
{
__attribute__((unused)) int N = 400000000;
double pi = 0.0;
#if defined(BASELINE)
pi = compute_pi_baseline(N);
#endif
#if defined(OPENMP_2)
pi = compute_pi_openmp(N, 2);
#endif
#if defined(OPENMP_4)
pi = compute_pi_openmp(N, 4);
#endif
#if defined(AVX)
pi = compute_pi_avx(N);
#endif
#if defined(AVXUNROLL)
pi = compute_pi_avx_unroll(N);
#endif
#if defined(LEIBNIZ)
pi = compute_pi_leibniz(N);
#endif
#if defined(LEIBNIZ_OPENMP_2)
pi = compute_pi_leibniz_openmp(N, 2);
#endif
#if defined(LEIBNIZ_OPENMP_4)
pi = compute_pi_leibniz_openmp(N, 4);
#endif
#if defined(LEIBNIZ_AVX)
pi = compute_pi_leibniz_avx(N);
#endif
#if defined(LEIBNIZ_AVXUNROLL)
pi = compute_pi_leibniz_avx_unroll(N);
#endif
#if defined(EULER)
pi = compute_pi_leibniz(N);
#endif
#if defined(EULER_OPENMP_2)
pi = compute_pi_leibniz_openmp(N, 2);
#endif
#if defined(EULER_OPENMP_4)
pi = compute_pi_leibniz_openmp(N, 4);
#endif
#if defined(EULER_AVX)
pi = compute_pi_leibniz_avx(N);
#endif
#if defined(EULER_AVXUNROLL)
pi = compute_pi_leibniz_avx_unroll(N);
#endif
printf("N = %d , pi = %lf\n", N, pi);
return 0;
}