OpenCL 与 DirectCompute?

发布于 2024-09-08 10:04:57 字数 460 浏览 3 评论 0原文

我正在寻找 OpenCLDirectCompute,但我没有找到任何东西。 OpenCL 的跨平台优势和支持更广泛的 GPU 对我来说并不重要。我只适合在 Windows 上针对 DX11 GPU 进行编码。假设每个 API 的优缺点是什么?

我知道这个问题之前曾提出过,但我正在寻找更多详细信息。

我对 CUDA 不感兴趣,因为我不想将自己限制在 Nvidia 硬件上。

I'm looking for comparisons between OpenCL and DirectCompute, but I haven't found anything. OpenCL's advantages of being cross-platform and having a wider range of supported GPUs don't matter to me. I'm fine with coding on Windows against DX11 GPUs only. Assuming that, what are the pros and cons of each API?

I know this question was raised before, but I'm looking for more details.

I'm not interested in CUDA, since I don't want to restrict myself to only Nvidia hardware.

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

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

发布评论

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

评论(5

剧终人散尽 2024-09-15 10:04:57

对于编码人员来说,最大的区别可能是 DirectCompute 是通过类似于 HLSL 的语言进行编程的,而 OpenCL 是通过类似 C 的语言进行编程的。

另一个需要考虑的区别是,一般来说,对于商品级 GPU,DirectX 支持比 Windows 上的 OpenGL 支持更好(更快且错误更少)。这可能意味着对 DirectCompute 的更稳定的支持,但实际上,这只是猜测。

Probably the biggest difference for a coder is that DirectCompute is programmed by a language which is similar to HLSL, and OpenCL is programmed via a C-like language.

Another difference to consider is that, generally, for commodity level GPUs, the DirectX support is better (faster and less buggy) than OpenGL support on Windows. This may translate to more stable support for DirectCompute, but really, this is just speculation.

同展鸳鸯锦 2024-09-15 10:04:57

OpenCL 的主要优点是它不仅仅局限于显卡。您可以在同一个程序中使用多核 CPU、显卡以及可能的任意数量的其他硬件加速设备(DSP 等)。

我不确定 DirectCompute 是否允许这种自由。

Well the major advantage of OpenCL is that it is not just limited to graphics cards. You can make use of your multicore CPU, Graphics Card and potentially any number of other hardware acceleration devices (DSPs etc) all from the same program.

I'm not sure if DirectCompute allows that freedom.

只是我以为 2024-09-15 10:04:57

OpenCL 跨平台性不仅仅是一个细节,因为主机代码(调用 OpenCL API 并提交内核的代码)本身可以是跨平台的(请参阅 链接文本, 链接文本...)。

编写一次,即可在任何地方的任何 GPGPU 上运行。

除此之外,OpenCL 工具确实变得越来越好,带有适用于 Visual Studio、NVidia 和 Visual Studio 的 ATI Stream 插件。 ATI SDK 包含大量示例等...

The OpenCL cross-platform-ness is not just a detail, as the host code (the one calling the OpenCL API and submitting kernels) can itself be cross-platform (see link text, link text...).

Write once, run on any GPGPU, anywhere.

Otherwise the OpenCL tooling is really getting better, with an ATI Stream plugin for Visual Studio, the NVidia & ATI SDKs that contains tons of samples, etc...

女中豪杰 2024-09-15 10:04:57

现在的另一个选择是 C++ AMP,它为您提供现代 C++ 语法,无需单独的编译器,同时仍保留硬件可移植性。请点击此处的链接了解更多信息,并随时提出问题:http://blogs.msdn.com/b/nativeconcurrency/archive/2011/09/13/c-amp-in-a-nutshell.aspx

Another option now is C++ AMP which gives you modern C++ syntax without a need for a seperate compiler while still preserving hardware portability. Please follow links from here for more info and feel free to post questions as you have them: http://blogs.msdn.com/b/nativeconcurrency/archive/2011/09/13/c-amp-in-a-nutshell.aspx

一片旧的回忆 2024-09-15 10:04:57

我使用 OpenCL 是因为我可以轻松地将我的应用程序移植到 Linux,但使用 DirectCompute 这是不可能的。
我还认为,OpenCL 实现的性能将随着时间的推移而提高(它与 NVidia 卡的 CUDA 处于同一级别),并且(驱动程序)错误将(希望;))随着时间的推移而被消除。

I use OpenCL because i can easily port my App to Linux but with DirectCompute this is not possible.
I think also that the performance of the OpenCL implementation will increase with time (that it comes at the same Level like CUDA for NVidia Cards) and also that the (driver)bugs will (hopefully ;) ) be eliminated with time.

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