Skip to content

ICD loader layer fixes and refactoring - #487

Open
bashbaug wants to merge 2 commits into
intel:mainfrom
bashbaug:layer-refactoring
Open

bashbaug wants to merge 2 commits into
intel:mainfrom
bashbaug:layer-refactoring

Conversation

@bashbaug

@bashbaug bashbaug commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Description of Changes

This PR includes some fixes and refactoring when using the OpenCL Intercept Layer as an ICD loader layer:

  • Incorporated the official OpenCL layer header.
  • Updated OpenCL headers to the latest versions.
  • Moved ICD layer functionality to a dedicated source files.
  • Fixed symbol used to get the CLIntercept shared library file name.
  • Added support for loading libraries with deep binding.
  • Implemented clInitLayerWithProperties.
  • Added layer exports to Linux shared library.
  • Ensured layer function pointers were to CLintercept.
  • Added checks for number of layer entries.
  • Added documentation.

Testing Done

Tested on Windows and Linux. Verified that recent ICD loaders will load the layer and that call logging and host performance timing work as expected. Also, checked with a slightly older OpenCL ICD loader, and verified that the OpenCL Intercept Layer does not read from or write past the number of entries provided.

- Incorporated the official OpenCL layer header.
- Updated OpenCL headers to the latest versions.
- Moved ICD layer functionality to a dedicated source files.
- Fixed symbol used to get the CLIntercept shared library file name.
- Added support for loading libraries with deep binding.
- Implemented clInitLayerWithProperties.
- Added layer exports to Linux shared library.
- Ensured layer function pointers were to CLintercept.
- Added checks for number of layer entries.
@bashbaug

bashbaug commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

@bigmat18 mind giving this a quick look on your end to be sure I didn't break anything?

@Kerilk you might be interested in this, too.

@bigmat18

bigmat18 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Sure, I'm going to check this

@bashbaug

Copy link
Copy Markdown
Contributor Author

Awesome, thanks!

Note, as a further improvement, I think we could add support to cliloader to setup the layer path as an alternative to the current LD_PRELOAD or DLL shenanigans. I'd like to land this PR first, though.

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