summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMengchi Zhang <[email protected]>2019-07-10 00:25:15 -0400
committerMengchi Zhang <[email protected]>2019-07-10 00:25:15 -0400
commit0a0dbfe33d434d4e3c6988a345b9e8a9779eddc1 (patch)
treeb2859140c661d2d688a8b6abbb2deb1aa3fb15f0
parent717de45b61d12fd4aedea111515433167c7efab7 (diff)
Move g_inst_classification_stat and g_inst_op_classification_stat
Signed-off-by: Mengchi Zhang <[email protected]>
-rw-r--r--src/cuda-sim/cuda-sim.cc8
-rw-r--r--src/cuda-sim/cuda-sim.h6
-rw-r--r--src/gpgpu-sim/gpu-sim.cc4
3 files changed, 9 insertions, 9 deletions
diff --git a/src/cuda-sim/cuda-sim.cc b/src/cuda-sim/cuda-sim.cc
index e9508ee..7e8aab9 100644
--- a/src/cuda-sim/cuda-sim.cc
+++ b/src/cuda-sim/cuda-sim.cc
@@ -54,8 +54,6 @@ typedef void * yyscan_t;
#include "../../libcuda/gpgpu_context.h"
int gpgpu_ptx_instruction_classification;
-void ** g_inst_classification_stat = NULL;
-void ** g_inst_op_classification_stat= NULL;
int g_debug_execution = 0;
int g_debug_thread_uid = 0;
addr_t g_debug_pc = 0xBEEF1518;
@@ -1701,9 +1699,9 @@ void ptx_thread_info::ptx_exec_inst( warp_inst_t &inst, unsigned lane_id)
space_type = 0 ;
break;
}
- StatAddSample( g_inst_classification_stat[m_gpu->gpgpu_ctx->func_sim->g_ptx_kernel_count], op_classification);
- if (space_type) StatAddSample( g_inst_classification_stat[m_gpu->gpgpu_ctx->func_sim->g_ptx_kernel_count], ( int )space_type);
- StatAddSample( g_inst_op_classification_stat[m_gpu->gpgpu_ctx->func_sim->g_ptx_kernel_count], (int) pI->get_opcode() );
+ StatAddSample( m_gpu->gpgpu_ctx->func_sim->g_inst_classification_stat[m_gpu->gpgpu_ctx->func_sim->g_ptx_kernel_count], op_classification);
+ if (space_type) StatAddSample( m_gpu->gpgpu_ctx->func_sim->g_inst_classification_stat[m_gpu->gpgpu_ctx->func_sim->g_ptx_kernel_count], ( int )space_type);
+ StatAddSample( m_gpu->gpgpu_ctx->func_sim->g_inst_op_classification_stat[m_gpu->gpgpu_ctx->func_sim->g_ptx_kernel_count], (int) pI->get_opcode() );
}
if ( (m_gpu->gpgpu_ctx->func_sim->g_ptx_sim_num_insn % 100000) == 0 ) {
dim3 ctaid = get_ctaid();
diff --git a/src/cuda-sim/cuda-sim.h b/src/cuda-sim/cuda-sim.h
index 6177986..628e434 100644
--- a/src/cuda-sim/cuda-sim.h
+++ b/src/cuda-sim/cuda-sim.h
@@ -44,8 +44,6 @@ class symbol_table;
extern const char *g_gpgpusim_version_string;
extern int g_debug_execution;
extern int g_debug_thread_uid;
-extern void ** g_inst_classification_stat;
-extern void ** g_inst_op_classification_stat;
extern void print_splash();
extern void gpgpu_ptx_sim_memcpy_symbol(const char *hostVar, const void *src, size_t count, size_t offset, int to, gpgpu_t *gpu );
@@ -134,6 +132,8 @@ class cuda_sim {
g_ptx_kernel_count = -1; // used for classification stat collection purposes
gpgpu_param_num_shaders = 0;
g_cuda_launch_blocking = false;
+ g_inst_classification_stat = NULL;
+ g_inst_op_classification_stat= NULL;
gpgpu_ctx = ctx;
}
//global variables
@@ -159,6 +159,8 @@ class cuda_sim {
unsigned gpgpu_param_num_shaders;
class std::map<function_info*,rec_pts> g_rpts;
bool g_cuda_launch_blocking;
+ void ** g_inst_classification_stat;
+ void ** g_inst_op_classification_stat;
// backward pointer
class gpgpu_context* gpgpu_ctx;
//global functions
diff --git a/src/gpgpu-sim/gpu-sim.cc b/src/gpgpu-sim/gpu-sim.cc
index 30e0aa5..30411f1 100644
--- a/src/gpgpu-sim/gpu-sim.cc
+++ b/src/gpgpu-sim/gpu-sim.cc
@@ -1201,8 +1201,8 @@ void gpgpu_sim::gpu_print_stat()
insn_warp_occ_print(stdout);
}
if ( gpgpu_ptx_instruction_classification ) {
- StatDisp( g_inst_classification_stat[gpgpu_ctx->func_sim->g_ptx_kernel_count]);
- StatDisp( g_inst_op_classification_stat[gpgpu_ctx->func_sim->g_ptx_kernel_count]);
+ StatDisp( gpgpu_ctx->func_sim->g_inst_classification_stat[gpgpu_ctx->func_sim->g_ptx_kernel_count]);
+ StatDisp( gpgpu_ctx->func_sim->g_inst_op_classification_stat[gpgpu_ctx->func_sim->g_ptx_kernel_count]);
}
#ifdef GPGPUSIM_POWER_MODEL