diff options
| author | Tor Aamodt <[email protected]> | 2010-12-28 17:25:52 -0800 |
|---|---|---|
| committer | Tor Aamodt <[email protected]> | 2010-12-28 17:25:52 -0800 |
| commit | 47afff48be8f59c6cfcb86eded3a337b63130b18 (patch) | |
| tree | 5cc3510b8712c5846741a370c73d0db6dfdd8693 /src/gpgpusim_entrypoint.cc | |
| parent | e7b3dd442fceb30eaa8008d97429a1d33dad2044 (diff) | |
- parameter memory and active threads now part of kernel_info_t:
Parameters are finalized at kernel launch, which means the contents
of parameter memory are initialized. Kernel arguement names have a
fixed order, hence same address should be assigned on subsequent
kernel launches of same kernel in other streams provided the data size
param_t::size of arguments for each kernel launch is identical (an
assertion has been added to check this is true).
- passing regression
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 8303]
Diffstat (limited to 'src/gpgpusim_entrypoint.cc')
| -rw-r--r-- | src/gpgpusim_entrypoint.cc | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/gpgpusim_entrypoint.cc b/src/gpgpusim_entrypoint.cc index 00ba5a2..cf70f24 100644 --- a/src/gpgpusim_entrypoint.cc +++ b/src/gpgpusim_entrypoint.cc @@ -137,6 +137,7 @@ void *gpgpu_sim_thread_concurrent(void*) g_sim_active = true; pthread_mutex_unlock(&g_sim_lock); bool active = false; + bool sim_cycles = false; do { // check if a kernel has completed unsigned grid_uid = g_the_gpu->finished_kernel(); @@ -148,14 +149,17 @@ void *gpgpu_sim_thread_concurrent(void*) op.do_operation(g_the_gpu); // simulate a clock cycle on the GPU - if( g_the_gpu->active() ) + if( g_the_gpu->active() ) { g_the_gpu->cycle(); + sim_cycles = true; + } g_the_gpu->deadlock_check(); active = g_the_gpu->active() || !g_stream_manager->empty(); } while( active ); printf("GPGPU-Sim: ** STOP simulation thread (no work) **\n"); fflush(stdout); - g_the_gpu->print_stats(); + if( sim_cycles ) + g_the_gpu->print_stats(); pthread_mutex_lock(&g_sim_lock); g_sim_active = false; pthread_mutex_unlock(&g_sim_lock); @@ -254,15 +258,7 @@ void print_simulation_time() fflush(stdout); } -int gpgpu_cuda_ptx_sim_main_perf( kernel_info_t grid ) -{ - g_the_gpu->launch(grid); - //sem_post(&g_sim_signal_start); - //sem_wait(&g_sim_signal_finish); - return 0; -} - -int gpgpu_opencl_ptx_sim_main_perf( kernel_info_t grid ) +int gpgpu_opencl_ptx_sim_main_perf( kernel_info_t *grid ) { g_the_gpu->launch(grid); sem_post(&g_sim_signal_start); @@ -270,7 +266,7 @@ int gpgpu_opencl_ptx_sim_main_perf( kernel_info_t grid ) return 0; } -int gpgpu_opencl_ptx_sim_main_func( kernel_info_t grid ) +int gpgpu_opencl_ptx_sim_main_func( kernel_info_t *grid ) { printf("GPGPU-Sim PTX API: OpenCL functional-only simulation not yet implemented (use performance simulation)\n"); exit(1); |
