KhronosGroup / KhronosGroup/OpenCL-Docs
clGetProgramBuildInfo with CL_PROGRAM_BUILD_GLOBAL_VARIABLE_TOTAL_SIZE does not require a program to be built
- Dominant language
- Python
- Stars
- 420
- Forks
- 131
- Avg merge
- 5d 13h
- Merged PRs (30d)
- 11
Description
This was internal GitLab issue 69. Which said
> The description of CL_PROGRAM_BUILD_GLOBAL_VARIABLE_TOTAL_SIZE parameter of clGetProgramBuildInfo call (table 5.18) in 2.0/2.1 specs does not require a program to be built. Other queries have defined behavior in case the program was not built. It's reasonable to have this requirement as this query is put under clGetProgramBuildInfo, not clGetProgramInfo.
Current cl21_trunk branch in conformance tests runs clGetProgramBuildInfo just after clCreateProgramWithSource.
It looks like the current `master` branch CTS now builds the program before checking `CL_PROGRAM_BUILD_GLOBAL_VARIABLE_TOTAL_SIZE`.
If there is a change to be made I think the two options are to either to specify an error code or add text to the query description saying:
> If build status of the specified program for device is CL_BUILD_NONE, the value 0 is returned.
The value 0 is already specified is program scope variables are not supported, and of course will be the correct value for some programs, so it's not ideal.
I haven't checked what existing implementations do here, because this query has been around since 2.0, so specifying anything risks differing from what is already implemented.
Contributor guide
Assessment
This issue has not been assessed yet.