C ++ PPL并行工作-归约类'combinable'中的max()函数 [英] c++ PPL parallel work - function max() in reduction class 'combinable'

查看:115
本文介绍了C ++ PPL并行工作-归约类'combinable'中的max()函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用并行模式库.可组合的类在openMP中扮演reduce子句的角色,并允许合并并行计算的结果.

I am using the Parallel Pattern Library. The class combinable plays the role of reduction clause in openMP, and enables to merge results from parallel calculations.

.combine(max())是否存在(顺便说一句,您能否指向某些带有带有Combine允许的操作的引用,但没有找到)?

Does .combine(max()) exists (btw, could you point at some ref with allowed operations with combine, did not find that)?

感谢和问候.

推荐答案

是的,您可以将std::max传递给combineable::combine,在将模板函数作为谓词传递时必须考虑的一件事是命名类型:

Yes, you can pass std::max to combineable::combine, one thing you have to take into account when passing template functions as predicates is that you have to explicitly name the type:

combineable<T> max;

// .. do processing

max.combine(std::max<T>);

您可以找到有关combine的所有官方MSDN文档(以及所有其他PPL内容)

You can find all the official MSDN docs about combine (and all the other PPL stuff) here.

这篇关于C ++ PPL并行工作-归约类'combinable'中的max()函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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