I am trying to find out how many registers some OpenCL kernels use. The kernels are placed in a single file about 1000 lines long, containing about 20 kernels with a number of functions and constants. They build and run without problems and no step along the way report any problems. Having built the program using “-cl-nv-verbose”, I query the size of the build log, allocate space for it and retrieve the log string using clGetProgramBuildInfo but the resulting build log is cut in half. Half the file is missing and the build log cuts off in the middle of a word. The size of the log is 4097 bytes, just one byte over the 4KB limit. I am using a Geforce 680GTX, driver version 304.88 for Linux. Getting this register usage data is very important to me. What could be wrong?
It seems the verbose output from the ptx compiler, for reasons unknown to me, is limited to 4KB+1 characters. No warning or error is returned that the output has been cut off. I split the large source file into smaller files and compiled each separately and this got me the data I needed.