GPU编程

发布于 2024-11-01 06:24:04 字数 225 浏览 4 评论 0原文

我想做一些 GPU 编程。到这里怎么走?我想学习一些“开放”、跨平台和“更高”的语言。我不想只局限于 GPU 供应商,也不想局限于操作系统、平台等。

我的选择是什么? Cuda、OpenCL、OpenMP 还是其他?他们的优点/缺点是什么?

G/HLSL 和 PhysX 怎么样?

我正在考虑进行“通用”编程,一些数学,数字运算,模拟等。也许会吐出一些漂亮的图形,但不是专门的图形编程。

I want to do some GPU programming. What's the way to go here? I want to learn something that is "open" , cross platform and a "higher" language. I don't want to be lock into just GPU vendor nor OS, platform, etc.

What are my choices here? Cuda, OpenCL, OpenMP, other? What's the pros/cons for them?

What about G/HLSL and PhysX?

I'm looking at doing "general purpose" programming, some math, number crunching, simulations, etc. Maybe spit out some pretty graphics, but not specifically graphics programming.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(6

↘人皮目录ツ 2024-11-08 06:24:04

标记为正确的答案现在已过时且不正确。特别是 OpenMP 4.0 支持 GPU 加速。

The answer marked correct is now outdated and incorrect. In particular OpenMP 4.0 supports GPU acceleration.

葬﹪忆之殇 2024-11-08 06:24:04

OpenMP仅是cpu,但易于实现,CUDA基本上仅是GPU。 Ati Stream 支持两者,但仅在 Ati/AMD GPU 上。 OpenCL 是唯一支持两者的“开放”选项。

OpenMP is cpu only, but easy to implement, CUDA is basically GPU only. Ati Stream supports both, but only on Ati/AMD gpu's. OpenCL is your only "open" option that supports both.

姐不稀罕 2024-11-08 06:24:04

Nowadays - 2013/2014 - there is C++ Accelerated Massive Parallelism (AMP) of Microsoft. This is a high level language that compiles to High Level Shader Language (HLSL) so you do not have to write kernel code etc.

A simple and easy to read comparison between OpenCL and C++ AMP is done by the AMD folks and is found here (click!).

帅的被狗咬 2024-11-08 06:24:04

GPU 对 openMP 的支持将在不久的将来提供:

http://openmp.org/sc14 /Booth-Sam-IBM.pdf

The GPU support for openMP will be available in near future:

http://openmp.org/sc14/Booth-Sam-IBM.pdf

岛徒 2024-11-08 06:24:04

如果您想接触 GPU 并达到比 OpenCL 更高的水平,您可以看看 Matlab。有机会通过 Matlab 对 GPU 进行编程,而无需学习 OpenCL 和 CUDA 等较低模型。
CUDA 会更高效,因为您可能要对 NVIDIA 卡进行编程。然而,openCL 是 GPGPU 的标准,编码方式非常相似。虽然您可能会发现使用 CUDA 或 openCL 并不是很难,但您确实会发现优化它们要困难得多。

我希望它有帮助。

If you want to get involve with GPU and at higher level than OpenCL you might have a look to Matlab. There is a chance to program GPUs via Matlab and you do not need to learn lower models such as OpenCL and CUDA.
CUDA it will be more efficient as you probably are going to program a NVIDIA card. However, openCL is the standard for GPGPUs and the way to code is pretty similar. Although you might find not very difficult to use CUDA or openCL, you will really find much harder to optimize them.

I hope it helps.

迷你仙 2024-11-08 06:24:04

Open CL 是开放的,但我听说它的一个缺点是缺乏文档。在 NVIDIA 和 ATI 之间,ATI 可能更好,因为据报道 2009 年它的速度更快,但我不确定这些统计数据是否仍然正确。

Open CL is open but I've heard that a downside to this is the lack of documentation. ATI might be a better between NVIDIA and ATI since it was reportedly faster in 2009 but I'm not sure if those stats are still correct.

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