相关疑难解决方法(0)

使用#include加载OpenCL代码

我很久以前就用hlsl/glsl着色器代码看到了这一点 - 使用#include源代码文件将代码粘贴到一个代码中,char*以便在运行时不会发生文件IO.

如果我将它表示为伪代码,它看起来有点像这样:

#define CLSourceToString(filename) " #include "filename" "
const char* kernel = CLSourceToString("kernel.cl");
Run Code Online (Sandbox Code Playgroud)

现在当然#define不会起作用,因为它只会尝试使用这些引号来启动字符串.

c c++ opencl c-preprocessor

6
推荐指数
1
解决办法
3258
查看次数

标签 统计

c ×1

c++ ×1

c-preprocessor ×1

opencl ×1