aboutsummaryrefslogtreecommitdiff
path: root/libomptarget/deviceRTLs
diff options
context:
space:
mode:
authorGheorghe-Teodor Bercea <gheorghe-teod.bercea@ibm.com>2018-09-25 18:48:14 +0000
committerGheorghe-Teodor Bercea <gheorghe-teod.bercea@ibm.com>2018-09-25 18:48:14 +0000
commit83a13b92aad55a56ebe398870daa4723223dae46 (patch)
tree61e7c2e0b6168bee088f7cd22a1c78b6936251be /libomptarget/deviceRTLs
parente1688b470b8ef3441983d333a6642e7b19d29b90 (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 git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@343006 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'libomptarget/deviceRTLs')
-rw-r--r--libomptarget/deviceRTLs/nvptx/src/data_sharing.cu6
1 files changed, 3 insertions, 3 deletions
diff --git a/libomptarget/deviceRTLs/nvptx/src/data_sharing.cu b/libomptarget/deviceRTLs/nvptx/src/data_sharing.cu
index 6e1548b..2125c36 100644
--- a/libomptarget/deviceRTLs/nvptx/src/data_sharing.cu
+++ b/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;