• <i id='VhI3T'><tr id='VhI3T'><dt id='VhI3T'><q id='VhI3T'><span id='VhI3T'><b id='VhI3T'><form id='VhI3T'><ins id='VhI3T'></ins><ul id='VhI3T'></ul><sub id='VhI3T'></sub></form><legend id='VhI3T'></legend><bdo id='VhI3T'><pre id='VhI3T'><center id='VhI3T'></center></pre></bdo></b><th id='VhI3T'></th></span></q></dt></tr></i><div id='VhI3T'><tfoot id='VhI3T'></tfoot><dl id='VhI3T'><fieldset id='VhI3T'></fieldset></dl></div>
  • <small id='VhI3T'></small><noframes id='VhI3T'>

      <bdo id='VhI3T'></bdo><ul id='VhI3T'></ul>

    <legend id='VhI3T'><style id='VhI3T'><dir id='VhI3T'><q id='VhI3T'></q></dir></style></legend><tfoot id='VhI3T'></tfoot>

        为什么 nvcc 无法使用 boost::spirit 编译 CUDA 文件?

        Why does nvcc fails to compile a CUDA file with boost::spirit?(为什么 nvcc 无法使用 boost::spirit 编译 CUDA 文件?)
          <tbody id='KUKnd'></tbody>

            <bdo id='KUKnd'></bdo><ul id='KUKnd'></ul>

          • <i id='KUKnd'><tr id='KUKnd'><dt id='KUKnd'><q id='KUKnd'><span id='KUKnd'><b id='KUKnd'><form id='KUKnd'><ins id='KUKnd'></ins><ul id='KUKnd'></ul><sub id='KUKnd'></sub></form><legend id='KUKnd'></legend><bdo id='KUKnd'><pre id='KUKnd'><center id='KUKnd'></center></pre></bdo></b><th id='KUKnd'></th></span></q></dt></tr></i><div id='KUKnd'><tfoot id='KUKnd'></tfoot><dl id='KUKnd'><fieldset id='KUKnd'></fieldset></dl></div>

              <small id='KUKnd'></small><noframes id='KUKnd'>

            1. <tfoot id='KUKnd'></tfoot>

              <legend id='KUKnd'><style id='KUKnd'><dir id='KUKnd'><q id='KUKnd'></q></dir></style></legend>

                • 本文介绍了为什么 nvcc 无法使用 boost::spirit 编译 CUDA 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试将 CUDA 集成到使用 boost::spirit 的现有应用程序中.

                  I'm trying to integrate CUDA to an existing aplication wich uses boost::spirit.

                  隔离问题,我发现以下代码不能与 nvcc copile:

                  Isolating the problem, I've found out that the following code does not copile with nvcc:

                  main.cu:

                  #include <boost/spirit/include/qi.hpp>
                  int main(){
                      exit(0);
                  }
                  

                  使用 nvcc -o cudaTest main.cu 编译我得到了很多可以看到的错误 这里.

                  Compiling with nvcc -o cudaTest main.cu I get a lot of errors that can be seen here.

                  但是如果我将文件名更改为 main.cpp,然后使用 nvcc 再次编译,它就可以工作了.这里发生了什么,我该如何解决?

                  But if I change the filename to main.cpp, and compile again using nvcc, it works. What is happening here and how can I fix it?

                  推荐答案

                  nvcc 有时在编译 Boost 等复杂模板代码时会遇到麻烦,即使该代码仅在 中使用__host__ 函数.

                  nvcc sometimes has trouble compiling complex template code such as is found in Boost, even if the code is only used in __host__ functions.

                  当文件的扩展名是 .cpp 时,nvcc 不会自行解析,而是将代码转发到主机编译器,这就是为什么您会观察到不同的行为,具体取决于文件扩展名.

                  When a file's extension is .cpp, nvcc performs no parsing itself and instead forwards the code to the host compiler, which is why you observe different behavior depending on the file extension.

                  如果可能,尝试将依赖于 Boost 的代码隔离到不需要被 nvcc 解析的 .cpp 文件中.

                  If possible, try to quarantine code which depends on Boost into .cpp files which needn't be parsed by nvcc.

                  我还要确保尝试使用最近的 nvcc">CUDA 4.1.nvcc 的模板支持随着每个版本的发布而改进.

                  I'd also make sure to try the nvcc which ships with the recent CUDA 4.1. nvcc's template support improves with each release.

                  这篇关于为什么 nvcc 无法使用 boost::spirit 编译 CUDA 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How to limit the number of running instances in C++(C++中如何限制运行实例的数量)
                  Using boost::asio::async_read with stdin?(将 boost::asio::async_read 与 stdin 一起使用?)
                  How to find out what dependencies (i.e other Boost libraries) a particular Boost library requires?(如何找出特定 Boost 库需要哪些依赖项(即其他 Boost 库)?)
                  What#39;s the purpose of a leading quot;::quot; in a C++ method call(引导“::的目的是什么?在 C++ 方法调用中)
                  Boost Spirit x3: parse into structs(Boost Spirit x3:解析为结构体)
                  How boost auto-linking makes choice?(boost自动链接如何做出选择?)
                    <tbody id='KLmk9'></tbody>

                • <legend id='KLmk9'><style id='KLmk9'><dir id='KLmk9'><q id='KLmk9'></q></dir></style></legend>
                  <i id='KLmk9'><tr id='KLmk9'><dt id='KLmk9'><q id='KLmk9'><span id='KLmk9'><b id='KLmk9'><form id='KLmk9'><ins id='KLmk9'></ins><ul id='KLmk9'></ul><sub id='KLmk9'></sub></form><legend id='KLmk9'></legend><bdo id='KLmk9'><pre id='KLmk9'><center id='KLmk9'></center></pre></bdo></b><th id='KLmk9'></th></span></q></dt></tr></i><div id='KLmk9'><tfoot id='KLmk9'></tfoot><dl id='KLmk9'><fieldset id='KLmk9'></fieldset></dl></div>

                  • <bdo id='KLmk9'></bdo><ul id='KLmk9'></ul>

                      • <small id='KLmk9'></small><noframes id='KLmk9'>

                        <tfoot id='KLmk9'></tfoot>