在PyCUDA中打印消息 [英] Print messages in PyCUDA

查看:302
本文介绍了在PyCUDA中打印消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在简单的CUDA程序中,我们可以通过包括cuPrintf.h的线程来打印消息,但在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?

推荐答案

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

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.

PyCUDA wiki有一个具体示例这

The PyCUDA wiki has a specific example of this.

这篇关于在PyCUDA中打印消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆