CUDA 项目结构

发布于 2024-09-24 17:07:46 字数 290 浏览 0 评论 0原文

CUDA SDK(版本 3.1)中的模板和 cppIntegration 示例使用 Extern 将函数调用从主机代码链接到设备代码。

但是,Tom 的评论此处表明不推荐使用 extern。

如果是这种情况,CUDA 项目的正确结构(例如模板示例或 cppIntegration 示例)是什么?

The template and cppIntegration examples in the CUDA SDK (version 3.1) use Externs to link function calls from the host code to the device code.

However, Tom's comment here indicates that the usage of extern is deprecated.

If this the case, what's the correct structure for a CUDA project such as the template example or cppIntegration example?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

左岸枫 2024-10-01 17:07:46

取决于您的主机代码是什么。如果您最终混合使用 C 和 C++,您仍然需要外部程序。有关详细信息,请参阅本指南

更新:上述链接的内容已移至[此处] (https:// /isocpp.org/wiki/faq/mixing-c-and-cpp)。

Depends what your host code is. If you end up mixing C and C++ you still need the externs. For details see this guide.

Update: the content from the above link has been moved [here] (https://isocpp.org/wiki/faq/mixing-c-and-cpp).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文