Deploying OpenCL application?

回眸只為那壹抹淺笑 提交于 2019-12-01 06:26:47

The reason why your application can't find clReleaseDevice is because you wrote your application to the OpenCL 1.2 headers but you only have a OpenCL 1.1 runtime on your machine. You can't call OpenCL 1.2 API on an OpenCL 1.1 runtime. I recommend using the OpenCL 1.1 headers unless you only run on OpenCL 1.2 devices. It will keep your code safe for running on OpenCL 1.1 platforms and devices.

Dissenting opinion: You should never redistribute OpenCL.dll with your application! It belongs in the system folder and should only be installed by OpenCL drivers from the platform providers (Apple, NVIDIA, AMD, Intel, etc.). If your system doesn't have it installed, shipping your own with your application isn't going to make it run any better since you don't have an OpenCL platform for it to find.

yes, according to the "hello world" example in the SDK documentation you should have OpenCL.dll somewhere on your path. It will need this to connect your software call to the kernel running on the device.

Note that in general Windows looks for .dll files according to the PATH environment variable (after looking in the current directory / system directories)

Yes you should distribute all non standard dll's with your application. You can either put it in the same folder as the application, this makes it easy to deinstall the application, just delete the folder. Or if you use an installer put it in the system folder (using the installer) of the target system. Usually a good installer should be able to determine the system target folder.

Windows will search the dll first in the executable path and then in the system path. As you can read here. So it usually makes no difference for your application where you put it in. Except the loading of your app will extend a little bit.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!