cuPrintf

I am trying to debug my code with cuPrintf and am having problems getting it to work.

I don’t know how to apply the instructions from the dev portal to my application…

in the file “gpu.cu” i have

#include “cuPrintf.cu”

void main()
{
cudaPrintfInit();
kernel <<< grid, block >>> (…)
cudaPrintfDisplay(stdout, true);
cudaPrintfEnd();
}

then in the file “gpu_kernel.cu” i have


global void kernel(…)
{

int y = 10;
cuPrintf(“%d\n”, y);

}

but i get the build error “identifier “cuPrintf” is undefined”

but i can’t include it in gpu_kernel.cu because then i’m including the file twice… any suggestions? have i missed another forum link about this topic?

thanks

how about including it in gpu_kernel.cu and removing it from the gpu.cu?