I’m currently working on adding OpenCL functionality to an existing C library (GNUAstro) and i was wondering how compatible C and OpenCL were.
I wanted to use these C library functions (GNUAstro) within the kernel but faced the problem that just compiling and linking them through the OpenCL API was not possible, since these libraries are written in C, and the kernel expect OpenCL C.
Some of the problems were that error handling functions no longer work, which i can live without, but additionally, even malloc() free() aren’t allowed in the kernel.
So i cannot directly compile and link but i would need some kind of intermediated processing to convert the library C source code to be OpenCL C. Or I would have to maintain a separate version of the source code intended for OpenCL C only.
Whats the best way to go about this? And do you know of any existing projects that have done something like this?