I\'ve seen this done long ago with hlsl/glsl shader code -- using an #include
on the source code file that pastes the code into a char*
so that no
See the bullet physics engines use of OpenCL for how to do this to a kernel.
In C++ / C source
#define MSTRINGIFY(A) #A
char* stringifiedSourceCL =
#include "VectorAddKernels.cl"
In the OpenCL source
MSTRINGIFY(
__kernel void VectorAdd(__global float8* c)
{
// snipped out OpenCL code...
return;
}
);
According to this, it's not possible, but you can use xxd -i
to archieve the same effect.