CLU
CLU copied to clipboard
clCreateProgramWithBinary will be called with NULL pointers as parameter if in_numBinaries >= m_numDevices
In clu_runtime.cpp in the binary version of CLU_Runtime::BuildProgram there is a bug, if in_numBinaries >= m_numDevices. In this case pLengths and pBinaries will be NULL, which are passed to clCreateProgramWithBinary.
It seems that a else branch is missing in line 693.
This API is a little broken: it requires the developer to submit a number of binaries in the order of the devices in the internal, private device array. The standard API takes an array of device ids that corresponds to the binaries, so not all devices even have to be provided. CLU doesn't really allow more than 1 device type per context... maybe this API would be easier if it just did 1 device type (and 1 corresponding binary) at a time.