Print messages in PyCUDA

不想你离开。 提交于 2019-12-12 11:09:56

问题


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.



来源:https://stackoverflow.com/questions/11905841/print-messages-in-pycuda

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!