[Openmp-commits] [PATCH] D44522: [Libomptarget] Behavior of library upon target offload failure

Ravi Narayanaswamy via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Mar 15 09:54:31 PDT 2018


RaviNarayanaswamy added a comment.

Openmp has defined OMP_TARGET_OFFLOAD to control offloading,  We should be using this

OMP_TARGET_OFFLOAD
6 The OMP_TARGET_OFFLOAD environment variable sets the initial value of the target-offload-var
7 ICV. The value of the OMP_TARGET_OFFLOAD environment variable may be set to one of these
8 values:
9 MANDATORY | DISABLED | DEFAULT
10 The MANDATORY value specifies that a device construct or a device memory routine must execute
11 on a target device. If the device construct cannot execute on its target device, or if a device memory
12 routine fails to execute, a warning is issued and the program execution aborts. Device constructs
13 are exempt from this behavior when an if-clause is present and the if-clause expression evaluates to
14 false.
15 The support of DISABLED is implementation defined. If an implementation supports it, the
16 behavior should be that a device construct must execute on the host. The behavior with this
17 environment value is equivalent to an if clause present on all device constructs, where each of these
18 if clause expressions evaluate to false. Device memory routines behave as if all device number
19 parameters are set to the value returned by omp_get_initial_device(). The
20 omp_get_initial_device() routine returns that no target device is available
21 The DEFAULT value specifies that when one or more target devices are available, the runtime
22 behaves as if this environment variable is set to MANDATORY; otherwise, the runtime behaves as if
23 this environment variable is set to DISABLED.


Repository:
  rOMP OpenMP

https://reviews.llvm.org/D44522





More information about the Openmp-commits mailing list