summaryrefslogtreecommitdiff
path: root/src/abstract_hardware_model.h
diff options
context:
space:
mode:
authorarun <a@b>2011-07-28 02:19:39 -0800
committerAndrew Boktor <[email protected]>2014-08-14 13:18:22 -0700
commitd52a3292002fc0b6b37773ef03ca9b4ba5847c13 (patch)
treeb4209431fafb8c46f8d34630277297570d724858 /src/abstract_hardware_model.h
parent9ba14bafc4e02f6a125a1df96d80f508c306488c (diff)
Fixes for atomic callbacks
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 9901]
Diffstat (limited to 'src/abstract_hardware_model.h')
-rw-r--r--src/abstract_hardware_model.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/abstract_hardware_model.h b/src/abstract_hardware_model.h
index 9cb96f4..9ca747e 100644
--- a/src/abstract_hardware_model.h
+++ b/src/abstract_hardware_model.h
@@ -655,12 +655,16 @@ public:
void do_atomic()
{
assert( m_isatomic && !m_empty );
- std::vector<per_thread_info>::iterator t;
- for( t=m_per_scalar_thread.begin(); t != m_per_scalar_thread.end(); ++t ) {
- dram_callback_t &cb = t->callback;
- if( cb.thread )
- cb.function(cb.instruction, cb.thread);
- }
+ for( unsigned i=0; i < m_config->warp_size; i++ )
+ {
+ if( m_warp_active_mask.test(i) )
+ {
+ dram_callback_t &cb = m_per_scalar_thread[i].callback;
+ if( cb.thread )
+ cb.function(cb.instruction, cb.thread);
+ }
+ }
+
}
void clear()
{