[Openmp-commits] [PATCH] D113110: [OpenMP] Introduce the keepAlive function into the old device RT
Johannes Doerfert via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Thu Nov 4 15:55:21 PDT 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rGab9f3f5d25dc: [OpenMP] Introduce the keepAlive function into the old device RT (authored by jdoerfert).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D113110/new/
https://reviews.llvm.org/D113110
Files:
openmp/libomptarget/deviceRTLs/common/src/support.cu
Index: openmp/libomptarget/deviceRTLs/common/src/support.cu
===================================================================
--- openmp/libomptarget/deviceRTLs/common/src/support.cu
+++ openmp/libomptarget/deviceRTLs/common/src/support.cu
@@ -226,4 +226,14 @@
}
}
+namespace _OMP {
+/// Helper to keep code alive without introducing a performance penalty.
+__attribute__((used, weak, optnone)) void keepAlive() {
+ __kmpc_get_hardware_thread_id_in_block();
+ __kmpc_get_hardware_num_threads_in_block();
+ __kmpc_barrier_simple_spmd(nullptr, 0);
+ __kmpc_barrier_simple_generic(nullptr, 0);
+}
+} // namespace _OMP
+
#pragma omp end declare target
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113110.384892.patch
Type: text/x-patch
Size: 661 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20211104/56ab836f/attachment.bin>
More information about the Openmp-commits
mailing list