einpoklum
einpoklum

Reputation: 131986

Can OpenCL platforms change over the course of execution?

While executing a process, can the results of subsequent calls to clGetPlatformIds() change? i.e. can platforms disappear, appear, change order, or change handles ("ids")?

I'm asking about what the OpenCL standard guarantees, or mandates, of course.

Upvotes: 0

Views: 28

Answers (1)

aland
aland

Reputation: 5209

I could not find any normative section in the standard about that.

In practice, Khronos OpenCL ICD loader initializes the platforms only once (Linux, Windows), so the list of platforms and their indices should not change if do the usual thing of linking to the OpenCL library.

However, if you use dlopen and dlclose to load and unload libOpenCL library, the results of clGetPlatformIds can change between the two invocations (setenv("OCL_ICD_VENDORS", "/no/such/path", 1); is an easy way to break things)

Upvotes: 2

Related Questions