Finding a general lib for OpenCL

Hi, everyone. May I ask a silly question? Is there any general lib for OpenCL supporting all the hardware? Or is there any method to carry this out?

In an other word, if I have a NV card, and I use NV’s SDK for development, but when I copy the compiled program to a PC with ATi card, should I recompile my source code with ATi SDK? Or is there any general lib to use on both platform, making recompile avoidable? :?:

Thanks.

The platform layer is supposed to make this possible, but my understanding is that it is not finished yet.

Could you tell me who is doing this for Windows? M$ doesn’t seem to do this. :expressionless:

If you search for OpenCL for windows I think you’ll find a few vendors. I know AMD and Nvidia have one.

I know AMD and Nvdia both have their own SDKs and drivers for Windows, but I guess maybe one just cannot use AMD SDK for Nvdia driver(at least hardware acceleration is unavailable) on Windows, and vise versa.

Am I right?

I think the OpenCL Driver is vendor-specific cause, ATI and Nvidia Cards are different and can’t use the same OpenCL-driver, so every vendor has to build drivers supporting OpenCL.

I have implemented a tool that loads the OpenCL dll at run-time, in theory making it independent of which actual driver it is used with. It is available with full source code at http://clcc.sourceforge.net if you would like to try it out.

However, for the future I suspect the system vendors will provide a “common” OpenCL.dll (just like OpenGL) you can link to, which automatically passes calls through to the driver specific implementation.

It seems a long time to wait this on Windows…
It seems that I can only pin my hope on open source force.

That should be simply a matter of linking path, the header files are standard, and all the api calls are “EXTERN”.
NVIDIA drivers put libOpenCL.so (and OpenCL.dll) shared library in the system directory.
ATI put the shared library in the SDK directory, you specify that path and than link with -lOpenCL flag.
IBM kit for Cell put libCL.so in /usr/lib, so simply -lCL will works for linking.

So if you want move your program compiled an PC A with a nvidia card, to PC B with ati card, simply you must have a library with the same name in the LD_PATH.

I have implemented a tool that loads the OpenCL dll at run-time, in theory making it independent of which actual driver it is used with. It is available with full source code at http://clcc.sourceforge.net if you would like to try it out.

The solution of one DLL to communicate with every vendor’s drivers is correct, like OpenGL32.dll itself.

The question is who will create this DLL for every platform? Another open-source project? Maybe.

My question: I write a commercial program with heavy parallel computations. OpenCL is manna from heaven for me. But I want to sell my program alone, without a specific GPU. My program must work with every hardware configuration (even GPU without OpenCL support) and primary on Windows, secondary on Linux.
Is this possible, or I must use only CPU for now, and make an update with OpenCL support after 2, 5, 10 years?

Now on linux and windows, if you install amd sdk or/and nvidia driver you can use OpenCL on either intel CPU or amd /nvidia GPU, all together.

nvidia and amd provide the small opencl.dll/so with their atiocl/nvocl library, wich permit to implement the ICD extension.