cuprintf help launching from kernel

Hi. I’m trying to use cuprintf in a setup where I have multiple files. a “main” file, and the function files… so I’ve made this small setup here. But I can’t seem to figure out how to import cuprintf.cu or cuprintf.cuh corretly .

Anyone having an idea on where I go wrong ?

KG.

The files are as follows

//test.cu

#include "cuPrintf.cuh"

extern "C" void launch_kernel ();

int main() {

cudaPrintfInit();

cudaPrintfDisplay(NULL, true);

cudaPrintfEnd();

return 0;

}

//test_kernels.cu

#include "cuPrintf.cu"

__global__ void testKernel(int val) { cuPrintf("Value is: %d\n", val); }

extern "C" void launch_kernel () {testKernel<<< 2, 3 >>>(10); }

I think you just import cuPrintf.cuh from your .cu file that uses it.

unfortunally…

then it gives me an

test/test_kernels.cu(7): Error: External calls are not supported (found non-inlined call to Z8cuPrintfIiEiPKcT)