5
votes

In simple CUDA programs we can print messages by threads by including cuPrintf.h but doing this in PyCUDA is not explained anywhere. How to do this in PyCUDA?

1
But is there any way with cuPrintf.h?username_4567
@talonmies Doesn't work out of the box on a Tesla C2070. Any ideas as to why?user2398029
Updated link: wiki.tiker.net/PyCuda/Examples/UsingPrintf. In short, #include <stdio.h> and then use printf().Ahmed Fasih

1 Answers

5
votes

On Compute Capability 2.0 and later GPUs, cuPrintf.h is discouraged in favor of just using CUDA's built-in printf(). To use it, just #include <stdio.h> and call printf() just like on the host.

The PyCUDA wiki has a specific example of this.