OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU.
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.

Reporting build errors

A_Z_
Beginner
278 Views

  Is there a way to report compile errors for the kernels? cl::Program::build() simply returns CL_BUILD_PROGRAM_FAILURE which doesn't give any indication where the errors are.

0 Kudos
2 Replies
Raghupathi_M_Intel
278 Views
You can get the build log by calling cl::Program::getInfo and passing the CL_PROGRAM_BUILD_LOG param. Have you tried that? Or you can use the KernelBuilder to verify if your kernel has any errors, if you are using the Intel OpenCL SDK. Thanks, Raghu
0 Kudos
A_Z_
Beginner
278 Views
cl::Program::getBuildInfo was what I was looking for. Thanks! [cpp] result = program.build(devices,NULL,NULL,NULL); std::string buildLog = program.getBuildInfo<CL_PROGRAM_BUILD_LOG>(devices[0]); if(result != CL_SUCCESS) { printf("### Kernel compile log ###\n%s\n",buildLog.c_str()); exit(result); } [/cpp]
0 Kudos
Reply