为什么我不能访问STL并行算法? [英] Why can i not access STL parallel algorithms?

查看:79
本文介绍了为什么我不能访问STL并行算法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,

for_each有一个用算法头写的并行版本,但是这段代码是通过preproc变量禁用的。为什么?

解决方案

您好,


对于并行编程,您必须设置特定的编译器选项。看看这个:

http:// gcc.gnu.org/onlinedocs/libstdc++/manual/parallel_mode_using.html#parallel_mode.using.prereq_flags


以下是更多链接:


http://gcc.gnu.org/onlinedocs/libstdc++/manual/parallel_mode.html


http:// www .extreme.indiana.edu / hpc ++ / docs / overview / class-lib / PSTL /


https://msdn.microsoft.com/en-us/library/dd492418(VS.100).aspx


此致,Guido


for_each for example has a parallel version written in algorithm header, but that piece of code is disabled through a preproc variable. why?

解决方案

Hello,

For parallel programming you must set specific compiler options. Have a look at this: http://gcc.gnu.org/onlinedocs/libstdc++/manual/parallel_mode_using.html#parallel_mode.using.prereq_flags

Here are more links for you:

http://gcc.gnu.org/onlinedocs/libstdc++/manual/parallel_mode.html

http://www.extreme.indiana.edu/hpc++/docs/overview/class-lib/PSTL/

https://msdn.microsoft.com/en-us/library/dd492418(VS.100).aspx

Regards,Guido


这篇关于为什么我不能访问STL并行算法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆