0
我目前正在开发一个关于OpenCL的项目,并在尝试构建该程序时遇到了一些麻烦。所以,我有以下代码:越来越cl_build_program_failure错误
//Read source file
std::ifstream sourceFile("calculation_kernel.cl");
std::string sourceCode(std::istreambuf_iterator<char>(sourceFile), (std::istreambuf_iterator<char>()));
cl::Program::Sources source(1, std::make_pair(sourceCode.c_str(), sourceCode.length()+1));
if (sourceFile.is_open()){
printf("the file is open\n");
}else{
printf("error opening file\n");
}
// Make program of the source code in the context
cl::Program program = cl::Program(context, source);
// Build program for these specific devices
program.build(devices);
的代码编译好,但我会得到一个clBuildProgram(-11)埃罗当我尝试运行它。我已验证我的内核文件可以成功打开。 我在这里错过了什么吗?或者有没有办法来调试这个错误?
提前致谢!