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?
Asked
Active
Viewed 1,169 times
5
-
2http://wiki.tiker.net/UsingPrintf – talonmies Aug 10 '12 at 17:02
-
But is there any way with cuPrintf.h? – username_4567 Aug 10 '12 at 17:16
-
@talonmies Doesn't work out of the box on a Tesla C2070. Any ideas as to why? – user2398029 Nov 07 '12 at 00:01
-
Updated link: http://wiki.tiker.net/PyCuda/Examples/UsingPrintf. In short, #include
and then use printf(). – Ahmed Fasih Feb 01 '13 at 12:28
1 Answers
5
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.

harrism
- 26,505
- 2
- 57
- 88