CUDA、OpenCL、PGI 等等……但是 GLSL 和 Cg 发生了什么?

发布于 2024-07-23 21:58:53 字数 290 浏览 5 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

故事灯 2024-07-30 21:58:53

使用 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.

七婞 2024-07-30 21:58:53

您正在将苹果与橙子进行比较。 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.

2024-07-30 21:58:53
  • Cg/HLSL(如果您是游戏开发者)。
  • OpenCL 如果您是一位非常喜欢冒险的游戏开发者。

对于桌面上的其他人,您甚至无法保证他们拥有所需的硬件。

所有这些解决方案的未来看起来都很暗淡。 在 GPGPU 赶上桌面并融合之前,我们可能会看到至少 1 或 2 代语言。

  • Cg/HLSL if you are a game dev.
  • OpenCL if you are a very adventurous game dev.

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文