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

查看:85
本文介绍了我真的需要一个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注册表中下载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应该抽象出特定于供应商的实现.如果我现在下载供应商特定的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天全站免登陆