[Openmp-commits] [PATCH] D50522: [OpenMP][libomptarget] Bringing up to spec with respect to OMP_TARGET_OFFLOAD env var
Jonas Hahnfeld via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Thu Aug 9 11:17:22 PDT 2018
Hahnfeld requested changes to this revision.
Hahnfeld added a comment.
This revision now requires changes to proceed.
Does this patch supersede https://reviews.llvm.org/D44522?
As discussed in there I don't see that `DEFAULT` means `MANDATORY` only iff there was a successful offload. From TR7, page 610, lines 17/18:
> The DEFAULT value specifies that when one or more target devices are available, the runtime
> behaves as if this environment variable is set to MANDATORY [...]
Another remark from https://reviews.llvm.org/D44522: I think we need to handle API methods as well.
================
Comment at: libomptarget/src/rtl.cpp:49-64
+ TargetOffloadPolicy = OMP_TARGET_OFFLOAD_DEFAULT;
char *envStr = getenv("OMP_TARGET_OFFLOAD");
- if (envStr && !strcmp(envStr, "DISABLED")) {
- DP("Target offloading disabled by environment\n");
- return;
+ if (envStr) {
+ if (!strcmp(envStr, "DISABLED")) {
+ DP("Target offloading disabled by environment\n");
+ TargetOffloadPolicy = OMP_TARGET_OFFLOAD_DISABLED;
+ return;
----------------
There was an agreement with Intel to have a query function `__kmpc_get_target_offload`. Please use that one.
Repository:
rOMP OpenMP
https://reviews.llvm.org/D50522
More information about the Openmp-commits
mailing list