[Openmp-commits] [PATCH] D54260: [OPENMP]Make lambda mapping follow reqs for PTR_AND_OBJ mapping.

Alexey Bataev via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Nov 8 07:50:21 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL346407: [OPENMP]Make lambda mapping follow reqs for PTR_AND_OBJ mapping. (authored by ABataev, committed by ).
Herald added a subscriber: llvm-commits.

Repository:
  rL LLVM

https://reviews.llvm.org/D54260

Files:
  openmp/trunk/libomptarget/src/omptarget.cpp


Index: openmp/trunk/libomptarget/src/omptarget.cpp
===================================================================
--- openmp/trunk/libomptarget/src/omptarget.cpp
+++ openmp/trunk/libomptarget/src/omptarget.cpp
@@ -638,19 +638,20 @@
         assert(tgtIdx != -1 && "Base address must be translated already.");
         // The parent lambda must be processed already and it must be the last
         // in tgt_args and tgt_offsets arrays.
-        void *HstPtrBegin = args[i];
-        void *HstPtrBase = args_base[i];
+        void *HstPtrVal = args[i];
+        void *HstPtrBegin = args_base[i];
+        void *HstPtrBase = args[idx];
         bool IsLast; // unused.
         void *TgtPtrBase =
             (void *)((intptr_t)tgt_args[tgtIdx] + tgt_offsets[tgtIdx]);
         DP("Parent lambda base " DPxMOD "\n", DPxPTR(TgtPtrBase));
         uint64_t Delta = (uint64_t)HstPtrBegin - (uint64_t)HstPtrBase;
         void *TgtPtrBegin = (void *)((uintptr_t)TgtPtrBase + Delta);
-        void *Pointer_TgtPtrBegin = Device.getTgtPtrBegin(
-            *(void **)HstPtrBegin, arg_sizes[i], IsLast, false);
+        void *Pointer_TgtPtrBegin =
+            Device.getTgtPtrBegin(HstPtrVal, arg_sizes[i], IsLast, false);
         if (!Pointer_TgtPtrBegin) {
           DP("No lambda captured variable mapped (" DPxMOD ") - ignored\n",
-             DPxPTR(*(void **)HstPtrBegin));
+             DPxPTR(HstPtrVal));
           continue;
         }
         DP("Update lambda reference (" DPxMOD ") -> [" DPxMOD "]\n",


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54260.173168.patch
Type: text/x-patch
Size: 1519 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20181108/0c7f63f7/attachment.bin>


More information about the Openmp-commits mailing list