-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide defines for build-time (header) version checks #111
Comments
Header compatibility is determined by L0 spec version, not L0 loader version. There is already a define for spec version that could be used as you describe. See: |
@bmyates That's inadequate, as it handles only major and minor API version. New structs and defines were added to the L0 headers e.g. between 1.5.8 and 1.5.17 spec versions, and e.g. compute-runtime Should I update this ticket title & description to target |
The new structs added in 1.5.17 are extensions. Extensions have their own version defines that can be checked. Example: |
Us of ext versions checks would be needed if spec would have multiple branches where extensions advance at different pace. But I do not think that's the case, currently at least spec version last number (patchlevel) is increased on extension updates, and newer always includes APIs from one with lower version number, right? [1] In latter case, just checking for single "whole spec" version is easier for the user. One does not need to care / find out how different extensions are versioned, and which defines match to which APIs. [1] Things deprecated & removed on major version changes, may need also separate check for too large major version. |
A user can simply put extension specific code inside |
Sure. Was there some particular reason why patchlevel was not included to (It might still be fixable without breaking things, but once L0 major version updates start removing features i.e. comparisons are needed both for older and newer versions, it's harder.) |
@bmyates ? (feel free to close this after answering) |
Currently building L0 programs give "mystery" errors if system L0 headers are not new enough.
It would be much user-friendlier if
ze_api.h
would include defines that can be used to check whether L0 headers are new enough, and which are (automatically) updated on every release.E.g. with something like this:
Code could then give much better error:
(
L0_HEADER_VERSION
obviously assumes that project does not use more than 99 minor & patchlevel versions.)PS. This is needed because doing package / pkg-config version check is not enough for all cases. Even if system would have new enough version installed from distro packages, code could e.g. be getting some older version from
/usr/local/include
. Or user could be directly compiling C/C++ files for self-contained L0 utilities.The text was updated successfully, but these errors were encountered: