Skip to content

Commit f6b89e4

Browse files
DominikAdamskironlieb
authored andcommitted
Make sure that old initialization is not run if runtime flag is set
Old Flang OpenMP API (__kmpc_spmd_kernel_init/__kmpc_spmd_kernel_deinit) was always invoked with parameter RequiresOMPRuntime set to 0. If RequiresFullRuntime flag is set, then launch the same initialization procedure as for C/C++ code. Signed-off-by: Dominik Adamski <[email protected]> Change-Id: I8e903183ea10d1656fc383d6ec674a2409356ace
1 parent 4314718 commit f6b89e4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

openmp/libomptarget/deviceRTLs/common/src/omptarget.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ int32_t __kmpc_target_init_v1(ident_t *Ident, int8_t Mode,
368368
int8_t UseGenericStateMachine,
369369
int8_t RequiresFullRuntime) {
370370

371-
if (Mode & OMP_TGT_EXEC_MODE_SPMD) {
371+
if (!RequiresFullRuntime && (Mode & OMP_TGT_EXEC_MODE_SPMD)) {
372372
setExecutionParameters(OMP_TGT_EXEC_MODE_SPMD,
373373

374374
OMP_TGT_RUNTIME_UNINITIALIZED);

0 commit comments

Comments
 (0)