Skip to content

Commit 6e40ae8

Browse files
committed
[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
1 parent 57e87dd commit 6e40ae8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

openmp/libomptarget/src/interface.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,9 @@ EXTERN int __tgt_target_teams_nowait(int64_t device_id, void *host_ptr,
306306

307307
EXTERN void __kmpc_push_target_tripcount(int64_t device_id,
308308
uint64_t loop_tripcount) {
309+
if (IsOffloadDisabled())
310+
return;
311+
309312
if (device_id == OFFLOAD_DEVICE_DEFAULT) {
310313
device_id = omp_get_default_device();
311314
}

0 commit comments

Comments
 (0)