diff options
| author | Mahmoud <[email protected]> | 2020-05-23 20:06:25 -0400 |
|---|---|---|
| committer | Mahmoud <[email protected]> | 2020-05-23 20:06:25 -0400 |
| commit | d610fd81420979e956bf37100f7e1c7f1d153831 (patch) | |
| tree | 392a841f21fec5136339ff36ad9b5c7b1b4cb480 /src/cuda-sim/cuda_device_runtime.h | |
| parent | 6cedd3ef4973f3785757413db89a7c5d0ee2b58b (diff) | |
| parent | e9e9fcf5957530ecb927aecb5ea238e4b78a4f45 (diff) | |
Merge branch 'dev' of https://github.com/purdue-aalp/gpgpu-sim_distribution into dev-traces
Diffstat (limited to 'src/cuda-sim/cuda_device_runtime.h')
| -rw-r--r-- | src/cuda-sim/cuda_device_runtime.h | 91 |
1 files changed, 45 insertions, 46 deletions
diff --git a/src/cuda-sim/cuda_device_runtime.h b/src/cuda-sim/cuda_device_runtime.h index 9647730..4ede31a 100644 --- a/src/cuda-sim/cuda_device_runtime.h +++ b/src/cuda-sim/cuda_device_runtime.h @@ -1,68 +1,67 @@ #ifndef __cuda_device_runtime_h__ #define __cuda_device_runtime_h__ -//Jin: cuda_device_runtime.h -//Defines CUDA device runtime APIs for CDP support +// Jin: cuda_device_runtime.h +// Defines CUDA device runtime APIs for CDP support class device_launch_config_t { + public: + device_launch_config_t() {} -public: - device_launch_config_t() {} - - device_launch_config_t(dim3 _grid_dim, - dim3 _block_dim, - unsigned int _shared_mem, - function_info * _entry): - grid_dim(_grid_dim), - block_dim(_block_dim), - shared_mem(_shared_mem), - entry(_entry) {} - - dim3 grid_dim; - dim3 block_dim; - unsigned int shared_mem; - function_info * entry; + device_launch_config_t(dim3 _grid_dim, dim3 _block_dim, + unsigned int _shared_mem, function_info* _entry) + : grid_dim(_grid_dim), + block_dim(_block_dim), + shared_mem(_shared_mem), + entry(_entry) {} + dim3 grid_dim; + dim3 block_dim; + unsigned int shared_mem; + function_info* entry; }; class device_launch_operation_t { + public: + device_launch_operation_t() {} + device_launch_operation_t(kernel_info_t* _grid, CUstream_st* _stream) + : grid(_grid), stream(_stream) {} -public: - device_launch_operation_t() {} - device_launch_operation_t(kernel_info_t *_grid, - CUstream_st * _stream) : - grid(_grid), stream(_stream) {} - - kernel_info_t * grid; //a new child grid - - CUstream_st * stream; + kernel_info_t* grid; // a new child grid + CUstream_st* stream; }; class gpgpu_context; class cuda_device_runtime { - public: - cuda_device_runtime( gpgpu_context* ctx ) { - g_total_param_size = 0; - g_max_total_param_size = 0; - gpgpu_ctx = ctx; - } - unsigned long long g_total_param_size; - std::map<void *, device_launch_config_t> g_cuda_device_launch_param_map; - std::list<device_launch_operation_t> g_cuda_device_launch_op; - unsigned g_kernel_launch_latency; + public: + cuda_device_runtime(gpgpu_context* ctx) { + g_total_param_size = 0; + g_max_total_param_size = 0; + gpgpu_ctx = ctx; + } + unsigned long long g_total_param_size; + std::map<void*, device_launch_config_t> g_cuda_device_launch_param_map; + std::list<device_launch_operation_t> g_cuda_device_launch_op; + unsigned g_kernel_launch_latency; unsigned g_TB_launch_latency; - unsigned long long g_max_total_param_size; - bool g_cdp_enabled; + unsigned long long g_max_total_param_size; + bool g_cdp_enabled; - // backward pointer - class gpgpu_context* gpgpu_ctx; + // backward pointer + class gpgpu_context* gpgpu_ctx; #if (CUDART_VERSION >= 5000) #pragma once - void gpgpusim_cuda_launchDeviceV2(const ptx_instruction * pI, ptx_thread_info * thread, const function_info * target_func); - void gpgpusim_cuda_streamCreateWithFlags(const ptx_instruction * pI, ptx_thread_info * thread, const function_info * target_func); - void gpgpusim_cuda_getParameterBufferV2(const ptx_instruction * pI, ptx_thread_info * thread, const function_info * target_func); - void launch_all_device_kernels(); - void launch_one_device_kernel(); + void gpgpusim_cuda_launchDeviceV2(const ptx_instruction* pI, + ptx_thread_info* thread, + const function_info* target_func); + void gpgpusim_cuda_streamCreateWithFlags(const ptx_instruction* pI, + ptx_thread_info* thread, + const function_info* target_func); + void gpgpusim_cuda_getParameterBufferV2(const ptx_instruction* pI, + ptx_thread_info* thread, + const function_info* target_func); + void launch_all_device_kernels(); + void launch_one_device_kernel(); #endif }; |
