@@ -103,11 +103,10 @@ uint32_t determineNumberOfThreads(int32_t NumThreadsClause,
103
103
104
104
extern " C" {
105
105
106
- [[clang::always_inline]] void
107
- __kmpc_parallel_spmd (IdentTy *ident, int32_t num_threads, void *fn, void **args,
108
- const int64_t nargs, int32_t nt_strict = false ,
109
- int32_t nt_severity = severity_fatal,
110
- const char *nt_message = nullptr ) {
106
+ [[clang::always_inline]] void __kmpc_parallel_spmd_impl (
107
+ IdentTy *ident, int32_t num_threads, void *fn, void **args,
108
+ const int64_t nargs, int32_t nt_strict = false ,
109
+ int32_t nt_severity = severity_fatal, const char *nt_message = nullptr ) {
111
110
uint32_t TId = mapping::getThreadIdInBlock ();
112
111
uint32_t NumThreads =
113
112
determineNumberOfThreads (num_threads, nt_strict, nt_severity, nt_message);
@@ -163,7 +162,22 @@ __kmpc_parallel_spmd(IdentTy *ident, int32_t num_threads, void *fn, void **args,
163
162
return ;
164
163
}
165
164
166
- [[clang::always_inline]] void __kmpc_parallel_51 (
165
+ [[clang::always_inline]] void __kmpc_parallel_spmd (IdentTy *ident,
166
+ int32_t num_threads,
167
+ void *fn, void **args,
168
+ const int64_t nargs) {
169
+ return __kmpc_parallel_spmd_impl (ident, num_threads, fn, args, nargs);
170
+ }
171
+
172
+ [[clang::always_inline]] void __kmpc_parallel_spmd_60 (
173
+ IdentTy *ident, int32_t num_threads, void *fn, void **args,
174
+ const int64_t nargs, int32_t nt_strict = false ,
175
+ int32_t nt_severity = severity_fatal, const char *nt_message = nullptr ) {
176
+ return __kmpc_parallel_spmd_impl (ident, num_threads, fn, args, nargs,
177
+ nt_strict, nt_severity, nt_message);
178
+ }
179
+
180
+ [[clang::always_inline]] void __kmpc_parallel_impl (
167
181
IdentTy *ident, int32_t , int32_t if_expr, int32_t num_threads,
168
182
int proc_bind, void *fn, void *wrapper_fn, void **args, int64_t nargs,
169
183
int32_t nt_strict = false , int32_t nt_severity = severity_fatal,
@@ -198,8 +212,11 @@ __kmpc_parallel_spmd(IdentTy *ident, int32_t num_threads, void *fn, void **args,
198
212
// This was moved to its own routine so it could be called directly
199
213
// in certain situations to avoid resource consumption of unused
200
214
// logic in parallel_51.
201
- __kmpc_parallel_spmd (ident, num_threads, fn, args, nargs, nt_strict,
202
- nt_severity, nt_message);
215
+ if (nt_strict)
216
+ __kmpc_parallel_spmd (ident, num_threads, fn, args, nargs);
217
+ else
218
+ __kmpc_parallel_spmd_60 (ident, num_threads, fn, args, nargs, nt_strict,
219
+ nt_severity, nt_message);
203
220
204
221
return ;
205
222
}
@@ -308,14 +325,22 @@ __kmpc_parallel_spmd(IdentTy *ident, int32_t num_threads, void *fn, void **args,
308
325
__kmpc_end_sharing_variables ();
309
326
}
310
327
328
+ [[clang::always_inline]] void
329
+ __kmpc_parallel_51 (IdentTy *ident, int32_t id, int32_t if_expr,
330
+ int32_t num_threads, int proc_bind, void *fn,
331
+ void *wrapper_fn, void **args, int64_t nargs) {
332
+ return __kmpc_parallel_impl (ident, id, if_expr, num_threads, proc_bind, fn,
333
+ wrapper_fn, args, nargs);
334
+ }
335
+
311
336
[[clang::always_inline]] void __kmpc_parallel_60 (
312
337
IdentTy *ident, int32_t id, int32_t if_expr, int32_t num_threads,
313
338
int proc_bind, void *fn, void *wrapper_fn, void **args, int64_t nargs,
314
339
int32_t nt_strict = false , int32_t nt_severity = severity_fatal,
315
340
const char *nt_message = nullptr ) {
316
- return __kmpc_parallel_51 (ident, id, if_expr, num_threads, proc_bind, fn,
317
- wrapper_fn, args, nargs, nt_strict, nt_severity,
318
- nt_message);
341
+ return __kmpc_parallel_impl (ident, id, if_expr, num_threads, proc_bind, fn,
342
+ wrapper_fn, args, nargs, nt_strict, nt_severity,
343
+ nt_message);
319
344
}
320
345
321
346
[[clang::noinline]] bool __kmpc_kernel_parallel (ParallelRegionFnTy *WorkFn) {
0 commit comments