diff options
| author | Mengchi Zhang <[email protected]> | 2019-07-16 10:36:42 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-07-16 10:36:42 -0400 |
| commit | bf198b13541a427cba9bef22799955aa08ab050a (patch) | |
| tree | 4af15f4e22cb0c55450e26cb97110534148c8c60 /libcuda/gpgpu_context.h | |
| parent | 89e913f7b28e342b9023a01105cb441cfafbee8b (diff) | |
| parent | e1fa1a3cc7c509417064a8e4cdab71e3f7feb881 (diff) | |
Merge pull request #25 from echoedit/dev
Dev
Diffstat (limited to 'libcuda/gpgpu_context.h')
| -rw-r--r-- | libcuda/gpgpu_context.h | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/libcuda/gpgpu_context.h b/libcuda/gpgpu_context.h index 3c9f87c..45c5cdd 100644 --- a/libcuda/gpgpu_context.h +++ b/libcuda/gpgpu_context.h @@ -6,32 +6,51 @@ #include "../src/gpgpusim_entrypoint.h" #include "../src/cuda-sim/cuda-sim.h" #include "../src/cuda-sim/cuda_device_runtime.h" +#include "../src/cuda-sim/ptx-stats.h" class gpgpu_context { public: gpgpu_context() { g_global_allfiles_symbol_table = NULL; + sm_next_access_uid=0; + warp_inst_sm_next_uid=0; + operand_info_sm_next_uid = 1; + kernel_info_m_next_uid = 1; + g_num_ptx_inst_uid = 0; + g_ptx_cta_info_uid = 1; + symbol_sm_next_uid = 1; + function_info_sm_next_uid = 1; + debug_tensorcore = 0; api = new cuda_runtime_api(this); ptxinfo = new ptxinfo_data(this); ptx_parser = new ptx_recognizer(this); the_gpgpusim = new GPGPUsim_ctx(this); func_sim = new cuda_sim(this); -#if (CUDART_VERSION >= 5000) device_runtime = new cuda_device_runtime(this); -#endif + stats = new ptx_stats(this); } // global list symbol_table *g_global_allfiles_symbol_table; const char *g_filename; + unsigned sm_next_access_uid; + unsigned warp_inst_sm_next_uid; + unsigned operand_info_sm_next_uid;//uid for operand_info + unsigned kernel_info_m_next_uid;//uid for kernel_info_t + unsigned g_num_ptx_inst_uid; //uid for ptx inst inside ptx_instruction + unsigned long long g_ptx_cta_info_uid; + unsigned symbol_sm_next_uid; //uid for symbol + unsigned function_info_sm_next_uid; + std::vector<ptx_instruction*> s_g_pc_to_insn; // a direct mapping from PC to instruction + bool debug_tensorcore; + // objects pointers for each file cuda_runtime_api* api; ptxinfo_data* ptxinfo; ptx_recognizer* ptx_parser; GPGPUsim_ctx* the_gpgpusim; cuda_sim* func_sim; -#if (CUDART_VERSION >= 5000) cuda_device_runtime* device_runtime; -#endif + ptx_stats* stats; // member function list void cuobjdumpParseBinary(unsigned int handle); class symbol_table *gpgpu_ptx_sim_load_ptx_from_string( const char *p, unsigned source_num ); @@ -43,6 +62,9 @@ class gpgpu_context { class gpgpu_sim *gpgpu_ptx_sim_init_perf(); struct _cuda_device_id *GPGPUSim_Init(); void ptx_reg_options(option_parser_t opp); + const ptx_instruction* pc_to_instruction(unsigned pc); + const warp_inst_t *ptx_fetch_inst( address_type pc ); + unsigned translate_pc_to_ptxlineno(unsigned pc); }; gpgpu_context* GPGPU_Context(); |
