summaryrefslogtreecommitdiff
path: root/src/gpgpu-sim/shader.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpgpu-sim/shader.h')
-rw-r--r--src/gpgpu-sim/shader.h38
1 files changed, 36 insertions, 2 deletions
diff --git a/src/gpgpu-sim/shader.h b/src/gpgpu-sim/shader.h
index 3b9859f..db2af01 100644
--- a/src/gpgpu-sim/shader.h
+++ b/src/gpgpu-sim/shader.h
@@ -108,6 +108,10 @@ public:
m_last_fetch=0;
m_next=0;
m_inst_at_barrier=NULL;
+
+ //Jin: cdp support
+ m_cdp_latency = 0;
+ m_cdp_dummy = false;
}
void init( address_type start_pc,
unsigned cta_id,
@@ -124,6 +128,10 @@ public:
n_completed -= active.count(); // active threads are not yet completed
m_active_threads = active;
m_done_exit=false;
+
+ //Jin: cdp support
+ m_cdp_latency = 0;
+ m_cdp_dummy = false;
}
bool functional_done() const;
@@ -260,6 +268,11 @@ private:
unsigned m_stores_outstanding; // number of store requests sent but not yet acknowledged
unsigned m_inst_in_pipeline;
+
+ //Jin: cdp support
+public:
+ unsigned int m_cdp_latency;
+ bool m_cdp_dummy;
};
@@ -1327,6 +1340,9 @@ struct shader_core_config : public core_config
int simt_core_sim_order;
unsigned mem2device(unsigned memid) const { return memid + n_simt_clusters; }
+
+ //Jin: concurrent kernel on sm
+ bool gpgpu_concurrent_kernel_sm;
};
struct shader_core_stats_pod {
@@ -1575,6 +1591,7 @@ public:
void cycle();
void reinit(unsigned start_thread, unsigned end_thread, bool reset_not_completed );
void issue_block2core( class kernel_info_t &kernel );
+
void cache_flush();
void accept_fetch_response( mem_fetch *mf );
void accept_ldst_unit_response( class mem_fetch * mf );
@@ -1583,7 +1600,7 @@ public:
{
assert(k);
m_kernel=k;
- k->inc_running();
+// k->inc_running();
printf("GPGPU-Sim uArch: Shader %d bind to kernel %u \'%s\'\n", m_sid, m_kernel->get_uid(),
m_kernel->name().c_str() );
}
@@ -1750,7 +1767,7 @@ public:
virtual void checkExecutionStatusAndUpdate(warp_inst_t &inst, unsigned t, unsigned tid);
address_type next_pc( int tid ) const;
void fetch();
- void register_cta_thread_exit( unsigned cta_num );
+ void register_cta_thread_exit(unsigned cta_num, kernel_info_t * kernel );
void decode();
@@ -1832,6 +1849,22 @@ public:
// is that the dynamic_warp_id is a running number unique to every warp
// run on this shader, where the warp_id is the static warp slot.
unsigned m_dynamic_warp_id;
+
+ //Jin: concurrent kernels on a sm
+public:
+ bool can_issue_1block(kernel_info_t & kernel);
+ bool occupy_shader_resource_1block(kernel_info_t & kernel, bool occupy);
+ void release_shader_resource_1block(unsigned hw_ctaid, kernel_info_t & kernel);
+ int find_available_hwtid(unsigned int cta_size, bool occupy);
+private:
+ unsigned int m_occupied_n_threads;
+ unsigned int m_occupied_shmem;
+ unsigned int m_occupied_regs;
+ unsigned int m_occupied_ctas;
+ std::bitset<MAX_THREAD_PER_SM> m_occupied_hwtid;
+ std::map<unsigned int, unsigned int> m_occupied_cta_to_hwtid;
+
+
};
class simt_core_cluster {
@@ -1852,6 +1885,7 @@ public:
bool icnt_injection_buffer_full(unsigned size, bool write);
void icnt_inject_request_packet(class mem_fetch *mf);
+
// for perfect memory interface
bool response_queue_full() {
return ( m_response_fifo.size() >= m_config->n_simt_ejection_buffer_size );