Skip to content

Commit

Permalink
Print stream ID only once per kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
JRPan committed Aug 9, 2024
1 parent e5a3825 commit c74d934
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/gpgpu-sim/gpu-cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -882,8 +882,7 @@ void cache_stats::print_stats(FILE *fout, unsigned long long streamID, const cha
total_access.resize(NUM_MEM_ACCESS_TYPE, 0);
for (unsigned type = 0; type < NUM_MEM_ACCESS_TYPE; ++type) {
for (unsigned status = 0; status < NUM_CACHE_REQUEST_STATUS; ++status) {
fprintf(fout, "\t%s[Stream_%llu][%s][%s] = %llu\n", m_cache_name.c_str(),
streamid,
fprintf(fout, "\t%s[%s][%s] = %llu\n", m_cache_name.c_str(),
mem_access_type_str((enum mem_access_type)type),
cache_request_status_str((enum cache_request_status)status),
m_stats.at(streamid)[type][status]);
Expand All @@ -896,8 +895,7 @@ void cache_stats::print_stats(FILE *fout, unsigned long long streamID, const cha
}
for (unsigned type = 0; type < NUM_MEM_ACCESS_TYPE; ++type) {
if (total_access[type] > 0)
fprintf(fout, "\t%s[Stream_%llu][%s][%s] = %u\n", m_cache_name.c_str(),
streamid,
fprintf(fout, "\t%s[%s][%s] = %u\n", m_cache_name.c_str(),
mem_access_type_str((enum mem_access_type)type), "TOTAL_ACCESS",
total_access[type]);
}
Expand All @@ -914,8 +912,7 @@ void cache_stats::print_fail_stats(FILE *fout, unsigned long long streamID, cons
for (unsigned type = 0; type < NUM_MEM_ACCESS_TYPE; ++type) {
for (unsigned fail = 0; fail < NUM_CACHE_RESERVATION_FAIL_STATUS; ++fail) {
if (m_fail_stats.at(streamid)[type][fail] > 0) {
fprintf(fout, "\t%s[Stream_%llu][%s][%s] = %llu\n", m_cache_name.c_str(),
streamid,
fprintf(fout, "\t%s[%s][%s] = %llu\n", m_cache_name.c_str(),
mem_access_type_str((enum mem_access_type)type),
cache_fail_status_str((enum cache_reservation_fail_reason)fail),
m_fail_stats.at(streamid)[type][fail]);
Expand Down
2 changes: 2 additions & 0 deletions src/gpgpu-sim/gpu-sim.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1384,6 +1384,8 @@ void gpgpu_sim::gpu_print_stat(unsigned long long streamID) {
std::string kernel_info_str = executed_kernel_info_string();
fprintf(statfout, "%s", kernel_info_str.c_str());

printf("kernel_stream_id = %llu\n", streamID);

printf("gpu_sim_cycle = %lld\n", gpu_sim_cycle);
printf("gpu_sim_insn = %lld\n", gpu_sim_insn);
printf("gpu_ipc = %12.4f\n", (float)gpu_sim_insn / gpu_sim_cycle);
Expand Down

0 comments on commit c74d934

Please sign in to comment.