Closed hujiajie closed 11 years ago
Great catch and thanks for the detailed analysis. I have read the OpenCL specification and came to the same conclusion. The update I have just pushed no longer uses actual
to predict the size of the required buffer. Instead, we now enlarge the buffer until the message finally fits.
Stephan
In dpoCContext.cpp,
clGetProgramBuildInfo
is used to get the actual size of the build log. However, according to the OpenCL specs, it only works whenbuildLogSize
is equal to or larger than the actual size of the build log. IfbuildLogSize
is smaller than the log size andbuildLog
is not NULL, the error codeCL_INVALID_VALUE
will be returned. The following code could result in the above situation :In this example,
buildLogSize
andbuildLog
are initialized during the compilation of the first statement. But the build log of the second kernel function is slightly larger because of the longer function name. Thus, CL_INVALID_VALUE is return, and the value ofactual
is not defined by the OpenCL specs. According to my debugging,actual
could be weird in this situation and might be extremely large (e.g. 10931776), so the program just continues and the bug is unnoticed.Please correct me if there's any misunderstanding.
Thanks Jiajie