将OpenMP更新为Visual Studio 2022中的更高版本

发布于 01-22 13:19 字数 77 浏览 3 评论 0原文

在VS22中,OpenMP仍处于2.0版。是否可以将其更新为5.0或至少3.0?我尚未设法在VS22安装程序中找到任何选项,这将允许这一点。

In VS22, OpenMP is still at version 2.0. Is it possible to update it to 5.0 or at least 3.0? I haven't managed to find any options in VS22 Installer which would allow that.

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

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

发布评论

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

评论(2

時窥 2025-01-29 13:19:02

长期以来,MSVC使用了自己的运行时,因为它仅支持2002年发布的OpenMP 2.0。由ICC)作为新的后端。您可以使用FLAG /OpenMP:LLVM启用它,旨在支持OpenMP 3.1(2011年发布)。您还可以使用FLAG /OpenMP:实验能够使用OpenMP 4.5的某些功能(尽管这是最实验性的部分,但通常是任务)。尚未支持卸载功能(例如在GPU上)。尚未计划OpenMP 5.0的支持。有关更多信息,请阅读 a>。

正如@laci在评论中指出的那样,另一种解决方案是使用Clang-Cl编译器,以便从Visual Studio中的OpenMP相对完整的支持中受益。请注意,使用Clang-CL代替默认编译器可能会导致一些不兼容(尤其是对于大型代码)。例如,Clang不支持某些C ++ 17/C ++ 20功能,例如平行STL,多态性分配器或一些先进的原子特征(与MSVC相反)。您可以获取有关每个编译器C ++功能支持的更多信息。

For a long time, MSVC used its own runtime that is completely obsolete now since it only supports OpenMP 2.0 released in 2002. Since Visual Studio 2019 version 16.9, MSCV now supports LLVM's OpenMP runtime library (libomp also used by ICC) as a new backend. You can enable it using the flag /openmp:llvm meant to support OpenMP 3.1 (released in 2011). You can also use the flag /openmp:experimental to be able to use some features of OpenMP 4.5 (typically tasks though this is the most experimental part). Offloading features (eg. on GPU) is not supported yet. The support of OpenMP 5.0 is not planed yet. For more information, please read this.

As pointed out by @Laci in the comments, an alternative solution is to use the Clang-cl compiler so to benefit from a relatively complete support of OpenMP in Visual studio. Please note that using Clang-cl instead of the default compiler can result in some incompatibility (especially for large codes). For example, Clang does not support some C++17/C++20 features like the parallel STL, polymorphic allocators or some advanced atomic features yet (as opposed to MSVC). You can get more information about the support of C++ features for each compiler here.

分開簡單 2025-01-29 13:19:02

Visual Studio 2022 (version 17.3) supports all tasking constructs and most other features from OpenMP 3.1. See related blogs: https://devblogs.microsoft.com/cppblog/category/openmp/
The support is still experimental, libomp140* runtime is not part of redist yet.
@kaiyakha: if you can please open a ticket for the compiler crash here: https://developercommunity.visualstudio.com/search?space=62&entry=problem that would be great, thank you!

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