[Openmp-commits] [PATCH] D44470: [OpenMP][libomptarget] Enable multiple frames per global memory slot

George Rokos via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Mar 14 15:19:27 PDT 2018

grokos added inline comments.

Comment at: libomptarget/deviceRTLs/nvptx/src/data_sharing.cu:400
+      // Check if there is a next slot.
+      if (__kmpc_data_sharing_slot *ExistingSlot = SlotP->Next) {
+        // Attempt to reuse an existing slot provided the data fits in the slot.
So here we are only inspecting the very next slot hoping that it will be large enough to accommodate our request. In case the next slot is not big enough, could there be slots after the next which are suitable? If this scenario is possible, then why are we only inspecting the very next slot and delete everything thereafter if it's not big enough?

Comment at: libomptarget/deviceRTLs/nvptx/src/data_sharing.cu:502-505
+        while(Tail && Tail->Prev) {
+          Tail = Tail->Prev;
+          free(Tail->Next);
+          Tail->Next=0;
I think this loop will delete all slots apart from the very first (the last iteration will be when `Tail` points to the first slot and we just deallocate `Tail->next`). Don't we want to delete the first slot as well?

  rOMP OpenMP


More information about the Openmp-commits mailing list