title: "invalid configuration argument " error for the call of CUDA kernel?
body: <p>Here is my code:</p>
  
  <pre><code>int threadNum = BLOCKDIM/8;
  dim3 dimBlock(threadNum,threadNum);
  int blocks1 = nWidth/threadNum + (nWidth%threadNum == 0 ? 0 : 1);
  int blocks2 = nHeight/threadNum + (nHeight%threadNum == 0 ? 0 : 1);
  dim3 dimGrid;
  dimGrid.x = blocks1;
  dimGrid.y = blocks2;
  
  //  dim3 numThreads2(BLOCKDIM);
  //  dim3 numBlocks2(numPixels/BLOCKDIM + (numPixels%BLOCKDIM == 0 ? 0 : 1) );
  perform_scaling&lt;&lt;&lt;dimGrid,dimBlock&gt;&gt;&gt;(imageDevice,imageDevice_new,min,max,nWidth, nHeight);
  cudaError_t err = cudaGetLastError();
  cudasafe(err,"Kernel2");
  </code></pre>
  
  <p>This is the execution of my second kernel and it is fully independent in term of the usage of data. <code>BLOCKDIM</code> is 512 , <code>nWidth and nHeight</code> are 512 too and <code>cudasafe</code> simply prints the corresponding string message of the error code. This section of the code gives configuration error just after the kernel call.</p>
  
  <p>What might give this error, any idea?</p>