diff options
| author | Tor Aamodt <[email protected]> | 2010-10-08 07:21:51 -0800 |
|---|---|---|
| committer | Tor Aamodt <[email protected]> | 2010-10-08 07:21:51 -0800 |
| commit | 8c2954c263b4cfd756188362919c1a16a7189788 (patch) | |
| tree | e4827655db3edb26d4668fc42e78f1e5731afa02 /src/gpgpu-sim/shader.h | |
| parent | 474e6d99c8efa9e3b8518eecb059546364370fd9 (diff) | |
1. refactoring cuda api code for loading PTX (removing external PTX loading entirely)
2. some bug fixes for warp_inst_t
3. creating a new class, gpgpu_t, which contains the functional "memory" state visible
to all threads running on a GPU (doing this as part of my continuing effort to hunt
down and eradicate every global variable that is not the top level "the gpu")
4. other misc. changes
Almost passing CUDA 3.1 regression? oclHistogram keeps failing under torque, but
does not fail when run on the command line from the same directory.
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 7827]
Diffstat (limited to 'src/gpgpu-sim/shader.h')
| -rw-r--r-- | src/gpgpu-sim/shader.h | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/gpgpu-sim/shader.h b/src/gpgpu-sim/shader.h index d9a8825..cdbaf37 100644 --- a/src/gpgpu-sim/shader.h +++ b/src/gpgpu-sim/shader.h @@ -146,8 +146,6 @@ public: m_done_exit=false; m_last_fetch=0; m_next=0; - for(unsigned i=0;i<IBUFFER_SIZE;i++) - m_ibuffer[i]=NULL; } void init( address_type start_pc, unsigned cta_id, unsigned wid, unsigned active ) { @@ -186,31 +184,32 @@ public: void ibuffer_fill( unsigned slot, const warp_inst_t *pI ) { assert(slot < IBUFFER_SIZE ); - m_ibuffer[slot]=pI; + m_ibuffer[slot].m_inst=pI; + m_ibuffer[slot].m_valid=true; m_next=0; } bool ibuffer_empty() const { for( unsigned i=0; i < IBUFFER_SIZE; i++) - if(m_ibuffer[i]) + if(m_ibuffer[i].m_valid) return false; return true; } void ibuffer_flush() { for(unsigned i=0;i<IBUFFER_SIZE;i++) { - if( m_ibuffer[i] ) + if( m_ibuffer[i].m_valid ) dec_inst_in_pipeline(); - m_ibuffer[i]=NULL; + m_ibuffer[i].m_inst=NULL; + m_ibuffer[i].m_valid=false; } } - const warp_inst_t *ibuffer_next() - { - return m_ibuffer[m_next]; - } + const warp_inst_t *ibuffer_next_inst() { return m_ibuffer[m_next].m_inst; } + bool ibuffer_next_valid() { return m_ibuffer[m_next].m_valid; } void ibuffer_free() { - m_ibuffer[m_next] = NULL; + m_ibuffer[m_next].m_inst = NULL; + m_ibuffer[m_next].m_valid = false; } void ibuffer_step() { @@ -252,8 +251,13 @@ private: unsigned n_completed; // number of threads in warp completed class mshr_entry *m_imiss_pending; - - const warp_inst_t *m_ibuffer[IBUFFER_SIZE]; + + struct ibuffer_entry { + ibuffer_entry() { m_valid = false; m_inst = NULL; } + const warp_inst_t *m_inst; + bool m_valid; + }; + ibuffer_entry m_ibuffer[IBUFFER_SIZE]; unsigned m_next; unsigned m_n_atomic; // number of outstanding atomic operations |
