title: Cuda, getting error when trying to allocate memory for integer in device
body: <p>I am trying to pass in 2 2D arrays, 1 1D array and 2 integers to cudaMlloc() so that I can use it in my kernel. The 2D arrays are doubles and other is int.While the 1d array contains floats. I keep getting the error "no instance of overloaded function CudaMalloc matches the argument list.argument types are : (int,int).I dont know what I am doing wrong.
  The kernel and the way i used it is below:</p>
  
  <pre><code>__global__ void getMatrix(double** cmatrix,int** data,float* angle,int x,int y){
  
  int j = blockIdx.x * blockDim.x + threadIdx.x;
  int i = blockIdx.y * blockDim.y + threadIdx.y;
  
  int xrad,yrad;
  xrad = 0;
  yrad = 0;
  
  xrad = (int)round(cos(angle[i]) * (j+1) + x);   
  yrad = (int)round(sin(angle[i]) * (j+1) + y);   
  
  cmatrix[i][j] = (double)data[yrad-1][xrad-1];
  
  }
  </code></pre>
  
  <p>And the implementation is:</p>
  
  <pre><code>int dataFileSize = 801 * 1201 * sizeof(int);
  int cmatrixSize = ANGLESIZE * RADIUS/RADSTEP * sizeof(double);
  int xVarSize = sizeof(int);
  int yVarSize = sizeof(int);
  
  int** d_data;
  cudaMalloc(&amp;d_data,dataFileSize);
  
  double** d_cmatrix;
  cudaMalloc(&amp;d_cmatrix,cmatrixSize);
  
  float * d_angle;
  cudaMalloc(&amp;d_angle,sizeof(float) * ANGLESIZE);
  
  int *d_x;
  cudaMalloc((void**)&amp;d_x,xVarSize);
  int *d_y;
  cudaMalloc((void**)d_y,yVarSize);
  
  cudaMemcpy(d_data,data,dataFileSize,cudaMemcpyHostToDevice);
  cudaMemcpy(d_cmatrix,cmatrix,cmatrixSize,cudaMemcpyHostToDevice);
  cudaMemcpy(d_angle,angle,sizeof(float) * ANGLESIZE,cudaMemcpyHostToDevice);
  cudaMemcpy(d_x,&amp;x,xVarSize,cudaMemcpyHostToDevice);
  cudaMemcpy(d_y,&amp;y,yVarSize,cudaMemcpyHostToDevice);         
  
  const dim3 blockSize(ANGLESIZE,1,1);
  const dim3 threadSize(1,RADIUS/RADSTEP,1);
  
  getMatrix&lt;&lt;&lt;blockSize,threadSize&gt;&gt;&gt;(d_cmatrix,d_data,d_angle,d_x,d_y);
  
  cudaMemcpy(cmatrix,d_cmatrix,cmatrixSize,cudaMemcpyDeviceToHost);
  
  cudaFree(d_data);
  cudaFree(d_cmatrix);
  cudaFree(d_angle);
  cudaFree(d_x);  
  cudaFree(d_y);
  </code></pre>