I tried to print values of parameters. I use kernel as follow:
-------------------------test.cu-----------------------------------
#include <stdio.h>
__global__ void kernel()
{
int x = threadIdx.x;
int y = threadIdx.y;
printf("x = %d, y = %d.\n", x, y);
}
int main()
{
dim3 dimBlock(32, 3, 1);
dim3 dimGrid(1, 0, 0);
kernel<<<dimGrid, dimBlock>>>();
cudaDeviceSynchronize();
return 0;
}
Compiled code like this:
nvcc x.cu -arch=sm_35
The program printed nothing.
I used K20m + CUDA 5.5 + SLES11 SP2.
BTW: I found the printf can work fine in 1D blocks.
Why not in 2D blocks?
Thanks