oneapi-src / oneapi-src/level-zero
Provide defines for build-time (header) version checks
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 335
- Forks
- 140
- Avg merge
- 12h 32m
- Merged PRs (30d)
- 5
Description
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:
#define L0_HEADER_MAJOR 1
#define L0_HEADER_MINOR 9
#define L0_HEADER_PATCHLEVEL 9
#define L0_HEADER_VERSION (L0_HEADER_MAJOR * 10000 + L0_HEADER_MINOR * 100 + L0_HEADER_PATCHLEVEL)
Code could then give much better error:
# if L0_HEADER_VERSION < 10909
# error "At least version v1.9.9 of the L0 header(s) required"
#endif
(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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The requested change is centered on ze_api.h; start by reviewing the header's existing version information and the release process that updates it. Add build-time version defines usable by C/C++ consumers, and verify that older headers can be distinguished from the minimum version required by a program.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, cpp
- Domain
- api, build-system
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100