简体   繁体   English

CUDA NVCC编译器-如何/ showincludes?

[英]Cuda NVCC compiler - how to /showincludes?

I need to show all the includes (in the order they are included) in the Output window of Visual Studio to find out which file produced some obscure error. 我需要在Visual Studio的“输出”窗口中显示所有包含(以包含它们的顺序),以找出哪个文件产生了一些模糊的错误。

But can't find a way to enable "/showincludes" when compiling a project in Visual Studio for Cuda. 但是找不到在Visual Studio for Cuda中编译项目时启用“ / showincludes”的方法。 It uses NVCC, which seems to lack this option. 它使用NVCC,似乎缺少此选项。

There is an option in ProjectSettings -> C/C++ -> Advanced ->Show all includes. 在ProjectSettings-> C / C ++-> Advanced-> Show all includes中有一个选项。

However, this option is missing in ProjectSettings -> Cuda C/C++" 但是,ProjectSettings-> Cuda C / C ++中缺少此选项”

Is there a way to enable it? 有办法启用它吗?

I found a similar post from 2018 but it has no answer. 从2018年发现了类似的帖子,但没有答案。

nvcc supports the -M and -MM options which, when no dependency output file is specified, will print the includes to stdout. nvcc支持-M-MM选项,当未指定依赖项输出文件时,这些选项将把includes打印到stdout。

The Visual Studio integration doesn't really have a switch for that, but you should be able to specify it in the Additional Options in the Command Line category of the CUDA C/C++ project properties… Visual Studio集成并没有真正的开关,但是您应该能够在CUDA C / C ++项目属性的“命令行”类别中的“其他选项”中指定它……

You can pass any compiler flag through to the underlying host compiler via -Xcompiler <flag> . 您可以通过-Xcompiler <flag>将任何编译器标志传递给基础主机编译器。
Thus -Xcompiler /showincludes should do. 因此, -Xcompiler /showincludes应该可以。

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

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