summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTor Aamodt <[email protected]>2010-07-17 18:15:43 -0800
committerTor Aamodt <[email protected]>2010-07-17 18:15:43 -0800
commit619c0c87fd18a9b34d2bbcf9eb2711bbe07b8d9a (patch)
treed8afea007fc43cee93f3abba96ada9b0f4e998f8 /src
parent9a6215627d9e103037632c91e6bfbd028fd82caa (diff)
getting rid of void pointers for ptx_thread_info
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 6874]
Diffstat (limited to 'src')
-rw-r--r--src/cuda-sim/cuda-sim.cc26
-rw-r--r--src/gpgpu-sim/gpu-sim.cc2
-rw-r--r--src/gpgpu-sim/shader.cc4
-rw-r--r--src/gpgpu-sim/shader.h2
4 files changed, 17 insertions, 17 deletions
diff --git a/src/cuda-sim/cuda-sim.cc b/src/cuda-sim/cuda-sim.cc
index 951e4e9..41acd62 100644
--- a/src/cuda-sim/cuda-sim.cc
+++ b/src/cuda-sim/cuda-sim.cc
@@ -1285,26 +1285,26 @@ const struct gpgpu_ptx_sim_kernel_info* ptx_sim_kernel_info() {
return g_entrypoint_func_info->get_kernel_info();
}
-void ptx_sim_free_sm( void** thread_info )
+void ptx_sim_free_sm( ptx_thread_info** thread_info )
{
}
-unsigned ptx_sim_init_thread( void** thread_info,int sid,unsigned tid,unsigned threads_left,unsigned num_threads, core_t *core, unsigned hw_cta_id, unsigned hw_warp_id )
+unsigned ptx_sim_init_thread( ptx_thread_info** thread_info,int sid,unsigned tid,unsigned threads_left,unsigned num_threads, core_t *core, unsigned hw_cta_id, unsigned hw_warp_id )
{
if ( *thread_info != NULL ) {
- ptx_thread_info *thd = *((ptx_thread_info**)thread_info);
+ ptx_thread_info *thd = *thread_info;
assert( thd->is_done() );
if ( g_debug_execution==-1 ) {
dim3 ctaid = thd->get_ctaid();
dim3 tid = thd->get_tid();
- printf("GPGPU-Sim PTX simulator: thread exiting ctaid=(%u,%u,%u) tid=(%u,%u,%u) @ 0x%Lx\n",
- ctaid.x,ctaid.y,ctaid.z,tid.x,tid.y,tid.z, (unsigned long long)*((void**)thread_info) );
+ printf("GPGPU-Sim PTX simulator: thread exiting ctaid=(%u,%u,%u) tid=(%u,%u,%u) uid=%u\n",
+ ctaid.x,ctaid.y,ctaid.z,tid.x,tid.y,tid.z, thd->get_uid() );
fflush(stdout);
}
thd->m_cta_info->assert_barrier_empty();
thd->m_cta_info->register_deleted_thread(thd);
delete thd;
- *((ptx_thread_info**)thread_info) = NULL;
+ *thread_info = NULL;
}
if ( !g_active_threads.empty() ) { //if g_active_threads not empty...
@@ -1314,7 +1314,7 @@ unsigned ptx_sim_init_thread( void** thread_info,int sid,unsigned tid,unsigned t
assert( g_cta_launch_sid == (unsigned)sid );
ptx_thread_info *thd = g_active_threads.front();
g_active_threads.pop_front();
- *((ptx_thread_info**)thread_info) = thd;
+ *thread_info = thd;
thd->set_hw_tid(tid);
thd->set_hw_wid(hw_warp_id);
thd->set_hw_ctaid(hw_cta_id);
@@ -1443,12 +1443,12 @@ unsigned ptx_sim_init_thread( void** thread_info,int sid,unsigned tid,unsigned t
assert( g_active_threads.size() <= threads_left );
g_cta_launch_sid = sid;
- *((ptx_thread_info**)thread_info) = g_active_threads.front();
- (*((ptx_thread_info**)thread_info) )->set_hw_tid(tid);
- (*((ptx_thread_info**)thread_info) )->set_hw_wid(hw_warp_id);
- (*((ptx_thread_info**)thread_info) )->set_hw_ctaid(hw_cta_id);
- (*((ptx_thread_info**)thread_info) )->set_core(core);
- (*((ptx_thread_info**)thread_info) )->set_hw_sid(sid);
+ *thread_info = g_active_threads.front();
+ (*thread_info)->set_hw_tid(tid);
+ (*thread_info)->set_hw_wid(hw_warp_id);
+ (*thread_info)->set_hw_ctaid(hw_cta_id);
+ (*thread_info)->set_core(core);
+ (*thread_info)->set_hw_sid(sid);
g_active_threads.pop_front();
return 1;
diff --git a/src/gpgpu-sim/gpu-sim.cc b/src/gpgpu-sim/gpu-sim.cc
index d77d1e0..e7e5067 100644
--- a/src/gpgpu-sim/gpu-sim.cc
+++ b/src/gpgpu-sim/gpu-sim.cc
@@ -325,7 +325,7 @@ void icnt_init_grid();
void interconnect_stats();
void icnt_overal_stat();
unsigned ptx_sim_cta_size();
-unsigned ptx_sim_init_thread( void** thread_info, int sid, unsigned tid,unsigned threads_left,unsigned num_threads, core_t *core, unsigned hw_cta_id, unsigned hw_warp_id );
+unsigned ptx_sim_init_thread( ptx_thread_info** thread_info, int sid, unsigned tid,unsigned threads_left,unsigned num_threads, core_t *core, unsigned hw_cta_id, unsigned hw_warp_id );
void gpu_sim_loop( int grid_num );
diff --git a/src/gpgpu-sim/shader.cc b/src/gpgpu-sim/shader.cc
index b9ae7da..3f084f8 100644
--- a/src/gpgpu-sim/shader.cc
+++ b/src/gpgpu-sim/shader.cc
@@ -222,8 +222,8 @@ extern unsigned long long gpu_tot_sim_cycle;
extern unsigned g_max_regs_per_thread;
void ptx_decode_inst( void *thd, unsigned *op, int *i1, int *i2, int *i3, int *i4, int *o1, int *o2, int *o3, int *o4, int *vectorin, int *vectorout, int *arch_reg );
void ptx_exec_inst( void *thd, address_type *addr, memory_space_t *space, unsigned *data_size, dram_callback_t* callback, unsigned warp_active_mask);
-void ptx_sim_free_sm( void** thread_info );
-unsigned ptx_sim_init_thread( void** thread_info, int sid, unsigned tid,unsigned threads_left,unsigned num_threads, core_t *core, unsigned hw_cta_id, unsigned hw_warp_id);
+void ptx_sim_free_sm( class ptx_thread_info** thread_info );
+unsigned ptx_sim_init_thread( class ptx_thread_info** thread_info, int sid, unsigned tid,unsigned threads_left,unsigned num_threads, core_t *core, unsigned hw_cta_id, unsigned hw_warp_id);
unsigned ptx_sim_cta_size();
const struct gpgpu_ptx_sim_kernel_info* ptx_sim_kernel_info();
void set_option_gpgpu_spread_blocks_across_cores(int option);
diff --git a/src/gpgpu-sim/shader.h b/src/gpgpu-sim/shader.h
index 3b99ad3..1394481 100644
--- a/src/gpgpu-sim/shader.h
+++ b/src/gpgpu-sim/shader.h
@@ -158,7 +158,7 @@ typedef struct {
typedef struct {
- void *ptx_thd_info; // pointer to the functional state of the thread in cuda-sim
+ class ptx_thread_info *ptx_thd_info; // pointer to the functional state of the thread in cuda-sim
int avail4fetch; // 1 if its instrucion can be fetch into the pipeline, 0 otherwise
int warp_priority;