summaryrefslogtreecommitdiff
path: root/debug_tools/WatchYourStep/ptxjitplus/ptxjitplus.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'debug_tools/WatchYourStep/ptxjitplus/ptxjitplus.cpp')
-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));