我如何找到“parallel for”的实现?
我想确切地知道 omp parallel for
和其他类似结构发生了什么。我如何找到这些是如何实施的?了解这一点的人的简短总结会很棒。谢谢。
I would like to know exactly what is going on with omp parallel for
and other similiar constructs. How do I find how these are implemented? A short summary of someone who knows about this would be great. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如您所知,OpenMP 是在编译器内部实现的,因为它转换代码并生成并行代码。如果您想了解内部实现工作,请阅读这篇文章解释了英特尔编译器 OpenMP 实现的详细信息。
当然,您可以浏览gcc的OpenMP实现,例如libgomp中的omp-low.c。
As you know, OpenMP is implemented inside of a compiler because it transforms code and generates parallelized code. If you want to know the inside implementation work, then please read this article that explains quite details of Intel compiler's OpenMP implementation.
Of course, you may browse gcc's OpenMP implementation such as omp-low.c in libgomp.
Open MP 只是一个规范,供应商选择如何实现它取决于他们。话虽这么说,GCC 使用的库是开源的,Intel 的 Thread 构建块也是开源的,它有一个并行的 for,只是不是作为编译指示,但它的实现是您想要的
Open MP is merely a spec, how a vendor chooses to implement it is up to them. that being said, the libraries GCC uses are open source, so is Intels Thread building blocks, which has a parallel for, just not as a pragma, but its implementation is what your after
http://www.compunity.org/futures/omp-api.html
http://www.compunity.org/futures/omp-api.html