aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.c/for-5.c
blob: 84e636ab0f98e48b447d8a4b3c123ec19a28d642 (plain)
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/* { 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 OMPFROM
#undef OMPTO
#define DO_PRAGMA(x) _Pragma (#x)
#define OMPFROM(v) DO_PRAGMA (omp target update from(v))
#define OMPTO(v) DO_PRAGMA (omp target update to(v))

#define F target parallel for
#define G tpf
#include "for-1.h"
#undef F
#undef G

#define F target simd
#define G t_simd
#define S
#define N(x) M(x, G, normal)
#include "for-2.h"
#undef S
#undef N
#undef F
#undef G

#define F target parallel for simd
#define G tpf_simd
#include "for-1.h"
#undef F
#undef G

#define F target teams distribute
#define G ttd
#define S
#define N(x) M(x, G, normal)
#include "for-2.h"
#undef S
#undef N
#undef F
#undef G

#define F target teams distribute
#define G ttd_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 target teams distribute simd
#define G ttds
#define S
#define N(x) M(x, G, normal)
#include "for-2.h"
#undef S
#undef N
#undef F
#undef G

#define F target teams distribute simd
#define G ttds_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 target teams distribute parallel for
#define G ttdpf
#include "for-1.h"
#undef F
#undef G

#define F target teams distribute parallel for dist_schedule(static, 128)
#define G ttdpf_ds128
#include "for-1.h"
#undef F
#undef G

#define F target teams distribute parallel for simd
#define G ttdpfs
#include "for-1.h"
#undef F
#undef G

#define F target teams distribute parallel for simd dist_schedule(static, 128)
#define G ttdpfs_ds128
#include "for-1.h"
#undef F
#undef G

int
main ()
{
  if (test_tpf_static ()
      || test_tpf_static32 ()
      || test_tpf_auto ()
      || test_tpf_guided32 ()
      || test_tpf_runtime ()
      || test_t_simd_normal ()
      || test_tpf_simd_static ()
      || test_tpf_simd_static32 ()
      || test_tpf_simd_auto ()
      || test_tpf_simd_guided32 ()
      || test_tpf_simd_runtime ()
      || test_ttd_normal ()
      || test_ttd_ds128_normal ()
      || test_ttds_normal ()
      || test_ttds_ds128_normal ()
      || test_ttdpf_static ()
      || test_ttdpf_static32 ()
      || test_ttdpf_auto ()
      || test_ttdpf_guided32 ()
      || test_ttdpf_runtime ()
      || test_ttdpf_ds128_static ()
      || test_ttdpf_ds128_static32 ()
      || test_ttdpf_ds128_auto ()
      || test_ttdpf_ds128_guided32 ()
      || test_ttdpf_ds128_runtime ()
      || test_ttdpfs_static ()
      || test_ttdpfs_static32 ()
      || test_ttdpfs_auto ()
      || test_ttdpfs_guided32 ()
      || test_ttdpfs_runtime ()
      || test_ttdpfs_ds128_static ()
      || test_ttdpfs_ds128_static32 ()
      || test_ttdpfs_ds128_auto ()
      || test_ttdpfs_ds128_guided32 ()
      || test_ttdpfs_ds128_runtime ())
    abort ();
  return 0;
}