Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用 c++ 在 windows 中制作了项目,现在我正在尝试在 linux(ubunt) 中构建我的项目。但是,我在 linux 中找不到 ppl.h。我在我的项目中使用了很多 parallel_for。
我可以使用什么替代品?
并行模式库仅适用于 Windows。它对可移植应用程序没有用,它被认为是PPL的最佳替代方案。即并行您可以使用以下内容:
#ifdef _OPENMP #pragma omp parallel for #endif // _OPENMP for(std::size_t i=0; i < foo; i++) { bar[i] = (baz[i] * quux[i]); }
要启用 OpenMP -fopenmp,请为 G++ 添加标志。
-fopenmp
PS。