CUDA、OpenCL、PGI 等等……但是 GLSL 和 Cg 发生了什么?
Portland Group 提供的 CUDA、OpenCL 和 GPU 选项非常有趣...结果令人印象深刻 (对于某些组,加速 125 倍)。 听起来下一波 GPGPU 工具即将主宰科学计算世界。 然而,我记得当 GLSL 和 Cg 宣布时同样的大张旗鼓。
GLSL 和 Cg 发生了什么? 支持已被取消吗? 人们还在使用 GLSL 和 GLSL 吗? 用于 GPU 上通用计算的 Cg?
CUDA, OpenCL, and the GPU options offered by the Portland Group are intriguing... Results are impresive (125-times speedup for some groups). It sounds like the next wave of GPGPU tools are poised to dominate the scientific computing world. However, I recall the same fanfare when GLSL and Cg were announced.
What ever happened to GLSL and Cg? Has support been dropped? Do people still use GLSL & Cg for general-purpose computing on GPU's?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用 Cg 或 GLSL 进行 GPGPU 的日子即将结束。 然而,它们大量用于 3D 图形,并且在可预见的未来将继续以这种方式使用。 GLSL 和 Cg 仅用于科学计算,因为它们是城里唯一的游戏。 没有其他选择可以在 GPU 上进行通用计算。
目前将 GLSL 用于 GPGPU 的唯一真正原因是与平台无关。 如果您绝对必须能够在各种 GPU 上运行您的软件,那么目前仍然是最佳选择。 不过,OpenCL 将在不久的将来改变这一现状。
科学计算转向 CUDA 和 OpenCL 等技术的原因有很多。 这些库使您可以更好地访问 GPU 硬件,并提高性能瓶颈的透明度。 这使得更容易获得 GPU 的最大性能。 CUDA 和 OpenCL 还提供了 GLSL 或 Cg 中根本不提供的功能(例如共享内存),但对于在许多算法(例如矩阵转置)中获得良好性能至关重要。 另一个原因是 CUDA 和 OpenCL 使您无需图形上下文即可访问 GPU,这使您可以远程使用计算机的 GPU 进行计算。
The days of using Cg or GLSL for GPGPU are nearly over. However, they are heavily used for 3D graphics and will continue to be used in this way for the foreseeable future. GLSL and Cg were only used for scientific computation because they were the only game in town. There was no other alternative to do general purpose computation on the GPU.
The only real reason to use GLSL for GPGPU right now is to be platform agnostic. If you absolutely must be able to run your software on a variety of GPUs, it is, for now, still the way to go. OpenCL will change this in the near future, though.
The reason that scientific computing is moving on to things like CUDA and OpenCL are many. These libraries give you better access to the GPU hardware and much more transparancy about performance bottlenecks. This makes it easier to get the maximum performance from the GPU. CUDA and OpenCL also offer features (e.g. shared memory) that are simply not available in GLSL or Cg but are crucial for getting good performance in many algorithms (e.g. matrix transpose). Another reason is that CUDA and OpenCL give you access to the GPU without needing a graphics context, which lets you, among other things, remotely use a computer's GPU for computation.
您正在将苹果与橙子进行比较。 CUDA 和 OpenCL 旨在在 GPU 上进行通用计算。 GLSL 和 Cg 是着色器语言。 它们主要用于编写着色器,而不是进行通用计算。
我不知道GLSL的实际状况,但我确实了解Cg。 我已经很多年没有使用它了,但我的朋友刚刚开发了一款新的 3D 游戏,确实使用 Cg 来编写他的着色器。 即使 Cg 背后不再有以前那样的社区和行业支持,它仍然存在,您仍然可以使用它。
You're comparing apples to oranges. CUDA and OpenCL are meant for doing general purpose computing on GPUs. GLSL and Cg are shader languages. They are primarily meant for writing shaders, not doing general purpose computing.
I don't know about the actual status of GLSL, but I do know about Cg. It's been years since I've used it, but my friend who just worked on a new 3d game, did use Cg to write his shaders. Even if there isn't the same community and industry support behind Cg that there once was, it is still out there, and you can still use it.
对于桌面上的其他人,您甚至无法保证他们拥有所需的硬件。
所有这些解决方案的未来看起来都很暗淡。 在 GPGPU 赶上桌面并融合之前,我们可能会看到至少 1 或 2 代语言。
For anyone else on the desktop you cannot even guarantee that they will have the required hardware.
The future of all of these solutions looks dim. We are likely to see at least 1 or 2 more generations of languages before GPGPU catches up to the desktop and merges.