summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorspeverel <[email protected]>2017-09-24 21:12:40 -0700
committerspeverel <[email protected]>2017-09-24 21:12:40 -0700
commit0751c1489add70d7494521c7f9d65f462e4391c6 (patch)
tree7b501ebf9d1c05c010b40d1d8eda8e5ecf89599c /src
parente8ee788f33f234968a61befff2347dc942e69e39 (diff)
Changed how warp level instructions are handled to avoid an assert that is guaranteed to fail in functional simulation only mode. Hopefully this shouldn't introduce any new issues.
Diffstat (limited to 'src')
-rw-r--r--src/abstract_hardware_model.h4
-rw-r--r--src/cuda-sim/instructions.cc4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/abstract_hardware_model.h b/src/abstract_hardware_model.h
index 607eda7..cdd9cf3 100644
--- a/src/abstract_hardware_model.h
+++ b/src/abstract_hardware_model.h
@@ -980,6 +980,10 @@ public:
assert( !m_empty );
return m_warp_id;
}
+ unsigned warp_id_func() const // to be used in functional simulations only
+ {
+ return m_warp_id;
+ }
unsigned dynamic_warp_id() const
{
assert( !m_empty );
diff --git a/src/cuda-sim/instructions.cc b/src/cuda-sim/instructions.cc
index 159fd4c..493e307 100644
--- a/src/cuda-sim/instructions.cc
+++ b/src/cuda-sim/instructions.cc
@@ -1500,7 +1500,7 @@ void bsmad_impl( const ptx_instruction *pI, core_t *core, warp_inst_t inst )
const operand_info &src1 = pI->src1();
const operand_info &src2 = pI->src2();
unsigned type = pI->get_type();
- int tid = inst.warp_id() * core->get_warp_size();
+ int tid = inst.warp_id_func() * core->get_warp_size();
ptx_thread_info *thread = core->get_thread_info()[tid];
const int ip = (thread->get_operand_value(src1, dst, type, thread, 1)).u32;
const int op = (thread->get_operand_value(src2, dst, type, thread, 1)).u32;
@@ -3698,7 +3698,7 @@ void set_impl( const ptx_instruction *pI, ptx_thread_info *thread )
void shfl_impl( const ptx_instruction *pI, core_t *core, warp_inst_t inst )
{
unsigned i_type = pI->get_type();
- int tid = inst.warp_id() * core->get_warp_size();
+ int tid = inst.warp_id_func() * core->get_warp_size();
ptx_thread_info *thread = core->get_thread_info()[tid];
ptx_warp_info *warp_info = thread->m_warp_info;
int lane = warp_info->get_done_threads();