Reputation: 5083
I am currently learning OpencL and am finding it somewhat difficult to understand how it actually works. I am using MinGW compiler with ATI APP SDK. When I run the target I get error message
I have not placed any OpenCL.dll in the same folder as my application. Now searching a bit on Windows I can find this dll in
C:/Windows/SysWOW64
C:/Windows/System32/DriverStore/...
C:/Windows/System32
C:/Program Files(x86)/AMD APP SDK /...
So my question is how should I deploy my application? Should I distribute OpenCL.dll with my application?
Upvotes: 4
Views: 2432
Reputation: 6343
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.
Upvotes: 5
Reputation: 6343
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.
Upvotes: 3
Reputation: 5334
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.
Upvotes: 2
Reputation: 2216
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)
Upvotes: 2