summaryrefslogtreecommitdiff
path: root/src/gpgpu-sim/gpu-sim.h
diff options
context:
space:
mode:
authorTor Aamodt <[email protected]>2010-12-28 14:09:12 -0800
committerTor Aamodt <[email protected]>2010-12-28 14:09:12 -0800
commite7b3dd442fceb30eaa8008d97429a1d33dad2044 (patch)
tree3f1a9da5de24518bc9859283d46e8e83614e668c /src/gpgpu-sim/gpu-sim.h
parentd864c51b9fee6b2808e4752a556d6de4ba376b7c (diff)
- 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]
Diffstat (limited to 'src/gpgpu-sim/gpu-sim.h')
-rw-r--r--src/gpgpu-sim/gpu-sim.h39
1 files changed, 18 insertions, 21 deletions
diff --git a/src/gpgpu-sim/gpu-sim.h b/src/gpgpu-sim/gpu-sim.h
index db0b18f..5631ab9 100644
--- a/src/gpgpu-sim/gpu-sim.h
+++ b/src/gpgpu-sim/gpu-sim.h
@@ -192,20 +192,8 @@ public:
m_valid=true;
}
- void set_max_cta( const kernel_info_t &kernel )
- {
- // calcaulte the max cta count and cta size for local memory address mapping
- m_shader_config.gpu_max_cta_per_shader = m_shader_config.max_cta(kernel);
- //gpu_max_cta_per_shader is limited by number of CTAs if not enough
- if( kernel.num_blocks() < m_shader_config.gpu_max_cta_per_shader*num_shader() ) {
- m_shader_config.gpu_max_cta_per_shader = (kernel.num_blocks() / num_shader());
- if (kernel.num_blocks() % num_shader())
- m_shader_config.gpu_max_cta_per_shader++;
- }
- unsigned int gpu_cta_size = kernel.threads_per_cta();
- m_shader_config.gpu_padded_cta_size = (gpu_cta_size%32) ? 32*((gpu_cta_size/32)+1) : gpu_cta_size;
- }
unsigned num_shader() const { return m_shader_config.num_shader(); }
+ unsigned get_max_concurrent_kernel() const { return max_concurrent_kernel; }
private:
void init_clock_domains(void );
@@ -234,6 +222,7 @@ private:
int gpgpu_dram_sched_queue_size;
int gpgpu_cflog_interval;
char * gpgpu_clock_domains;
+ unsigned max_concurrent_kernel;
// visualizer
bool g_visualizer_enabled;
@@ -254,12 +243,17 @@ public:
void set_prop( struct cudaDeviceProp *prop );
void launch( kernel_info_t &kinfo );
- kernel_info_t *next_grid();
+ bool can_start_kernel();
+ unsigned finished_kernel();
+ void set_kernel_done( unsigned uid ) { m_finished_kernel.push_back(uid); }
- unsigned run_gpu_sim();
+ void init();
+ void cycle();
+ bool active();
+ void print_stats();
+ void deadlock_check();
void get_pdom_stack_top_info( unsigned sid, unsigned tid, unsigned *pc, unsigned *rpc );
- const kernel_info_t &the_kernel() const { return m_the_kernel; }
int shared_mem_size() const;
int num_registers_per_core() const;
@@ -269,6 +263,8 @@ public:
enum divergence_support_t simd_model() const;
unsigned threads_per_core() const;
+ bool get_more_cta_left() const;
+ kernel_info_t *select_kernel();
const gpgpu_sim_config &get_config() const { return m_config; }
void gpu_print_stat() const;
@@ -278,8 +274,8 @@ private:
// clocks
void reinit_clock_domains(void);
int next_clock_domain(void);
+ void issue_block2core();
- void cycle();
void L2c_print_cache_stat() const;
void shader_print_runtime_stat( FILE *fout );
void shader_print_l1_miss_stat( FILE *fout );
@@ -293,11 +289,12 @@ private:
class simt_core_cluster **m_cluster;
class memory_partition_unit **m_memory_partition_unit;
- kernel_info_t m_the_kernel;
- std::list<kernel_info_t> m_running_kernels;
+ std::vector<kernel_info_t> m_running_kernels;
+ unsigned m_last_issued_kernel;
- unsigned g_total_cta_left;
- bool more_thread;
+ std::list<unsigned> m_finished_kernel;
+ unsigned m_total_cta_launched;
+ unsigned m_last_cluster_issue;
// time of next rising edge
double core_time;