summaryrefslogtreecommitdiff
path: root/src/gpgpu-sim
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpgpu-sim')
-rw-r--r--src/gpgpu-sim/shader.cc9
-rw-r--r--src/gpgpu-sim/shader.h4
2 files changed, 13 insertions, 0 deletions
diff --git a/src/gpgpu-sim/shader.cc b/src/gpgpu-sim/shader.cc
index bf482fb..72e0266 100644
--- a/src/gpgpu-sim/shader.cc
+++ b/src/gpgpu-sim/shader.cc
@@ -438,6 +438,9 @@ void shader_core_stats::print( FILE* fout ) const
fprintf(fout,"gpgpu_n_mem_texture = %d\n", gpgpu_n_mem_texture);
fprintf(fout,"gpgpu_n_mem_const = %d\n", gpgpu_n_mem_const);
+ fprintf(fout,"gpgpu_n_times_gmem_accesses_by_warps = %lld\n", gpgpu_n_times_gmem_accesses_by_warps);
+ fprintf(fout,"gpgpu_n_total_gmem_accesses_by_warps = %lld\n", gpgpu_n_total_gmem_accesses_by_warps);
+
fprintf(fout, "gpgpu_n_load_insn = %d\n", gpgpu_n_load_insn);
fprintf(fout, "gpgpu_n_store_insn = %d\n", gpgpu_n_store_insn);
fprintf(fout, "gpgpu_n_shmem_insn = %d\n", gpgpu_n_shmem_insn);
@@ -740,9 +743,15 @@ void shader_core_ctx::fetch()
void shader_core_ctx::func_exec_inst( warp_inst_t &inst )
{
+ unsigned starting_queue_size;
execute_warp_inst_t(inst);
if( inst.is_load() || inst.is_store() )
+ starting_queue_size = inst.accessq_count();
inst.generate_mem_accesses();
+ if ( inst.space.get_type() == global_space ) {
+ m_stats->gpgpu_n_times_gmem_accesses_by_warps++;
+ m_stats->gpgpu_n_total_gmem_accesses_by_warps += inst.accessq_count() - starting_queue_size;
+ }
}
void shader_core_ctx::issue_warp( register_set& pipe_reg_set, const warp_inst_t* next_inst, const active_mask_t &active_mask, unsigned warp_id )
diff --git a/src/gpgpu-sim/shader.h b/src/gpgpu-sim/shader.h
index 5b41c06..2475677 100644
--- a/src/gpgpu-sim/shader.h
+++ b/src/gpgpu-sim/shader.h
@@ -1470,6 +1470,10 @@ struct shader_core_stats_pod {
int gpgpu_n_mem_read_global;
int gpgpu_n_mem_write_global;
int gpgpu_n_mem_read_inst;
+
+ //warps memory divergence count
+ unsigned long long gpgpu_n_times_gmem_accesses_by_warps;
+ unsigned long long gpgpu_n_total_gmem_accesses_by_warps;
int gpgpu_n_mem_l2_writeback;
int gpgpu_n_mem_l1_write_allocate;