summaryrefslogtreecommitdiff
path: root/src/cuda-sim/instructions.cc
diff options
context:
space:
mode:
authorsspenst <[email protected]>2016-07-08 12:57:56 -0700
committersspenst <[email protected]>2016-07-08 12:57:56 -0700
commit877cbd077ffaf112b68973fdb7db8f10505303ee (patch)
treeb72b70053ab07c798ca205d57609e350586f23cb /src/cuda-sim/instructions.cc
parent1cb439dad25261b0b9617a8fb3e943cf0e0beac1 (diff)
SST should now properly simulate the barrier operation
Diffstat (limited to 'src/cuda-sim/instructions.cc')
-rw-r--r--src/cuda-sim/instructions.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/cuda-sim/instructions.cc b/src/cuda-sim/instructions.cc
index aeaf9e6..8bdb94f 100644
--- a/src/cuda-sim/instructions.cc
+++ b/src/cuda-sim/instructions.cc
@@ -3741,7 +3741,8 @@ void sqrt_impl( const ptx_instruction *pI, ptx_thread_info *thread )
void sst_impl( const ptx_instruction *pI, ptx_thread_info *thread )
{
- const operand_info &dst = pI->dst();
+ ptx_instruction * cpI = const_cast<ptx_instruction *>(pI); // constant
+ const operand_info &dst = cpI->dst();
const operand_info &src1 = pI->src1();
const operand_info &src2 = pI->src2();
const operand_info &src3 = pI->src3();
@@ -3763,8 +3764,13 @@ void sst_impl( const ptx_instruction *pI, ptx_thread_info *thread )
// store data in sstarr memory
mem->write(addr,size/8,&src3_data.s64,thread,pI);
+ // sync threads
+ cpI->set_bar_id(dst_data.u32);
+
thread->m_last_effective_address = addr;
thread->m_last_memory_space = space;
+ thread->m_last_dram_callback.function = bar_callback;
+ thread->m_last_dram_callback.instruction = cpI;
int NUM_THREADS = 8; // (how do you get this dynamically?)
if (src2_data.s64 == NUM_THREADS-1) {