我真的需要 OpenCL SDK 吗? [英] Do I really need an OpenCL SDK?

查看:53
本文介绍了我真的需要 OpenCL SDK 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想让自己熟悉 OpenCL,但当互联网上的每个人都在谈论下载供应商特定的 OpenCL SDK 时,我完全感到困惑.为什么我需要那个?

I just tried to make myself familiar with OpenCL but totally got confused when everyone in the Internet was talking about downloading a Vendor specific OpenCL SDK. Why would I need that?

我对使用 OpenCL 的理解如下:

My understanding of using OpenCL was the following:

  1. Khronos OpenCL Registry 中下载由 Kronos 维护的 OpenCL 头文件,并将其提供给您的编译器.
  2. 编译您的代码并链接到 OpenCL.dll.
  1. Download the OpenCL header files that are maintained by Kronos in the Khronos OpenCL Registry and make it available to your compiler.
  2. Compile your code and link against the OpenCL.dll.

它让我感到困惑的原因是因为我认为 OpenCL 应该抽象出供应商特定的实现.如果我现在下载 Vendor 特定的 SDK,那么这个优势不会被破坏吗?

The reason why it confuses me is because I thought that OpenCL should abstract away vendor specific implementations. If I now download a Vendor specific SDK isn't then this advantage destroyed?

有人能说清楚吗?

推荐答案

您的理解是绝对正确的——您不需要任何供应商的 SDK 来开发或运行 OpenCL 程序.您所需要的只是要链接的标题和库.供应商 SDK 提供的示例代码可能有助于您在学习如何使用 OpenCL 时查看它们,它们还可能提供有助于开发的工具.

Your understanding is absolutely correct - you do not need any vendor SDKs in order to develop or run OpenCL programs. All you need are the headers and a library to link against. The vendor SDKs provide sample code that may be useful to look at while you are learning how to use OpenCL, and they may also provide tools that can aid development.

在 Windows 上,您需要一个 OpenCL.lib 库来链接,SDK 确实提供了该库.如果您愿意,您可以下载该库的源代码并自行构建.

On Windows, you will need an OpenCL.lib library to link against, which the SDKs do provide. You can download the sources for this library and build it yourself if you wish.

不过,使用特定供应商的 SDK 并没有什么坏处.他们在 SDK 中提供的头文件和库应该只是您可以自己下载的股票 Khronos 版本.这意味着使用一个供应商的 SDK 构建的 OpenCL 应用程序仍然可以在其他供应商的设备上正常运行.

There is no harm from using a specific vendor's SDK however. The headers and library that they provide in the SDK should just be the stock Khronos versions that you can download yourself. This means that an OpenCL application built using one vendor's SDK will still run just fine against other vendors' devices.

这篇关于我真的需要 OpenCL SDK 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆