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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
/* { dg-additional-options "-std=gnu99" } */
extern void abort ();
#define M(x, y, z) O(x, y, z)
#define O(x, y, z) x ## _ ## y ## _ ## z
#pragma omp declare target
#define F for
#define G f
#define S
#define N(x) M(x, G, normal)
#include "for-2.h"
#undef S
#undef N
#undef F
#undef G
#pragma omp end declare target
#undef OMPTGT
#undef OMPFROM
#undef OMPTO
#define DO_PRAGMA(x) _Pragma (#x)
#define OMPTGT DO_PRAGMA (omp target)
#define OMPFROM(v) DO_PRAGMA (omp target update from(v))
#define OMPTO(v) DO_PRAGMA (omp target update to(v))
#define F teams distribute
#define G td
#define S
#define N(x) M(x, G, normal)
#include "for-2.h"
#undef S
#undef N
#undef F
#undef G
#define F teams distribute
#define G td_ds128
#define S dist_schedule(static, 128)
#define N(x) M(x, G, normal)
#include "for-2.h"
#undef S
#undef N
#undef F
#undef G
#define F teams distribute simd
#define G tds
#define S
#define N(x) M(x, G, normal)
#include "for-2.h"
#undef S
#undef N
#undef F
#undef G
#define F teams distribute simd
#define G tds_ds128
#define S dist_schedule(static, 128)
#define N(x) M(x, G, normal)
#include "for-2.h"
#undef S
#undef N
#undef F
#undef G
#define F teams distribute parallel for
#define G tdpf
#include "for-1.h"
#undef F
#undef G
#define F teams distribute parallel for dist_schedule(static, 128)
#define G tdpf_ds128
#include "for-1.h"
#undef F
#undef G
#define F teams distribute parallel for simd
#define G tdpfs
#include "for-1.h"
#undef F
#undef G
#define F teams distribute parallel for simd dist_schedule(static, 128)
#define G tdpfs_ds128
#include "for-1.h"
#undef F
#undef G
int
main ()
{
if (test_td_normal ()
|| test_td_ds128_normal ()
|| test_tds_normal ()
|| test_tds_ds128_normal ()
|| test_tdpf_static ()
|| test_tdpf_static32 ()
|| test_tdpf_auto ()
|| test_tdpf_guided32 ()
|| test_tdpf_runtime ()
|| test_tdpf_ds128_static ()
|| test_tdpf_ds128_static32 ()
|| test_tdpf_ds128_auto ()
|| test_tdpf_ds128_guided32 ()
|| test_tdpf_ds128_runtime ()
|| test_tdpfs_static ()
|| test_tdpfs_static32 ()
|| test_tdpfs_auto ()
|| test_tdpfs_guided32 ()
|| test_tdpfs_runtime ()
|| test_tdpfs_ds128_static ()
|| test_tdpfs_ds128_static32 ()
|| test_tdpfs_ds128_auto ()
|| test_tdpfs_ds128_guided32 ()
|| test_tdpfs_ds128_runtime ())
abort ();
return 0;
}
|