From e7b3dd442fceb30eaa8008d97429a1d33dad2044 Mon Sep 17 00:00:00 2001 From: Tor Aamodt Date: Tue, 28 Dec 2010 14:09:12 -0800 Subject: - Checkpointing new support for concurrent kernel execution (CUDA only, not OpenCL) This changelist adds full support for streams supported by a new class, stream_manager and enables concurrent execution of kernels from different streams. - fast_regression.sh fails for simpleMultiCopy, simpleStreams (other tests passing) ** Known issues ** - Kernel parameter passing is not done correctly for concurrent kernel execution (somehow concurrentKernels is not affected by this): the parameters are stored inside function_info, which is shared among parallel kernel launches so that the values passed into the launch are likely to get overwritten if multiple grids are launched in parallel streams. - Statistics are printed out whenever the simulation thread runs out of cuda commands (doesn't make sense to print out when a kernel ends during concurrent kernel execution). This will probably require further tweaking so as to be more compatible with data collection scripts. [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 8302] --- src/abstract_hardware_model.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/abstract_hardware_model.h') diff --git a/src/abstract_hardware_model.h b/src/abstract_hardware_model.h index c519be1..77a35a7 100644 --- a/src/abstract_hardware_model.h +++ b/src/abstract_hardware_model.h @@ -91,6 +91,8 @@ public: { m_valid=false; m_kernel_entry=NULL; + m_uid=0; + m_num_cores_running=0; } kernel_info_t( dim3 gridDim, dim3 blockDim, class function_info *entry ) { @@ -102,8 +104,22 @@ public: m_next_cta.y=0; m_next_cta.z=0; m_next_tid=m_next_cta; + m_num_cores_running=0; + m_uid = m_next_uid++; } + void inc_running() { m_num_cores_running++; } + void dec_running() + { + assert( m_num_cores_running > 0 ); + m_num_cores_running--; + } + bool running() const { return m_num_cores_running>0; } + bool valid() const { return m_valid; } + bool done() const + { + return (!valid()) || (no_more_ctas_to_run() && !running()); + } class function_info *entry() { return m_kernel_entry; } const class function_info *entry() const { return m_kernel_entry; } @@ -143,15 +159,22 @@ public: { return m_next_tid.z < m_block_dim.z && m_next_tid.y < m_block_dim.y && m_next_tid.z < m_block_dim.x; } + unsigned get_uid() const { return m_uid; } + std::string name() const; private: bool m_valid; class function_info *m_kernel_entry; + unsigned m_uid; + static unsigned m_next_uid; + dim3 m_grid_dim; dim3 m_block_dim; dim3 m_next_cta; dim3 m_next_tid; + + unsigned m_num_cores_running; }; struct core_config { -- cgit v1.3