OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU.
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1718 Discussions

Inconsistent cl_device_id order

Sean_S_3
Beginner
296 Views

I tried to create a program from source, build it and save its binary, and then create a program from binary.  However, when I went to build it the second time I got the follow error: -42 (CL_INVALID_BINARY).  I tracked down the issue being that the order of the cl_device_id's I passed to clCreateContext, if not the same order I get when I query clProgramGetInfo with CL_PROGRAM_DEVICES.  This was quite an unexpected surprise.  Why wouldn't this order be maintained?  Changing that order causes me more headache as I need to query clGetDeviceInfo all over again.  I realize after reading through the spec that it does not require a consistent order, but what is to be gained from not maintaining an order even within the same program execution?

 

Btw, I'm using the latest non-beta Intel graphics driver and OpenCL SDK for Windows 8.1 64-bit with Visual Studio 2012 Professional.

0 Kudos
1 Reply
Raghupathi_M_Intel
296 Views

Sorry for the late response. Apparently its not trivial to maintain the exact order between invocations of the common runtime (a layer that routes the calls to the appropriate runtime (CPU/GPU). We do maintain the device order for the life time of the CRT. So you should get the same order when calling clGetDeviceIDs() but its not guaranteed when calling clGetPlatformIDs() multiple times.

Raghu
 

0 Kudos
Reply