From 877cbd077ffaf112b68973fdb7db8f10505303ee Mon Sep 17 00:00:00 2001 From: sspenst Date: Fri, 8 Jul 2016 12:57:56 -0700 Subject: SST should now properly simulate the barrier operation --- src/cuda-sim/instructions.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/cuda-sim/instructions.cc') 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(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) { -- cgit v1.3