summaryrefslogtreecommitdiff
path: root/src/cuda-sim/instructions.cc
diff options
context:
space:
mode:
authorJin Wang <[email protected]>2014-10-13 18:58:37 -0400
committerJin Wang <[email protected]>2016-07-05 08:59:56 -0400
commit70e02ee5283cb96f0edcb46a15edf0ab6e1d0697 (patch)
treea8dfbc20db8de2d4f63a1301367123cf8a7c0784 /src/cuda-sim/instructions.cc
parentdb5fe9600dd57ce59864b0f22c9d5407231ab5b1 (diff)
ADD: add cudaGetParameterBufferV2 and add cudaLaunchDeviceV2 implementation. Kernel launch to stream not yet implemented
Diffstat (limited to 'src/cuda-sim/instructions.cc')
-rw-r--r--src/cuda-sim/instructions.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/cuda-sim/instructions.cc b/src/cuda-sim/instructions.cc
index 254427b..1c47ad3 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;
@@ -149,8 +152,7 @@ ptx_reg_t ptx_thread_info::get_operand_value( const operand_info &op, operand_in
} else if ( op.is_local() ) {
result.u64 = op.get_symbol()->get_address();
} else if ( op.is_function_address() ) {
- result.u64 = op.get_symbol()->get_pc()->get_start_PC();
- printf("Get pc for kernel function %u\n", op.get_symbol()->get_pc()->get_start_PC());
+ 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 );
@@ -1411,12 +1413,14 @@ void call_impl( const ptx_instruction *pI, ptx_thread_info *thread )
gpgpusim_cuda_vprintf(pI, thread, target_func);
return;
}
+
+ //Jin: handle device runtime apis for CDP
else if(fname == "cudaGetParameterBufferV2") {
- printf("calling cudaGetParameterBufferV2\n");
+ gpgpusim_cuda_getParameterBufferV2(pI, thread, target_func);
return;
}
else if(fname == "cudaLaunchDeviceV2") {
- printf("calling cudaLaunchDeviceV2\n");
+ gpgpusim_cuda_launchDeviceV2(pI, thread, target_func);
return;
}