简体   繁体   English

有关CUDA和cuPrintf的几个问题

[英]Several questions about CUDA and cuPrintf

  1. I can compile successfully my code using cuPrintf by nvcc, but cannot compile it in Visual Studio 2012 environment. 我可以使用nvcc的cuPrintf成功编译我的代码,但是不能在Visual Studio 2012环境中编译它。 It says that "volatile char *" cannot be changed to "const void *" in "cudaMemcpyToSymbol" function. 它说不能在“ cudaMemcpyToSymbol”函数中将“ volatile char *”更改为“ const void *”。

  2. cuPrintf seems doesn't work, there's no cuPrintf function executed in kernel code. cuPrintf似乎不起作用,内核代码中没有执行cuPrintf函数。

  3. How to make nvcc export pdb file? 如何使nvcc导出pdb文件?

  4. Is there any other convenient way to debug in kernel function? 还有其他方便的方法可以调试内核功能吗? I have only one laptop. 我只有一台笔记本电脑。

1st , cuPrinft is deprecated (As far as I know it has never been released) you can print data from kernel using print command, but this is a very not recommended way of debugging your kernels. 首先,不赞成使用cuPrinft(据我所知从未发布过),您可以使用print命令从内核中打印数据,但这是不建议您调试内核的方法。

2nd, You are compiling using CUDA nvcc compiler, there is no such thing pdb file in CUDA, Albeit watch the 'g' and 'G' flags, those may dramatically increase your running time. 2,您正在使用CUDA nvcc编译器进行编译,虽然CUDA中没有pdb文件,但是请注意“ g”和“ G”标志,这些标志可能会大大增加您的运行时间。

3rd, The best way to debug kernels is using visual Nsight 第三, 调试内核的最佳方法是使用可视化Nsight

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM