金陆 <ret...@eyou.com> writes:

> I am using an old PC with an old GPU card(GeForce 9800 GT).
> As you may know, 9800 does not support "printf" function in device code. 
> However, Nvidia supplies cuPrintf. In CU file, it can be used like following. 
> The situation is how can I use  "cudaPrintfInit, cudaPrintfDisplay and 
> cudaPrintfEnd" in Python code?
> Thanks
>
> [cu starts]
> #include "cuPrintf.cu"
> __global__ void my_kernel()
> {
>     cuPrintf("x=%u, y=%u, offset=%u\t", x, y, offset);
> } 
>
> int main()
> {
>     cudaPrintfInit();
>    
>     my_kernel<<<...>>>();
>    
>     cudaPrintfDisplay(stdout, true);
>     cudaPrintfEnd();
> }

It looks like cudaPrintf() is a library for the so-called 'runtime'
interface to CUDA. PyCUDA uses what's called the 'driver' interface.
It's not impossible that you'll be able to get this to work, but I'm not
promising it will be easy.

Andreas

Attachment: pgpeYXu_6pIMi.pgp
Description: PGP signature

_______________________________________________
PyCUDA mailing list
PyCUDA@tiker.net
http://lists.tiker.net/listinfo/pycuda

Reply via email to