summaryrefslogtreecommitdiff
path: root/debug_tools
diff options
context:
space:
mode:
authorJonathan <[email protected]>2018-07-09 15:02:24 -0700
committerJonathan <[email protected]>2018-07-09 15:02:24 -0700
commitdd4728921136fa5f3a2e6c9591eed852ba871cb2 (patch)
tree0ad7a4183ce5e2daf4555b314d05bbb3b34082c2 /debug_tools
parent47394dbbaf497b0d3b67b900e2f7f72371a701a8 (diff)
fixed pointer bug in ptx jit and added support for executing ptxjitconfig when running ptxjit
Diffstat (limited to 'debug_tools')
-rw-r--r--debug_tools/WatchYourStep/ptxjitplus/ptxjitplus.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/debug_tools/WatchYourStep/ptxjitplus/ptxjitplus.cpp b/debug_tools/WatchYourStep/ptxjitplus/ptxjitplus.cpp
index 1f094ba..68964d8 100644
--- a/debug_tools/WatchYourStep/ptxjitplus/ptxjitplus.cpp
+++ b/debug_tools/WatchYourStep/ptxjitplus/ptxjitplus.cpp
@@ -254,11 +254,12 @@ int main(int argc, char **argv)
int paramOffset = 0;
for( size_t i = 0; i<param_data.size(); i++){
if(param_info[i].second){
- unsigned char *d_data = 0;
- checkCudaErrors(cudaMalloc((void**)&d_data, param_info[i].first));
- checkCudaErrors(cudaMemcpy((void*)d_data,(void*)param_data[i],param_info[i].first,cudaMemcpyHostToDevice));
- checkCudaErrors(cuParamSetv(hKernel, paramOffset, &d_data, sizeof(d_data)));
- m_device_data[i]=d_data;
+ unsigned char **d_data = (unsigned char **) malloc(sizeof(unsigned char **));
+ *d_data = (unsigned char *) malloc(sizeof(unsigned char *));
+ checkCudaErrors(cudaMalloc((void**)d_data, param_info[i].first));
+ checkCudaErrors(cudaMemcpy((void*)*d_data,(void*)param_data[i],param_info[i].first,cudaMemcpyHostToDevice));
+ checkCudaErrors(cuParamSetv(hKernel, paramOffset, d_data, sizeof(*d_data)));
+ m_device_data[i]=*d_data;
paramOffset += 8;
}else{
checkCudaErrors(cuParamSetv(hKernel, paramOffset, param_data[i], param_info[i].first));