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:
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.