gpgpu 在 cuda 和 opengl 上
我最近一直在使用 CUDA。我只是想知道 CUDA 和 Opengl 在通用计算方面是否有任何性能差异。我目前正在开发 GTX 580。
I have been working with CUDA recently. I am just wondering if there is any performance difference between CUDA and Opengl in terms of general purpose computing. I am currently working on a GTX 580.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正确的答案可能是“视情况而定”。
在纯浮点或整数性能方面,无论您使用 GLSL 还是更“现代”的东西都没有多大关系,但 CUDA 和 OpenCL 公开了硬件功能,如指针、共享内存、线程之间的通信和同步以及网格/块虚拟化计算域的数量对于在计算工作负载上实现良好的性能至关重要。有许多算法在着色器语言中很难或不可能实现,但在 OpenCL 或 CUDA 中只需几行代码即可有效实现。
The correct answer is probably "it depends".
In pure floating point or integer performance terms it shouldn't matter much whether you use GLSL or something more "modern", but CUDA and OpenCL expose hardware features like pointers, shared memory, communication and synchronization between threads, and the grid/block virtualization of compute domains which are pretty crucial to achieving good performance on compute workloads. There are lots of algorithms which would be either difficult or impossible to implement in shader language that are efficiently implemented in literally a handful of lines of code in OpenCL or CUDA.