OpenCL-Docs
OpenCL-Docs copied to clipboard
Should `binary_status[i]` be set in clCreateProgramWithBinary if `lengths[i]` is zero or `binaries[i]` is NULL?
Hi
Suppose that (lengths[i] == 0 || binaries[i] == NULL) && binary_status != NULL in clCreateProgramWithBinary.
Should binary_status[i] be set to CL_INVALID_VALUE in that case?
The spec currently says:
binary_status returns whether the program binary for each device specified in device_list was loaded successfully or not. It is an array of num_devices entries and returns CL_SUCCESS in binary_status[i] if binary was successfully loaded for device specified by device_list[i]; otherwise returns CL_INVALID_VALUE if lengths[i] is zero or if binaries[i] is a NULL value or CL_INVALID_BINARY in binary_status[i] if program binary is not a valid binary for the specified device. If binary_status is NULL, it is ignored.
CL_INVALID_VALUE if lengths or binaries is NULL or if any entry in lengths[i] is zero or binaries[i] is NULL.
CL_INVALID_BINARY if an invalid program binary was encountered for any device. binary_status will return specific status for each device.
If yes, it would be good to add the sentence "binary_status will return specific status for each device." to the documentation of the CL_INVALID_VALUE return value and to add "in binary_status[i]" to CL_INVALID_VALUE within the documentation of binary_status.
If no, it would be clearer to remove any mention CL_INVALID_VALUE from the documentation of binary_status.