[Openmp-commits] [PATCH] D64626: [libomptarget] Handle offload policy in push_target_tripcount
Jonas Hahnfeld via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Fri Jul 12 03:30:10 PDT 2019
Hahnfeld created this revision.
Hahnfeld added a reviewer: AlexEichenberger.
Herald added subscribers: openmp-commits, jdoerfert.
Herald added a project: OpenMP.
If the first target region in a program calls the push_target_tripcount
function, libomptarget didn't handle the offload policy correctly.
This could lead to unexpected error messages as seen in
http://lists.llvm.org/pipermail/openmp-dev/2019-June/002561.html
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D64626
Files:
openmp/libomptarget/src/interface.cpp
Index: openmp/libomptarget/src/interface.cpp
===================================================================
--- openmp/libomptarget/src/interface.cpp
+++ openmp/libomptarget/src/interface.cpp
@@ -306,6 +306,9 @@
EXTERN void __kmpc_push_target_tripcount(int64_t device_id,
uint64_t loop_tripcount) {
+ if (IsOffloadDisabled())
+ return;
+
if (device_id == OFFLOAD_DEVICE_DEFAULT) {
device_id = omp_get_default_device();
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64626.209452.patch
Type: text/x-patch
Size: 449 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20190712/b39d7aeb/attachment.bin>
More information about the Openmp-commits
mailing list