[Openmp-commits] [PATCH] D85246: [OpenACC] Fix `omp target update` for array extension

Joel E. Denny via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Aug 4 15:49:20 PDT 2020


jdenny added a comment.

Thanks for the quick review.

In D85246#2194712 <https://reviews.llvm.org/D85246#2194712>, @grokos wrote:

> I suppose the same must be applied to all cases where `present` is used.

Agreed.  Fortunately, when `present` is instead a map type modifier, `DeviceTy::getOrAllocTgtPtr` is called instead of `DeviceTy::getTgtPtrBegin` and, as far as I know, it already returns a null pointer for this case.  However, I see now that we get the general failure that happens regardless of the `present` modifier, and we don't see the `present`-specific diagnostic.  I suppose that ought to change.

> Without a modification like this, `present` just confirms that the starting address of the object is already mapped, although a size may be specified in the map clause.

It doesn't even confirm the start address exactly.  That is, in the extends-before case, the starting address might be before the array section that was already mapped.  Without this patch, the `present` motion modifier permits that case too.

>   #pragma omp target map(present: p[0:10]) // present will succeed even if only p[0] is mapped and p[1]-p[9] are not
>
> So the question here is: should `present` apply to the size as well as the begin address? I would say yes.

I agree, and it seems to already except for the diagnostic.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85246/new/

https://reviews.llvm.org/D85246



More information about the Openmp-commits mailing list