Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Print messages in PyCUDA

Tags:

cuda

pycuda

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?

like image 895
username_4567 Avatar asked Aug 10 '12 16:08

username_4567


1 Answers

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.

like image 164
harrism Avatar answered Oct 06 '22 13:10

harrism