Skip to content

Commit e1dedec

Browse files
jhuber6jhuber-ornl
authored andcommitted
[Libomptarget] Add unroll flag to shared variables loop
Unrolling this loop provides better performance in practice because it is executed on the device and is likely to be very small. Reviewed By: tianshilei1992 Differential Revision: https://reviews.llvm.org/D106692
1 parent d71fc32 commit e1dedec

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ EXTERN void __kmpc_parallel_51(kmp_Ident *ident, kmp_int32 global_tid,
314314
void **GlobalArgs;
315315
__kmpc_begin_sharing_variables(&GlobalArgs, nargs);
316316
// TODO: faster memcpy?
317+
#pragma unroll
317318
for (int I = 0; I < nargs; I++)
318319
GlobalArgs[I] = args[I];
319320
}

0 commit comments

Comments
 (0)