cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

Nasenbaer
Adept I

Is it possible to show the compiler errors of kernels?

Hi,

I just completed the intro tutorial about OpenCL from ATI and I encountered errors while building the kernel (because of some typos). But the message that the build failed isn't very helpful for bigger kernel sourcefile. Is there a possiblity to show the errors and the line where they occured?

0 Likes
2 Replies
omkaranathan
Adept I

clGetProgramBuildInfo() will give you the build log.

Here is a sample code to get the build log

/* create a cl program executable for all the devices specified */ status = clBuildProgram(program, 1, devices, NULL, NULL, NULL); //error checking code if(!sampleCommon->checkVal(status,CL_SUCCESS,"clBuildProgram failed.")) { //print kernel compilation error char programLog[1024]; status = clGetProgramBuildInfo(program, devices[0], CL_PROGRAM_BUILD_LOG, 1024, programLog, 0); std::cout<<programLog<<std::endl; return 0; }

0 Likes

Thx for the hint and the example.

0 Likes