I am trying to use Nsight to debug the following code:
__device__ void change(int shared[])
{
if(threadIdx.x<10)
shared[threadIdx.x]=threadIdx.x;
}
__global__ void MyK()
{
int shared[10];
change(shared);
__syncthreads();
}
I call my kernel in the main method as follows:
cudaSetDevice(1);
MyK<<<1,20>>>();
when I set a breakpoint before the change (shared), I see that the shared array is created and its values are set to 0.
when the breakpoint is set after __syncthreads (); I get "cannot resolve common name" in the debugger.
Can't pass my shared array to another device function?
source
share