C++17 并行算法是否已经实现?

Are C++17 Parallel Algorithms implemented already?(C++17 并行算法是否已经实现?)

本文介绍了C++17 并行算法是否已经实现?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图尝试使用 C++17 标准中提出的新并行库功能,但我无法让它工作.我尝试使用 g++ 8.1.1clang++-6.0-std=c++17 的最新版本进行编译,但似乎都不支持 #include std::execution::par 或任何类似的东西.

I was trying to play around with the new parallel library features proposed in the C++17 standard, but I couldn't get it to work. I tried compiling with the up-to-date versions of g++ 8.1.1 and clang++-6.0 and -std=c++17, but neither seemed to support #include <execution>, std::execution::par or anything similar.

在查看并行算法的 cppreference 时,有一长串算法,声称

When looking at the cppreference for parallel algorithms there is a long list of algorithms, claiming

技术规范提供了来自algorithmnumericmemory的以下69种算法的并行版本:( ... long list...)

Technical specification provides parallelized versions of the following 69 algorithms from algorithm, numeric and memory: ( ... long list ...)

听起来算法已经纸上",但还没有准备好使用?

which sounds like the algorithms are ready 'on paper', but not ready to use yet?

在这个SO问题中一年前,答案声称这些功能尚未实现.但到现在为止,我本来希望看到某种实现.有什么我们可以使用的吗?

In this SO question from over a year ago the answers claim these features hadn't been implemented yet. But by now I would have expected to see some kind of implementation. Is there anything we can use already?

推荐答案

可以参考https://en.cppreference.com/w/cpp/compiler_support 检查所有 C++ 功能实现状态.对于您的情况,只需搜索Standardization of Parallelism TS",您会发现现在只有 MSVCIntel C++ 编译器支持此功能.

You can refer https://en.cppreference.com/w/cpp/compiler_support to check all C++ feature implementation status. For your case, just search "Standardization of Parallelism TS", and you will find only MSVC and Intel C++ compilers support this feature now.

这篇关于C++17 并行算法是否已经实现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:C++17 并行算法是否已经实现?

基础教程推荐