[Openmp-commits] [PATCH] D107925: [OpenMP] Use IsHostPtr where needed for targetDataEnd

Joel E. Denny via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Sep 1 14:42:02 PDT 2021


jdenny added inline comments.


================
Comment at: openmp/libomptarget/src/device.cpp:368
 
-int DeviceTy::deallocTgtPtr(void *HstPtrBegin, int64_t Size,
-                            bool HasCloseModifier) {
-  if (PM->RTLs.RequiresFlags & OMP_REQ_UNIFIED_SHARED_MEMORY &&
-      !HasCloseModifier)
-    return OFFLOAD_SUCCESS;
+int DeviceTy::deallocTgtPtr(void *HstPtrBegin, int64_t Size) {
   // Check if the pointer is contained in any sub-nodes.
----------------
grokos wrote:
> Just to be on the safe side for future patches, can you add a comment saying that `DeviceTy::deallocTgtPtr` no longer checks whether we use USM and it assumes that the caller has checked beforehand that `HstPtrBegin` has (or should have) corresponding storage on the device instead of shared memory?
I added the comment to device.h.  I'm happy to revise in a fixup patch if you want something different.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107925



More information about the Openmp-commits mailing list