diff options
author | Jonas Hahnfeld <hahnjo@hahnjo.de> | 2019-07-23 14:20:48 +0000 |
---|---|---|
committer | Jonas Hahnfeld <hahnjo@hahnjo.de> | 2019-07-23 14:20:48 +0000 |
commit | 6e40ae8f3d3f794cfca624e52994e410438506a6 (patch) | |
tree | 0c07c0c7f35dceeebd0bd7ca868021c3b5a776cd | |
parent | 57e87dd81beb8df988bfa8e3369a2c7a888da093 (diff) | |
download | bcm5719-llvm-6e40ae8f3d3f794cfca624e52994e410438506a6.tar.gz bcm5719-llvm-6e40ae8f3d3f794cfca624e52994e410438506a6.zip |
[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
llvm-svn: 366810
-rw-r--r-- | openmp/libomptarget/src/interface.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/openmp/libomptarget/src/interface.cpp b/openmp/libomptarget/src/interface.cpp index 32afe3fcb4b..b3ace375587 100644 --- a/openmp/libomptarget/src/interface.cpp +++ b/openmp/libomptarget/src/interface.cpp @@ -306,6 +306,9 @@ EXTERN int __tgt_target_teams_nowait(int64_t device_id, void *host_ptr, 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(); } |