[all-commits] [llvm/llvm-project] 41b1ae: [OpenMP] Fix `present` diagnostic for array extension

Joel E. Denny via All-commits all-commits at lists.llvm.org
Wed Aug 5 13:52:00 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 41b1aefecb9447620dd182b0352abed0df05665c
      https://github.com/llvm/llvm-project/commit/41b1aefecb9447620dd182b0352abed0df05665c
  Author: Joel E. Denny <jdenny.ornl at gmail.com>
  Date:   2020-08-05 (Wed, 05 Aug 2020)

  Changed paths:
    M openmp/libomptarget/src/device.cpp
    A openmp/libomptarget/test/mapping/present/target_array_extension.c
    A openmp/libomptarget/test/mapping/present/target_data_array_extension.c

  Log Message:
  -----------
  [OpenMP] Fix `present` diagnostic for array extension

For example, without this patch, the following fails as expected with
or without the `present` modifier, but the `present` modifier doesn't
produce its usual diagnostic:

```
 #pragma omp target data map(alloc: arr[0:2])
 {
   #pragma omp target map(present, tofrom: arr[0:100]) // not fully present
   ;
 }
```

Reviewed By: grokos, vzakhari

Differential Revision: https://reviews.llvm.org/D85320


  Commit: 8c8bb128dfd09f84b27b9e732cf1355582b1d019
      https://github.com/llvm/llvm-project/commit/8c8bb128dfd09f84b27b9e732cf1355582b1d019
  Author: Joel E. Denny <jdenny.ornl at gmail.com>
  Date:   2020-08-05 (Wed, 05 Aug 2020)

  Changed paths:
    M openmp/libomptarget/src/omptarget.cpp
    A openmp/libomptarget/test/mapping/target_data_array_extension_at_exit.c

  Log Message:
  -----------
  [OpenMP] Fix `target data` exit for array extension

For example:

```
 #pragma omp target data map(tofrom:arr[0:100])
 {
   #pragma omp target exit data map(delete:arr[0:100])
   #pragma omp target enter data map(alloc:arr[98:2])
 }
```

Without this patch, the transfer at the end of the target data region
is broken and fails depending on the target device.  According to my
read of the spec, the transfer shouldn't even be attempted because
`arr[0:100]` isn't (fully) present there.  To fix that, this patch
makes `DeviceTy::getTgtPtrBegin` return null for this case.

Reviewed By: grokos

Differential Revision: https://reviews.llvm.org/D85342


Compare: https://github.com/llvm/llvm-project/compare/f3b41502554f...8c8bb128dfd0


More information about the All-commits mailing list