[Openmp-commits] [PATCH] D32326: [OpenMP] libomptarget: Set ref count for global objects to positive infinity

Jonas Hahnfeld via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Apr 20 23:08:39 PDT 2017


Hahnfeld added inline comments.


================
Comment at: libomptarget/src/omptarget.cpp:1326-1327
         // Add entry to map.
+        if (!Device.getTgtPtrBegin(CurrHostEntry->addr, CurrHostEntry->size))
+          continue;
         DP("Add mapping from host " DPxMOD " to device " DPxMOD " with size %zu"
----------------
Shouldn't this be the other way round? If we already added this mapping before, just `continue`?


================
Comment at: libomptarget/src/omptarget.cpp:1331-1334
+        Device.HostDataToTargetMap.push_front(HostDataToTargetTy(
+            (uintptr_t)CurrHostEntry->addr, (uintptr_t)CurrHostEntry->addr,
+            (uintptr_t)CurrHostEntry->addr + CurrHostEntry->size,
+            (uintptr_t)CurrDeviceEntry->addr, INF_REF_CNT));
----------------
1. Are the casts neccessary?
2. Please add a comment that the first `addr` is `HostPtrBase` while the second is `HostPtrBegin`


Repository:
  rL LLVM

https://reviews.llvm.org/D32326





More information about the Openmp-commits mailing list