The Khronos Group - a non-profit industry consortium to develop, publish and promote open standard, royalty-free media authoring and acceleration standards for desktop and handheld devices, combined with conformance qualification programs for platform and device interoperability.

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

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?

Re: Finding a general lib for OpenCL

Originally Posted by dbs2

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.

Re: Finding a general lib for 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.

Re: Finding a general lib for OpenCL

Originally Posted by george_vv

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.

Re: Finding a general lib for OpenCL

Originally Posted by lilei9110

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.

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.

Re: Finding a general lib for 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.

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?