[Openmp-commits] [PATCH] D85342: [OpenMP] Fix `target data` exit for array extension

Joel E. Denny via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Aug 5 12:30:04 PDT 2020


jdenny created this revision.
jdenny added reviewers: grokos, RaviNarayanaswamy, jdoerfert, ABataev.
Herald added subscribers: openmp-commits, guansong, yaxunl.
Herald added a project: OpenMP.
jdenny requested review of this revision.
Herald added a subscriber: sstefan1.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D85342

Files:
  openmp/libomptarget/src/omptarget.cpp
  openmp/libomptarget/test/mapping/target_data_array_extension_at_exit.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85342.283338.patch
Type: text/x-patch
Size: 5276 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20200805/9dc16972/attachment-0001.bin>


More information about the Openmp-commits mailing list