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
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)
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 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.
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.