问题描述
我正在使用并行模式库.可组合的类在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()函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!