“invalid configuration argument ” error for the call of CUDA kernel?

后端 未结 2 1751
悲哀的现实
悲哀的现实 2020-12-01 15:59

Here is my code:

int threadNum = BLOCKDIM/8;
dim3 dimBlock(threadNum,threadNum);
int blocks1 = nWidth/threadNum + (nWidth%threadNum == 0 ? 0 : 1);
int blocks         


        
2条回答
  •  醉话见心
    2020-12-01 16:20

    Just to add to the previous answers, you can find the max threads allowed in your code also, so it can run in other devices without hard-coding the number of threads you will use:

    struct cudaDeviceProp properties;
    cudaGetDeviceProperties(&properties, device);
    cout<<"using "<

提交回复
热议问题