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/stream_manager.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/stream_manager.cc')
| -rw-r--r-- | src/stream_manager.cc | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/src/stream_manager.cc b/src/stream_manager.cc index 5d1cfe2..54e2ee7 100644 --- a/src/stream_manager.cc +++ b/src/stream_manager.cc @@ -182,9 +182,9 @@ void stream_operation::do_operation( gpgpu_sim *gpu ) break; case stream_kernel_launch: if( gpu->can_start_kernel() ) { - printf("kernel \'%s\' transfer to GPU hardware scheduler\n", m_kernel.name().c_str() ); + printf("kernel \'%s\' transfer to GPU hardware scheduler\n", m_kernel->name().c_str() ); if( m_sim_mode ) - gpgpu_cuda_ptx_sim_main_func( m_kernel ); + gpgpu_cuda_ptx_sim_main_func( *m_kernel ); else gpu->launch( m_kernel ); } @@ -231,9 +231,11 @@ void stream_manager::register_finished_kernel( unsigned grid_uid ) // called by gpu simulation thread pthread_mutex_lock(&m_lock); CUstream_st *stream = m_grid_id_to_stream[grid_uid]; - assert( grid_uid == stream->front().get_kernel().get_uid() ); + kernel_info_t *kernel = stream->front().get_kernel(); + assert( grid_uid == kernel->get_uid() ); stream->record_next_done(); m_grid_id_to_stream.erase(grid_uid); + delete kernel; pthread_mutex_unlock(&m_lock); } @@ -249,7 +251,7 @@ stream_operation stream_manager::front() if( !m_stream_zero.busy() ) { result = m_stream_zero.next(); if( result.is_kernel() ) { - unsigned grid_id = result.get_kernel().get_uid(); + unsigned grid_id = result.get_kernel()->get_uid(); m_grid_id_to_stream[grid_id] = &m_stream_zero; } } @@ -262,18 +264,10 @@ stream_operation stream_manager::front() CUstream_st *stream = *s; if( !stream->busy() && !stream->empty() ) { result = stream->next(); -// stream_barrier *b = result.get_barrier(); -// if( b && b->value() > 1 ) { -// b->dec(); -// result = stream_operation(); -// } else { -// assert( b->value() == 1 ); -// delete b; - if( result.is_kernel() ) { - unsigned grid_id = result.get_kernel().get_uid(); - m_grid_id_to_stream[grid_id] = stream; - } -// } + if( result.is_kernel() ) { + unsigned grid_id = result.get_kernel()->get_uid(); + m_grid_id_to_stream[grid_id] = stream; + } break; } } |
