diff options
author | Gheorghe-Teodor Bercea <gheorghe-teod.bercea@ibm.com> | 2018-09-25 18:48:14 +0000 |
---|---|---|
committer | Gheorghe-Teodor Bercea <gheorghe-teod.bercea@ibm.com> | 2018-09-25 18:48:14 +0000 |
commit | 489ba43fc913c159ea28d7e6d222e03274e39759 (patch) | |
tree | 293b7b7c749cac4a910ad70ecda9145749c7b6bd /openmp | |
parent | 074a1b46d8eeeb735cda9f35e696fa9f2666b0e6 (diff) |
[OpenMP][libomptarget] Set the frame pointer then test empty slot condition
Summary: NFC - just fixing a bug: the empty slot test was before the re-setting of the Stack pointer.
Reviewers: ABataev, caomhin, Hahnfeld
Reviewed By: ABataev
Subscribers: guansong, openmp-commits
Differential Revision: https://reviews.llvm.org/D52122
Diffstat (limited to 'openmp')
-rw-r--r-- | openmp/libomptarget/deviceRTLs/nvptx/src/data_sharing.cu | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/openmp/libomptarget/deviceRTLs/nvptx/src/data_sharing.cu b/openmp/libomptarget/deviceRTLs/nvptx/src/data_sharing.cu index 6e1548b703d..2125c36e1d8 100644 --- a/openmp/libomptarget/deviceRTLs/nvptx/src/data_sharing.cu +++ b/openmp/libomptarget/deviceRTLs/nvptx/src/data_sharing.cu @@ -477,13 +477,13 @@ EXTERN void __kmpc_data_sharing_pop_stack(void *FrameStart) { // Pointer to next available stack. void *&StackP = DataSharingState.StackPtr[WID]; + // Pop the frame. + StackP = FrameStart; + // If the current slot is empty, we need to free the slot after the // pop. bool SlotEmpty = (StackP == &SlotP->Data[0]); - // Pop the frame. - StackP = FrameStart; - if (SlotEmpty && SlotP->Prev) { // Before removing the slot we need to reset StackP. StackP = SlotP->PrevSlotStackPtr; |