gpt4 book ai didi

c++ - 在 Visual Studio 2017 中使用 OpenMP 3/4

转载 作者:可可西里 更新时间:2023-11-01 18:38:57 28 4
gpt4 key购买 nike

尝试使用 OpenMP 3 的功能

#pragma omp parallel for collapse(2)

在 Visual Studio 2017 中;我得到 error c3005: 'collapse' unexpected token encountered on openmp 'parallel for' directive

Visual Studio 2017 似乎只支持 OpenMP2。在 request to support OpenMP4.5 VS团队说的

We have no plans at this time.

另一个回答说

Fortunately clang-cl has become a viable alternative with OpenMP 4 support. In the worst case you can still enable the /fallback option.

如何将 clang-cl 与 Visual Studio 2017 一起使用以及回退选项是什么?

最佳答案

更新:集成得到改进,您现在甚至可以通过 VS 安装程序安装它。他们还致力于/MP 支持。


您可以从 http://llvm.org/builds/ 获取 clang-cl

但是您可能会遇到从 VS2017 开始的集成问题:

/fallback 是一个 clang-cl 选项,如果它自己无法编译某些东西,它会回退到 Microsoft 的编译器。


但请记住,不支持/MP hack:http://clang-developers.42468.n3.nabble.com/clang-windows-clang-cl-support-for-MP-tp4045651p4045659.html

关于c++ - 在 Visual Studio 2017 中使用 OpenMP 3/4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43318137/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com