CLU icon indicating copy to clipboard operation
CLU copied to clipboard

clCreateProgramWithBinary will be called with NULL pointers as parameter if in_numBinaries >= m_numDevices

Open 2nhuber opened this issue 10 years ago • 1 comments

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.

2nhuber avatar Jul 23 '14 08:07 2nhuber

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.

allenhux-intel avatar Feb 03 '15 21:02 allenhux-intel