The Khronos Group - a non-profit industry consortium to develop, publish and promote open standard, royalty-free media authoring and acceleration standards for desktop and handheld devices, combined with conformance qualification programs for platform and device interoperability.

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Two suggestions for supporting a multi-process environment

When two different processes call "clGetDeviceIDs()", the OpenCL standard does not (currently) guarantee that the physical devices will be listed in the same order for both.

What if a computer has two (or more) identical devices and a process specifically wants to use either the same physical device as another process did, or perhaps it wants to use a different device (for example due to heating, power-supply issues or a suspected hardware fault)? Currently there is no way to tell the difference.

Something as simple as:

clGetDeviceInfo(param_name=CL_DEVICE_INDEX)

could solve this problem.

2. Allow use of OpenCL by both parent and child processes.

Currently in most implementations, if a parent process uses OpenCL in any way before calling "fork()", then its son processes cannot use OpenCL at all. This is because the OpenCL initialization by the parent usually involves opening files in "/dev", which are not inherited by son processes, leaving a mess in the OpenCL library's internal data-structures!

Suggesting as a solution either:

clFork()

to be called by the son-process; and/or

clCleanup()

to be called by the parent-process once it no longer needs to use the OpenCL library.