如何通过并行化来缩短计算时间
我编写了一个 C++ 代码(使用 STL),由于计算量很大,大约需要一小时才能输出。我检查了 GPU 和 CPU 上的并行化。我有一个 ATI 显卡和一个酷睿 i7 处理器。我应该在哪一个上并行以获得更好的结果。 另外,您能否建议阅读有关如何设置编译器以在任何这些平台上进行并行化以及如何开始并行化的材料
I have written a c++ code (using STL) and due to large computations it takes about one hour for the output to come. I checked on parallelizing on GPU and CPU. I have a ATI graphics card and a core i7 processor. On which one should i parallelize for better results.
Also can you please suggest reading material on how to set up my compiler for parallelizing on any of these platforms and how do i start parallelizing
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于有关多核/GPU 编程的通用库:
英特尔线程构建模块,通常 ,这个领域绝对是广阔的,没有答案可以公正地描述这个主题。实现并行化的方法有很多,首先分析逻辑并查找可以有效并行计算的部分,然后围绕这些结果设计(或重新设计)算法。
For general libraries regarding multi-core/GPU programming:
in general, this area is absolutely vast, and no answer can make justice of the topic. There are many ways to approach parallelization, and that begins with analysing your logic and looking in parts that can be efficiently computed in parallel, and design (or redesign) your algorithms around those results.
您还可以考虑使用 OpenCL (及其图形卡的 ATI Stream 实现)重新编码您的数字内核。
You could also consider recoding your numerical kernels using OpenCL (and its ATI Stream implementation for your graphical card).