Hi,
This screenshot is taken from Intel oneAPI Programming Guide(pg 44).
According to the documentation, printf can be used inside the kernel code for debugging.
But when I used inside my kernel code, it shows an error 'sycl kernel cannot call undefined function'.
q.submit([&](sycl::handler& h){
h.single_task([=]() {
printf
});
});
Appreciate your help.
Thank you.
链接已复制
3 回复数
That's because you are not calling the function with right syntax. printf(...) is in cl::sycl::ext::oneapi::experimental namespace, you need to specify a namespace for an external function. I would recommend using sycl::stream for the ease of use.