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 or cuprintf.cuh corretly .

Anyone having an idea on where I go wrong ?


The files are as follows


#include "cuPrintf.cuh"

extern "C" void launch_kernel ();

int main() {


cudaPrintfDisplay(NULL, true);


return 0;



#include ""

__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.


then it gives me an

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