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)埃羅當我嘗試運行它。我已驗證我的內核文件可以成功打開。 我在這裏錯過了什麼嗎?或者有沒有辦法來調試這個錯誤?
提前致謝!