views:

407

answers:

1

i've seen this done long ago with hlsl/glsl shader code. using a #include on the source code file that pastes the code into a char* so that no file io happens at runtime.

if i were to represent it as pseudo-code it would look a little like this:

#define CLSourceToString(filename) " #include "filename" "
const char* kernel = CLSourceToString("kernel.cl");

now of course that #define isn't going to work because it'll just try to use those quotation marks to start strings.

+3  A: 

According to this, it's not possible, but you can use xxd -i to archieve the same effect.

sepp2k