【问题标题】:Print messages in PyCUDA在 PyCUDA 中打印消息
【发布时间】:2015-02-20 02:06:08
【问题描述】:

在简单的 CUDA 程序中,我们可以通过包含 cuPrintf.h 来按线程打印消息,但是在 PyCUDA 中这样做并没有在任何地方解释。如何在 PyCUDA 中做到这一点?

【问题讨论】:

标签: cuda pycuda


【解决方案1】:

在 Compute Capability 2.0 及更高版本的 GPU 上,cuPrintf.h 不鼓励使用 CUDA 的内置 printf()。要使用它,只需 #include <stdio.h> 并调用 printf() 就像在主机上一样。

PyCUDA wiki 有一个 specific example of this

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-07-31
    • 1970-01-01
    • 2016-11-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-10
    相关资源
    最近更新 更多