Skip to content

Added instance platform specification.#1527

Open
Kerilk wants to merge 1 commit intoKhronosGroup:mainfrom
Kerilk:cl_khr_icd-instance
Open

Added instance platform specification.#1527
Kerilk wants to merge 1 commit intoKhronosGroup:mainfrom
Kerilk:cl_khr_icd-instance

Conversation

@Kerilk
Copy link
Contributor

@Kerilk Kerilk commented Feb 9, 2026

Hello,
this PR describes the notion of OpenCL instance platforms (and devices). This should allow addressing the concerns described here: #1378.
In effect platform instances (and their associated devices) allow several dispatch information to be set for the same vendor platform, they are otherwise indistinguishable from our current platform and devices. This enables guarantying that instance platforms would only see clIcdSetPlatformDispatchDataKHR called once. It also allows the ICD2 mechanism to be robust in the case where several ICD loaders are built in the same executable, which is unfortunately possible since some have statically linked the loader inside applications.

This also allows implementing OpenCL instances that support user defined layering, see here for a prototype:
https://github.com/Kerilk/OpenCL-ICD-Loader/tree/instance_layers

I've demonstrated instance platforms in pocl here:
https://github.com/Kerilk/pocl/tree/instance
This is slightly outdated (I've added properties to the instance platform creation API since),
and frankly really buggy right now... I'll prepare something better.

Copy link
Contributor

@EwanC EwanC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've read through this and the associated issue. This solution makes sense to me and this PR looks good with respect to that, but not sure I fully grasp all the nuance of the problem to evaluate if this is the best solution. i.e other people should take a look at this too 🙂

@Kerilk
Copy link
Contributor Author

Kerilk commented Feb 16, 2026

Tagging @pjaaskel since we may need to discuss the best way to implement this in pocl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants