annotate include/gomp-constants.h @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Communication between GCC and libgomp.
kono
parents:
diff changeset
2
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3 Copyright (C) 2014-2020 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 Contributed by Mentor Embedded.
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 This file is part of the GNU Offloading and Multi Processing Library
kono
parents:
diff changeset
8 (libgomp).
kono
parents:
diff changeset
9
kono
parents:
diff changeset
10 Libgomp is free software; you can redistribute it and/or modify it
kono
parents:
diff changeset
11 under the terms of the GNU General Public License as published by
kono
parents:
diff changeset
12 the Free Software Foundation; either version 3, or (at your option)
kono
parents:
diff changeset
13 any later version.
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY
kono
parents:
diff changeset
16 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
kono
parents:
diff changeset
17 FOR A PARTICULAR PURPOSE. See the GNU General Public License for
kono
parents:
diff changeset
18 more details.
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 Under Section 7 of GPL version 3, you are granted additional
kono
parents:
diff changeset
21 permissions described in the GCC Runtime Library Exception, version
kono
parents:
diff changeset
22 3.1, as published by the Free Software Foundation.
kono
parents:
diff changeset
23
kono
parents:
diff changeset
24 You should have received a copy of the GNU General Public License and
kono
parents:
diff changeset
25 a copy of the GCC Runtime Library Exception along with this program;
kono
parents:
diff changeset
26 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
kono
parents:
diff changeset
27 <http://www.gnu.org/licenses/>. */
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 #ifndef GOMP_CONSTANTS_H
kono
parents:
diff changeset
30 #define GOMP_CONSTANTS_H 1
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 /* Memory mapping types. */
kono
parents:
diff changeset
33
kono
parents:
diff changeset
34 /* One byte. */
kono
parents:
diff changeset
35 #define GOMP_MAP_LAST (1 << 8)
kono
parents:
diff changeset
36
kono
parents:
diff changeset
37 #define GOMP_MAP_FLAG_TO (1 << 0)
kono
parents:
diff changeset
38 #define GOMP_MAP_FLAG_FROM (1 << 1)
kono
parents:
diff changeset
39 /* Special map kinds, enumerated starting here. */
kono
parents:
diff changeset
40 #define GOMP_MAP_FLAG_SPECIAL_0 (1 << 2)
kono
parents:
diff changeset
41 #define GOMP_MAP_FLAG_SPECIAL_1 (1 << 3)
kono
parents:
diff changeset
42 #define GOMP_MAP_FLAG_SPECIAL_2 (1 << 4)
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
43 #define GOMP_MAP_FLAG_SPECIAL_4 (1 << 6)
111
kono
parents:
diff changeset
44 #define GOMP_MAP_FLAG_SPECIAL (GOMP_MAP_FLAG_SPECIAL_1 \
kono
parents:
diff changeset
45 | GOMP_MAP_FLAG_SPECIAL_0)
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
46 #define GOMP_MAP_DEEP_COPY (GOMP_MAP_FLAG_SPECIAL_4 \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
47 | GOMP_MAP_FLAG_SPECIAL_2)
111
kono
parents:
diff changeset
48 /* Flag to force a specific behavior (or else, trigger a run-time error). */
kono
parents:
diff changeset
49 #define GOMP_MAP_FLAG_FORCE (1 << 7)
kono
parents:
diff changeset
50
kono
parents:
diff changeset
51 enum gomp_map_kind
kono
parents:
diff changeset
52 {
kono
parents:
diff changeset
53 /* If not already present, allocate. */
kono
parents:
diff changeset
54 GOMP_MAP_ALLOC = 0,
kono
parents:
diff changeset
55 /* ..., and copy to device. */
kono
parents:
diff changeset
56 GOMP_MAP_TO = (GOMP_MAP_ALLOC | GOMP_MAP_FLAG_TO),
kono
parents:
diff changeset
57 /* ..., and copy from device. */
kono
parents:
diff changeset
58 GOMP_MAP_FROM = (GOMP_MAP_ALLOC | GOMP_MAP_FLAG_FROM),
kono
parents:
diff changeset
59 /* ..., and copy to and from device. */
kono
parents:
diff changeset
60 GOMP_MAP_TOFROM = (GOMP_MAP_TO | GOMP_MAP_FROM),
kono
parents:
diff changeset
61 /* The following kind is an internal only map kind, used for pointer based
kono
parents:
diff changeset
62 array sections. OMP_CLAUSE_SIZE for these is not the pointer size,
kono
parents:
diff changeset
63 which is implicitly POINTER_SIZE_UNITS, but the bias. */
kono
parents:
diff changeset
64 GOMP_MAP_POINTER = (GOMP_MAP_FLAG_SPECIAL_0 | 0),
kono
parents:
diff changeset
65 /* Also internal, behaves like GOMP_MAP_TO, but additionally any
kono
parents:
diff changeset
66 GOMP_MAP_POINTER records consecutive after it which have addresses
kono
parents:
diff changeset
67 falling into that range will not be ignored if GOMP_MAP_TO_PSET wasn't
kono
parents:
diff changeset
68 mapped already. */
kono
parents:
diff changeset
69 GOMP_MAP_TO_PSET = (GOMP_MAP_FLAG_SPECIAL_0 | 1),
kono
parents:
diff changeset
70 /* Must already be present. */
kono
parents:
diff changeset
71 GOMP_MAP_FORCE_PRESENT = (GOMP_MAP_FLAG_SPECIAL_0 | 2),
kono
parents:
diff changeset
72 /* Deallocate a mapping, without copying from device. */
kono
parents:
diff changeset
73 GOMP_MAP_DELETE = (GOMP_MAP_FLAG_SPECIAL_0 | 3),
kono
parents:
diff changeset
74 /* Is a device pointer. OMP_CLAUSE_SIZE for these is unused; is implicitly
kono
parents:
diff changeset
75 POINTER_SIZE_UNITS. */
kono
parents:
diff changeset
76 GOMP_MAP_FORCE_DEVICEPTR = (GOMP_MAP_FLAG_SPECIAL_1 | 0),
kono
parents:
diff changeset
77 /* OpenACC device_resident. */
kono
parents:
diff changeset
78 GOMP_MAP_DEVICE_RESIDENT = (GOMP_MAP_FLAG_SPECIAL_1 | 1),
kono
parents:
diff changeset
79 /* OpenACC link. */
kono
parents:
diff changeset
80 GOMP_MAP_LINK = (GOMP_MAP_FLAG_SPECIAL_1 | 2),
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
81 /* Use device data if present, fall back to host address otherwise. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
82 GOMP_MAP_IF_PRESENT = (GOMP_MAP_FLAG_SPECIAL_1 | 3),
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
83 /* Do not map, copy bits for firstprivate instead. */
111
kono
parents:
diff changeset
84 GOMP_MAP_FIRSTPRIVATE = (GOMP_MAP_FLAG_SPECIAL | 0),
kono
parents:
diff changeset
85 /* Similarly, but store the value in the pointer rather than
kono
parents:
diff changeset
86 pointed by the pointer. */
kono
parents:
diff changeset
87 GOMP_MAP_FIRSTPRIVATE_INT = (GOMP_MAP_FLAG_SPECIAL | 1),
kono
parents:
diff changeset
88 /* Pointer translate host address into device address and copy that
kono
parents:
diff changeset
89 back to host. */
kono
parents:
diff changeset
90 GOMP_MAP_USE_DEVICE_PTR = (GOMP_MAP_FLAG_SPECIAL | 2),
kono
parents:
diff changeset
91 /* Allocate a zero length array section. Prefer next non-zero length
kono
parents:
diff changeset
92 mapping over previous non-zero length mapping over zero length mapping
kono
parents:
diff changeset
93 at the address. If not already mapped, do nothing (and pointer translate
kono
parents:
diff changeset
94 to NULL). */
kono
parents:
diff changeset
95 GOMP_MAP_ZERO_LEN_ARRAY_SECTION = (GOMP_MAP_FLAG_SPECIAL | 3),
kono
parents:
diff changeset
96 /* Allocate. */
kono
parents:
diff changeset
97 GOMP_MAP_FORCE_ALLOC = (GOMP_MAP_FLAG_FORCE | GOMP_MAP_ALLOC),
kono
parents:
diff changeset
98 /* ..., and copy to device. */
kono
parents:
diff changeset
99 GOMP_MAP_FORCE_TO = (GOMP_MAP_FLAG_FORCE | GOMP_MAP_TO),
kono
parents:
diff changeset
100 /* ..., and copy from device. */
kono
parents:
diff changeset
101 GOMP_MAP_FORCE_FROM = (GOMP_MAP_FLAG_FORCE | GOMP_MAP_FROM),
kono
parents:
diff changeset
102 /* ..., and copy to and from device. */
kono
parents:
diff changeset
103 GOMP_MAP_FORCE_TOFROM = (GOMP_MAP_FLAG_FORCE | GOMP_MAP_TOFROM),
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
104 /* Like GOMP_MAP_USE_DEVICE_PTR above, translate a host to a device
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
105 address. If translation fails because the target is not mapped,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
106 continue using the host address. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
107 GOMP_MAP_USE_DEVICE_PTR_IF_PRESENT = (GOMP_MAP_FLAG_SPECIAL_2 | 0),
111
kono
parents:
diff changeset
108 /* If not already present, allocate. And unconditionally copy to
kono
parents:
diff changeset
109 device. */
kono
parents:
diff changeset
110 GOMP_MAP_ALWAYS_TO = (GOMP_MAP_FLAG_SPECIAL_2 | GOMP_MAP_TO),
kono
parents:
diff changeset
111 /* If not already present, allocate. And unconditionally copy from
kono
parents:
diff changeset
112 device. */
kono
parents:
diff changeset
113 GOMP_MAP_ALWAYS_FROM = (GOMP_MAP_FLAG_SPECIAL_2
kono
parents:
diff changeset
114 | GOMP_MAP_FROM),
kono
parents:
diff changeset
115 /* If not already present, allocate. And unconditionally copy to and from
kono
parents:
diff changeset
116 device. */
kono
parents:
diff changeset
117 GOMP_MAP_ALWAYS_TOFROM = (GOMP_MAP_FLAG_SPECIAL_2
kono
parents:
diff changeset
118 | GOMP_MAP_TOFROM),
kono
parents:
diff changeset
119 /* Map a sparse struct; the address is the base of the structure, alignment
kono
parents:
diff changeset
120 it's required alignment, and size is the number of adjacent entries
kono
parents:
diff changeset
121 that belong to the struct. The adjacent entries should be sorted by
kono
parents:
diff changeset
122 increasing address, so it is easy to determine lowest needed address
kono
parents:
diff changeset
123 (address of the first adjacent entry) and highest needed address
kono
parents:
diff changeset
124 (address of the last adjacent entry plus its size). */
kono
parents:
diff changeset
125 GOMP_MAP_STRUCT = (GOMP_MAP_FLAG_SPECIAL_2
kono
parents:
diff changeset
126 | GOMP_MAP_FLAG_SPECIAL | 0),
kono
parents:
diff changeset
127 /* On a location of a pointer/reference that is assumed to be already mapped
kono
parents:
diff changeset
128 earlier, store the translated address of the preceeding mapping.
kono
parents:
diff changeset
129 No refcount is bumped by this, and the store is done unconditionally. */
kono
parents:
diff changeset
130 GOMP_MAP_ALWAYS_POINTER = (GOMP_MAP_FLAG_SPECIAL_2
kono
parents:
diff changeset
131 | GOMP_MAP_FLAG_SPECIAL | 1),
kono
parents:
diff changeset
132 /* Forced deallocation of zero length array section. */
kono
parents:
diff changeset
133 GOMP_MAP_DELETE_ZERO_LEN_ARRAY_SECTION
kono
parents:
diff changeset
134 = (GOMP_MAP_FLAG_SPECIAL_2
kono
parents:
diff changeset
135 | GOMP_MAP_FLAG_SPECIAL | 3),
kono
parents:
diff changeset
136 /* Decrement usage count and deallocate if zero. */
kono
parents:
diff changeset
137 GOMP_MAP_RELEASE = (GOMP_MAP_FLAG_SPECIAL_2
kono
parents:
diff changeset
138 | GOMP_MAP_DELETE),
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
139 /* In OpenACC, attach a pointer to a mapped struct field. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
140 GOMP_MAP_ATTACH = (GOMP_MAP_DEEP_COPY | 0),
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
141 /* In OpenACC, detach a pointer to a mapped struct field. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
142 GOMP_MAP_DETACH = (GOMP_MAP_DEEP_COPY | 1),
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
143 /* In OpenACC, detach a pointer to a mapped struct field. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
144 GOMP_MAP_FORCE_DETACH = (GOMP_MAP_DEEP_COPY
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
145 | GOMP_MAP_FLAG_FORCE | 1),
111
kono
parents:
diff changeset
146
kono
parents:
diff changeset
147 /* Internal to GCC, not used in libgomp. */
kono
parents:
diff changeset
148 /* Do not map, but pointer assign a pointer instead. */
kono
parents:
diff changeset
149 GOMP_MAP_FIRSTPRIVATE_POINTER = (GOMP_MAP_LAST | 1),
kono
parents:
diff changeset
150 /* Do not map, but pointer assign a reference instead. */
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
151 GOMP_MAP_FIRSTPRIVATE_REFERENCE = (GOMP_MAP_LAST | 2),
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
152 /* An attach or detach operation. Rewritten to the appropriate type during
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
153 gimplification, depending on directive (i.e. "enter data" or
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
154 parallel/kernels region vs. "exit data"). */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
155 GOMP_MAP_ATTACH_DETACH = (GOMP_MAP_LAST | 3)
111
kono
parents:
diff changeset
156 };
kono
parents:
diff changeset
157
kono
parents:
diff changeset
158 #define GOMP_MAP_COPY_TO_P(X) \
kono
parents:
diff changeset
159 (!((X) & GOMP_MAP_FLAG_SPECIAL) \
kono
parents:
diff changeset
160 && ((X) & GOMP_MAP_FLAG_TO))
kono
parents:
diff changeset
161
kono
parents:
diff changeset
162 #define GOMP_MAP_COPY_FROM_P(X) \
kono
parents:
diff changeset
163 (!((X) & GOMP_MAP_FLAG_SPECIAL) \
kono
parents:
diff changeset
164 && ((X) & GOMP_MAP_FLAG_FROM))
kono
parents:
diff changeset
165
kono
parents:
diff changeset
166 #define GOMP_MAP_POINTER_P(X) \
kono
parents:
diff changeset
167 ((X) == GOMP_MAP_POINTER)
kono
parents:
diff changeset
168
kono
parents:
diff changeset
169 #define GOMP_MAP_ALWAYS_TO_P(X) \
kono
parents:
diff changeset
170 (((X) == GOMP_MAP_ALWAYS_TO) || ((X) == GOMP_MAP_ALWAYS_TOFROM))
kono
parents:
diff changeset
171
kono
parents:
diff changeset
172 #define GOMP_MAP_ALWAYS_FROM_P(X) \
kono
parents:
diff changeset
173 (((X) == GOMP_MAP_ALWAYS_FROM) || ((X) == GOMP_MAP_ALWAYS_TOFROM))
kono
parents:
diff changeset
174
kono
parents:
diff changeset
175 #define GOMP_MAP_ALWAYS_P(X) \
kono
parents:
diff changeset
176 (GOMP_MAP_ALWAYS_TO_P (X) || ((X) == GOMP_MAP_ALWAYS_FROM))
kono
parents:
diff changeset
177
kono
parents:
diff changeset
178
kono
parents:
diff changeset
179 /* Asynchronous behavior. Keep in sync with
kono
parents:
diff changeset
180 libgomp/{openacc.h,openacc.f90,openacc_lib.h}:acc_async_t. */
kono
parents:
diff changeset
181
kono
parents:
diff changeset
182 #define GOMP_ASYNC_NOVAL -1
kono
parents:
diff changeset
183 #define GOMP_ASYNC_SYNC -2
kono
parents:
diff changeset
184
kono
parents:
diff changeset
185
kono
parents:
diff changeset
186 /* Device codes. Keep in sync with
kono
parents:
diff changeset
187 libgomp/{openacc.h,openacc.f90,openacc_lib.h}:acc_device_t as well as
kono
parents:
diff changeset
188 libgomp/libgomp-plugin.h. */
kono
parents:
diff changeset
189 #define GOMP_DEVICE_NONE 0
kono
parents:
diff changeset
190 #define GOMP_DEVICE_DEFAULT 1
kono
parents:
diff changeset
191 #define GOMP_DEVICE_HOST 2
kono
parents:
diff changeset
192 /* #define GOMP_DEVICE_HOST_NONSHM 3 removed. */
kono
parents:
diff changeset
193 #define GOMP_DEVICE_NOT_HOST 4
kono
parents:
diff changeset
194 #define GOMP_DEVICE_NVIDIA_PTX 5
kono
parents:
diff changeset
195 #define GOMP_DEVICE_INTEL_MIC 6
kono
parents:
diff changeset
196 #define GOMP_DEVICE_HSA 7
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
197 #define GOMP_DEVICE_GCN 8
111
kono
parents:
diff changeset
198
kono
parents:
diff changeset
199 #define GOMP_DEVICE_ICV -1
kono
parents:
diff changeset
200 #define GOMP_DEVICE_HOST_FALLBACK -2
kono
parents:
diff changeset
201
kono
parents:
diff changeset
202 /* GOMP_task/GOMP_taskloop* flags argument. */
kono
parents:
diff changeset
203 #define GOMP_TASK_FLAG_UNTIED (1 << 0)
kono
parents:
diff changeset
204 #define GOMP_TASK_FLAG_FINAL (1 << 1)
kono
parents:
diff changeset
205 #define GOMP_TASK_FLAG_MERGEABLE (1 << 2)
kono
parents:
diff changeset
206 #define GOMP_TASK_FLAG_DEPEND (1 << 3)
kono
parents:
diff changeset
207 #define GOMP_TASK_FLAG_PRIORITY (1 << 4)
kono
parents:
diff changeset
208 #define GOMP_TASK_FLAG_UP (1 << 8)
kono
parents:
diff changeset
209 #define GOMP_TASK_FLAG_GRAINSIZE (1 << 9)
kono
parents:
diff changeset
210 #define GOMP_TASK_FLAG_IF (1 << 10)
kono
parents:
diff changeset
211 #define GOMP_TASK_FLAG_NOGROUP (1 << 11)
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
212 #define GOMP_TASK_FLAG_REDUCTION (1 << 12)
111
kono
parents:
diff changeset
213
kono
parents:
diff changeset
214 /* GOMP_target{_ext,update_ext,enter_exit_data} flags argument. */
kono
parents:
diff changeset
215 #define GOMP_TARGET_FLAG_NOWAIT (1 << 0)
kono
parents:
diff changeset
216 #define GOMP_TARGET_FLAG_EXIT_DATA (1 << 1)
kono
parents:
diff changeset
217 /* Internal to libgomp. */
kono
parents:
diff changeset
218 #define GOMP_TARGET_FLAG_UPDATE (1U << 31)
kono
parents:
diff changeset
219
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
220
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
221 /* OpenACC construct flags. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
222
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
223 /* Force host fallback execution. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
224 #define GOACC_FLAG_HOST_FALLBACK (1 << 0)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
225
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
226 /* For legacy reasons, in the ABI, the GOACC_FLAGs are encoded as an inverted
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
227 bitmask. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
228 #define GOACC_FLAGS_MARSHAL_OP BIT_NOT_EXPR
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
229 #define GOACC_FLAGS_UNMARSHAL(X) (~(X))
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
230
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
231
111
kono
parents:
diff changeset
232 /* Versions of libgomp and device-specific plugins. GOMP_VERSION
kono
parents:
diff changeset
233 should be incremented whenever an ABI-incompatible change is introduced
kono
parents:
diff changeset
234 to the plugin interface defined in libgomp/libgomp.h. */
kono
parents:
diff changeset
235 #define GOMP_VERSION 1
kono
parents:
diff changeset
236 #define GOMP_VERSION_NVIDIA_PTX 1
kono
parents:
diff changeset
237 #define GOMP_VERSION_INTEL_MIC 0
kono
parents:
diff changeset
238 #define GOMP_VERSION_HSA 0
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
239 #define GOMP_VERSION_GCN 1
111
kono
parents:
diff changeset
240
kono
parents:
diff changeset
241 #define GOMP_VERSION_PACK(LIB, DEV) (((LIB) << 16) | (DEV))
kono
parents:
diff changeset
242 #define GOMP_VERSION_LIB(PACK) (((PACK) >> 16) & 0xffff)
kono
parents:
diff changeset
243 #define GOMP_VERSION_DEV(PACK) ((PACK) & 0xffff)
kono
parents:
diff changeset
244
kono
parents:
diff changeset
245 #define GOMP_DIM_GANG 0
kono
parents:
diff changeset
246 #define GOMP_DIM_WORKER 1
kono
parents:
diff changeset
247 #define GOMP_DIM_VECTOR 2
kono
parents:
diff changeset
248 #define GOMP_DIM_MAX 3
kono
parents:
diff changeset
249 #define GOMP_DIM_MASK(X) (1u << (X))
kono
parents:
diff changeset
250
kono
parents:
diff changeset
251 /* Varadic launch arguments. End of list is marked by a zero. */
kono
parents:
diff changeset
252 #define GOMP_LAUNCH_DIM 1 /* Launch dimensions, op = mask */
kono
parents:
diff changeset
253 #define GOMP_LAUNCH_ASYNC 2 /* Async, op = cst val if not MAX */
kono
parents:
diff changeset
254 #define GOMP_LAUNCH_WAIT 3 /* Waits, op = num waits. */
kono
parents:
diff changeset
255 #define GOMP_LAUNCH_CODE_SHIFT 28
kono
parents:
diff changeset
256 #define GOMP_LAUNCH_DEVICE_SHIFT 16
kono
parents:
diff changeset
257 #define GOMP_LAUNCH_OP_SHIFT 0
kono
parents:
diff changeset
258 #define GOMP_LAUNCH_PACK(CODE,DEVICE,OP) \
kono
parents:
diff changeset
259 (((CODE) << GOMP_LAUNCH_CODE_SHIFT) \
kono
parents:
diff changeset
260 | ((DEVICE) << GOMP_LAUNCH_DEVICE_SHIFT) \
kono
parents:
diff changeset
261 | ((OP) << GOMP_LAUNCH_OP_SHIFT))
kono
parents:
diff changeset
262 #define GOMP_LAUNCH_CODE(X) (((X) >> GOMP_LAUNCH_CODE_SHIFT) & 0xf)
kono
parents:
diff changeset
263 #define GOMP_LAUNCH_DEVICE(X) (((X) >> GOMP_LAUNCH_DEVICE_SHIFT) & 0xfff)
kono
parents:
diff changeset
264 #define GOMP_LAUNCH_OP(X) (((X) >> GOMP_LAUNCH_OP_SHIFT) & 0xffff)
kono
parents:
diff changeset
265 #define GOMP_LAUNCH_OP_MAX 0xffff
kono
parents:
diff changeset
266
kono
parents:
diff changeset
267 /* Bitmask to apply in order to find out the intended device of a target
kono
parents:
diff changeset
268 argument. */
kono
parents:
diff changeset
269 #define GOMP_TARGET_ARG_DEVICE_MASK ((1 << 7) - 1)
kono
parents:
diff changeset
270 /* The target argument is significant for all devices. */
kono
parents:
diff changeset
271 #define GOMP_TARGET_ARG_DEVICE_ALL 0
kono
parents:
diff changeset
272
kono
parents:
diff changeset
273 /* Flag set when the subsequent element in the device-specific argument
kono
parents:
diff changeset
274 values. */
kono
parents:
diff changeset
275 #define GOMP_TARGET_ARG_SUBSEQUENT_PARAM (1 << 7)
kono
parents:
diff changeset
276
kono
parents:
diff changeset
277 /* Bitmask to apply to a target argument to find out the value identifier. */
kono
parents:
diff changeset
278 #define GOMP_TARGET_ARG_ID_MASK (((1 << 8) - 1) << 8)
kono
parents:
diff changeset
279 /* Target argument index of NUM_TEAMS. */
kono
parents:
diff changeset
280 #define GOMP_TARGET_ARG_NUM_TEAMS (1 << 8)
kono
parents:
diff changeset
281 /* Target argument index of THREAD_LIMIT. */
kono
parents:
diff changeset
282 #define GOMP_TARGET_ARG_THREAD_LIMIT (2 << 8)
kono
parents:
diff changeset
283
kono
parents:
diff changeset
284 /* If the value is directly embeded in target argument, it should be a 16-bit
kono
parents:
diff changeset
285 at most and shifted by this many bits. */
kono
parents:
diff changeset
286 #define GOMP_TARGET_ARG_VALUE_SHIFT 16
kono
parents:
diff changeset
287
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
288 /* Dependence types in omp_depend_t objects. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
289 #define GOMP_DEPEND_IN 1
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
290 #define GOMP_DEPEND_OUT 2
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
291 #define GOMP_DEPEND_INOUT 3
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
292 #define GOMP_DEPEND_MUTEXINOUTSET 4
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
293
111
kono
parents:
diff changeset
294 /* HSA specific data structures. */
kono
parents:
diff changeset
295
kono
parents:
diff changeset
296 /* Identifiers of device-specific target arguments. */
kono
parents:
diff changeset
297 #define GOMP_TARGET_ARG_HSA_KERNEL_ATTRIBUTES (1 << 8)
kono
parents:
diff changeset
298
kono
parents:
diff changeset
299 #endif