[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
Fri Aug 10 04:19:27 PDT 2018


Hahnfeld added a comment.

In https://reviews.llvm.org/D50522#1195086, @protze.joachim wrote:

> In https://reviews.llvm.org/D50522#1194805, @AlexEichenberger wrote:
>
> > So you like deciding available on first use? This is what your comment seems to imply, but I am not 100% sure.
>
>
> As I understand Jonas, he would prefer semantically something like:
>
>   devices-available =  omp_get_num_devices()>0


Yes, because that's how the standard defines `omp_get_num_devices()`: to return the number of //available// devices.
And because it results in a sane behaviour for my example.

> This does not depend on a successful offload, just compares whether a device is there:
> 
>   if devices-available && DEFAULT:
>     continue as if MANDATORY
>   else:
>     continue as if DISABLED

Almost, `!devices-available && MANDATORY` should not result in `DISABLED` ;-)

  if DEFAULT:
    if devices-available:
      continue as if MANDATORY
    else:
      continue as if DISABLED
  endif


Repository:
  rOMP OpenMP

https://reviews.llvm.org/D50522





More information about the Openmp-commits mailing list