PDA

View Full Version : Provide typedefs for OpenCL functions



ebfe
02-24-2010, 02:01 AM
Hi.

I'm the author of Pyrit (http://code.google.com/p/pyrit/) which has an OpenCL-module.

I would like to be able to build my OpenCL-module without the need to (dynamically) link libOpenCL.so at build time. While my own code is licensed under the GPLv3 and may be included in all kinds of (Linux) distributions, the OpenCL-library is usually only provided by third-party, GPL-incompatible drivers (provided e.g. by Nvidia or AMD). Therefore it is currently not possible to include my OpenCL-module in a Linux-distribution like Fedora.

The circumvent the need to link in libOpenCL.so at build-time, my idea was to use dlsym() to dynamically resolve the OpenCL-symbols at runtime and use function pointers to call the functions. This however is only possible if the whole signature of the function that is pointed to is known at compile time in form of a typedef. The problem is that the header-file "cl.h" currently does not provide a typedef for the OpenCL-functions. This leaves me with the only option (afaics) to provide the typedefs myself, duplicating the information from khronos' header file.

May I ask for the next release of those header files to include typedefs for all defined functions so it is possible to define function pointers to OpenCL-functions without the need to duplicate information from the header files.