summaryrefslogtreecommitdiff
path: root/src/cuda-sim/instructions.cc
diff options
context:
space:
mode:
authorgpgpu-sim <[email protected]>2016-09-05 17:02:04 -0700
committerGitHub <[email protected]>2016-09-05 17:02:04 -0700
commitbab2a234abfadc50cb14dadb01c10595ce6ad1ef (patch)
tree50b0af6609d308635c8c837b3b838b99517cc286 /src/cuda-sim/instructions.cc
parentc9852bfe00b508644e894c1ebc34d90081d907c5 (diff)
parent0421e45d3f8796bc9bf1ff3b62c05173f7862463 (diff)
Merge pull request #28 from jwang323/cdp_clean
Initial support of CUDA Dynamic Parallelism on GPGPUSim
Diffstat (limited to 'src/cuda-sim/instructions.cc')
-rw-r--r--src/cuda-sim/instructions.cc23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/cuda-sim/instructions.cc b/src/cuda-sim/instructions.cc
index 7b0f4fa..b7a4a99 100644
--- a/src/cuda-sim/instructions.cc
+++ b/src/cuda-sim/instructions.cc
@@ -41,6 +41,9 @@
#include "../gpgpu-sim/gpu-sim.h"
#include "../gpgpu-sim/shader.h"
+//Jin: include device runtime for CDP
+#include "cuda_device_runtime.h"
+
#include <stdarg.h>
unsigned ptx_instruction::g_num_ptx_inst_uid=0;
@@ -148,6 +151,8 @@ ptx_reg_t ptx_thread_info::get_operand_value( const operand_info &op, operand_in
result.u64 = op.get_symbol()->get_address();
} else if ( op.is_local() ) {
result.u64 = op.get_symbol()->get_address();
+ } else if ( op.is_function_address() ) {
+ result.u64 = (size_t)op.get_symbol()->get_pc();
} else {
const char *name = op.name().c_str();
printf("GPGPU-Sim PTX: ERROR ** get_operand_value : unknown operand type for %s\n", name );
@@ -1482,7 +1487,23 @@ void call_impl( const ptx_instruction *pI, ptx_thread_info *thread )
if( fname == "vprintf" ) {
gpgpusim_cuda_vprintf(pI, thread, target_func);
return;
- }
+ }
+
+#if (CUDART_VERSION >= 5000)
+ //Jin: handle device runtime apis for CDP
+ else if(fname == "cudaGetParameterBufferV2") {
+ gpgpusim_cuda_getParameterBufferV2(pI, thread, target_func);
+ return;
+ }
+ else if(fname == "cudaLaunchDeviceV2") {
+ gpgpusim_cuda_launchDeviceV2(pI, thread, target_func);
+ return;
+ }
+ else if(fname == "cudaStreamCreateWithFlags") {
+ gpgpusim_cuda_streamCreateWithFlags(pI, thread, target_func);
+ return;
+ }
+#endif
// read source arguements into register specified in declaration of function
arg_buffer_list_t arg_values;