summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Aamodt <[email protected]>2010-07-20 01:08:56 -0800
committerTor Aamodt <[email protected]>2010-07-20 01:08:56 -0800
commita884b505457d48dcd2783563d407e14a607456ee (patch)
tree4e50efd26376e2dce8c96a8b21bd57f88c74e23f
parent55106068e9087f253bbeb587a763055620e59441 (diff)
- adding CL_DEVICE_SINGLE_FP_CONFIG (need to get info on what it should be set to)
- bug fix for shader_core object allocation/initialization - bug fix for ret instruction w/ OpenCL + new PTX ABI - some formatting of output [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 6910]
-rw-r--r--libopencl/opencl_runtime_api.cc1
-rw-r--r--src/cuda-sim/cuda-sim.cc2
-rw-r--r--src/cuda-sim/ptx_sim.cc8
-rw-r--r--src/gpgpu-sim/gpu-sim.cc6
-rw-r--r--src/gpgpu-sim/shader.cc3
-rw-r--r--src/gpgpu-sim/shader.h2
6 files changed, 12 insertions, 10 deletions
diff --git a/libopencl/opencl_runtime_api.cc b/libopencl/opencl_runtime_api.cc
index d49cc6e..c5297a3 100644
--- a/libopencl/opencl_runtime_api.cc
+++ b/libopencl/opencl_runtime_api.cc
@@ -1064,6 +1064,7 @@ clGetDeviceInfo(cl_device_id device,
case CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG: CL_INT_CASE(1); break;
case CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT: CL_INT_CASE(1); break;
case CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE: CL_INT_CASE(0); break;
+ case CL_DEVICE_SINGLE_FP_CONFIG: CL_INT_CASE(0); break;
default:
opencl_not_implemented(__my_func__,__LINE__);
}
diff --git a/src/cuda-sim/cuda-sim.cc b/src/cuda-sim/cuda-sim.cc
index 8703922..2a41e4b 100644
--- a/src/cuda-sim/cuda-sim.cc
+++ b/src/cuda-sim/cuda-sim.cc
@@ -1239,7 +1239,7 @@ void function_info::ptx_exec_inst( ptx_thread_info *thread,
if ( (g_ptx_sim_num_insn % 100000) == 0 ) {
dim3 ctaid = thread->get_ctaid();
dim3 tid = thread->get_tid();
- printf("%u instructions simulated : ctaid=(%u,%u,%u) tid=(%u,%u,%u)\n",
+ printf("GPGPU-Sim PTX: %u instructions simulated : ctaid=(%u,%u,%u) tid=(%u,%u,%u)\n",
g_ptx_sim_num_insn, ctaid.x,ctaid.y,ctaid.z,tid.x,tid.y,tid.z );
fflush(stdout);
}
diff --git a/src/cuda-sim/ptx_sim.cc b/src/cuda-sim/ptx_sim.cc
index 3974408..bf7b7b6 100644
--- a/src/cuda-sim/ptx_sim.cc
+++ b/src/cuda-sim/ptx_sim.cc
@@ -356,6 +356,7 @@ void ptx_thread_info::callstack_push( unsigned pc, unsigned rpc, const symbol *r
m_RPC = -1;
m_RPC_updated = true;
m_last_was_call = true;
+ assert( m_func_info != NULL );
m_callstack.push_back( stack_entry(m_symbol_table,m_func_info,pc,rpc,return_var_src,return_var_dst,call_uid) );
m_regs.push_back( reg_map_t() );
m_local_mem_stack_pointer += m_func_info->local_mem_framesize();
@@ -368,8 +369,6 @@ extern void set_operand_value( const symbol *dst, const ptx_reg_t &data );
bool ptx_thread_info::callstack_pop()
{
- assert( !m_callstack.empty() );
- assert( m_local_mem_stack_pointer >= m_callstack.back().m_func_info->local_mem_framesize() );
const symbol *rv_src = m_callstack.back().m_return_var_src;
const symbol *rv_dst = m_callstack.back().m_return_var_dst;
assert( !((rv_src != NULL) ^ (rv_dst != NULL)) ); // ensure caller and callee agree on whether there is a return value
@@ -384,8 +383,11 @@ bool ptx_thread_info::callstack_pop()
m_RPC_updated = true;
m_last_was_call = false;
m_RPC = m_callstack.back().m_RPC;
+ if( m_callstack.back().m_func_info ) {
+ assert( m_local_mem_stack_pointer >= m_callstack.back().m_func_info->local_mem_framesize() );
+ m_local_mem_stack_pointer -= m_func_info->local_mem_framesize();
+ }
m_func_info = m_callstack.back().m_func_info;
- m_local_mem_stack_pointer -= m_func_info->local_mem_framesize();
m_callstack.pop_back();
m_regs.pop_back();
diff --git a/src/gpgpu-sim/gpu-sim.cc b/src/gpgpu-sim/gpu-sim.cc
index e7e5067..d07cac6 100644
--- a/src/gpgpu-sim/gpu-sim.cc
+++ b/src/gpgpu-sim/gpu-sim.cc
@@ -855,7 +855,7 @@ unsigned int run_gpu_sim(int grid_num)
#define DEADLOCK 0
if (gpu_deadlock_detect && gpu_deadlock) {
fflush(stdout);
- printf("ERROR ** deadlock detected: last writeback @ gpu_sim_cycle %u (+ gpu_tot_sim_cycle %u) (%u cycles ago)\n",
+ printf("GPGPU-Sim uArch: ERROR ** deadlock detected: last writeback @ gpu_sim_cycle %u (+ gpu_tot_sim_cycle %u) (%u cycles ago)\n",
(unsigned) gpu_sim_insn_last_update, (unsigned) (gpu_tot_sim_cycle-gpu_sim_cycle),
(unsigned) (gpu_sim_cycle - gpu_sim_insn_last_update ));
fflush(stdout);
@@ -1252,7 +1252,7 @@ int issue_block2core( shader_core_ctx_t *shdr, int grid_num )
if (gpgpu_spread_blocks_across_cores) {
nthreads_2beissued += start_thread;
}
- printf("Shader %d initializing CTA #%d with hw tids from %d to %d @(%lld,%lld)",
+ printf("GPGPU-Sim uArch: Shader %d initializing CTA #%d with hw tids from %d to %d @(%lld,%lld)",
shdr->sid, cta_id, start_thread, nthreads_2beissued, gpu_sim_cycle, gpu_tot_sim_cycle );
printf(" shdr->not_completed = %d\n", shdr->not_completed);
@@ -1593,7 +1593,7 @@ void gpu_sim_loop( int grid_num )
hrs = elapsed_time/3600 - 24*days;
minutes = elapsed_time/60 - 60*(hrs + 24*days);
sec = elapsed_time - 60*(minutes + 60*(hrs + 24*days));
- printf("cycles: %lld inst.: %lld (ipc=%4.1f) sim_rate=%u (inst/sec) elapsed = %u:%u:%02u:%02u / %s",
+ printf("GPGPU-Sim uArch: cycles simulated: %lld inst.: %lld (ipc=%4.1f) sim_rate=%u (inst/sec) elapsed = %u:%u:%02u:%02u / %s",
gpu_tot_sim_cycle + gpu_sim_cycle, gpu_tot_sim_insn + gpu_sim_insn,
(double)gpu_sim_insn/(double)gpu_sim_cycle,
(unsigned)((gpu_tot_sim_insn+gpu_sim_insn) / elapsed_time),
diff --git a/src/gpgpu-sim/shader.cc b/src/gpgpu-sim/shader.cc
index 2271d79..4901d51 100644
--- a/src/gpgpu-sim/shader.cc
+++ b/src/gpgpu-sim/shader.cc
@@ -570,7 +570,8 @@ shader_core_ctx_t* shader_create( const char *name, int sid,
}
}
- sc = new shader_core_ctx_t( gpu_n_warp_per_shader, gpgpu_shader_cta );
+ sc = (shader_core_ctx_t*)calloc(sizeof(shader_core_ctx_t),1);
+ sc = new (sc) shader_core_ctx_t( gpu_n_warp_per_shader, gpgpu_shader_cta );
sc->name = name;
sc->sid = sid;
diff --git a/src/gpgpu-sim/shader.h b/src/gpgpu-sim/shader.h
index 1394481..f67e8fd 100644
--- a/src/gpgpu-sim/shader.h
+++ b/src/gpgpu-sim/shader.h
@@ -446,8 +446,6 @@ typedef struct shader_core_ctx : public core_t
unsigned int n_registers; //registers available in the shader core
unsigned int n_cta; //Limit on number of concurrent CTAs in shader core
- //void *req_hist; //not used anywhere
-
mshr_shader_unit *mshr_unit;
} shader_core_ctx_t;