commit | b840a856c2cc27c1aa6db219a095a11d278344c5 | [log] [tgz] |
---|---|---|
author | Jonas Hahnfeld <hahnjo@hahnjo.de> | Tue Jul 23 14:20:48 2019 +0000 |
committer | Jonas Hahnfeld <hahnjo@hahnjo.de> | Tue Jul 23 14:20:48 2019 +0000 |
tree | d4bf009f854f517ca552ec3c0f63a6268bd0943a | |
parent | 9ad60c0ccd9fe0b733850895d259881124748797 [diff] |
[libomptarget] Handle offload policy in push_tripcount If the first target region in a program calls the push_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 To solve this, add a check calling IsOffloadDisabled() as all other entry points already do. If this method returns false, libomptarget is effectively disabled. Differential Revision: https://reviews.llvm.org/D64626 git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@366810 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/libomptarget/src/interface.cpp b/libomptarget/src/interface.cpp index 32afe3f..b3ace37 100644 --- a/libomptarget/src/interface.cpp +++ b/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(); }