-
Notifications
You must be signed in to change notification settings - Fork 799
[SYCL][Doc] Add initial draft of the device registry #18822
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
Open
jdnk
wants to merge
7
commits into
intel:sycl
Choose a base branch
from
jdnk:targets-reg
base: sycl
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d450cca
Add initial draft of the targets registry
jdnk 831683e
Remove unnecessarily allowed zeros; Fix RISC-V
jdnk 842c3e1
Add README note
jdnk d418879
Add more GPU archs; Fix SiFive naming
jdnk 8de38c2
Update header
jdnk f7fc6cc
Change prefix; Add TODO; Add version to asciidocs
jdnk eb0f5d5
Add MIT license
jdnk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Copyright (c) 2025 The Khronos Group Inc. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Targets Registry | ||
|
||
This directory contains a registry of enumerator values for compute device targets, features and architectures to be used in Khronos extensions (such as SPV_INTEL_function_variants). | ||
|
||
The authoritative reference file is `core.json`. | ||
From this file the following files are generated using `generate.py`: | ||
* `architectures.asciidoc` - to be used with the `OpSpecConditionalArchitectureINTEL` instruction | ||
* `targets.asciidoc` - to be used with the `OpSpecConditionalTargetINTEL` instruction | ||
* `registry.h` - contains all the values in a C header format | ||
|
||
## Types of entries | ||
|
||
There are two main types of entries, organized as unorded _sets_, or ordered _lists_. | ||
In both cases, each entry has an associated integer value. | ||
|
||
### Targets | ||
|
||
Targets represent the device's Instruction Set Architecture (ISA), for example x86. | ||
* The **Targets** _set_ contains the recognized targets. | ||
* Each target has also a _set_ of **Features** which represent features/extensions of a particular target. | ||
For example, AVX2 is an extension of the x86/x86_64 ISA and thus is available only for those targets. | ||
|
||
_(The current lists were assembled with the help of `llc --version` and `llc --mtriple=<tgt> --mattr=help.)_ | ||
|
||
### Architectures | ||
|
||
Architectures represent the processor's model or microarchitecture. | ||
* Architecture **categories** define a _set_ of device types, such as CPU, GPU, or other domain-specific accelerators (eg. an AI accelerator). | ||
* Architecture **families** define a _set_ of distinct lines of products within each category. This generally means a vendor, but can also represent two types of devices of the same category within one vendor that are not directly comparable (eg. Vendor X has two lines of CPUs: high-performance CPUs for servers and low-power CPUs for embedded.). | ||
* **Architecture** is an ordered _list_ of architectures. | ||
Within the same category and family, it is meaningful to compare architecture to say, for example, arch. X larger than arch. Y. | ||
Architectures with a larger enumerator value are evaluated as larger than those with smaller values. | ||
The meaning of the ordering is defined by the vendor, but generally, newer architectures are added after older ones. | ||
|
||
## Adding new entries & Versioning | ||
|
||
The registry is versioned. The current version is stored in `core.json` and from there propagated to the generated files. | ||
|
||
Adding a new entry to one of the sets or lists is done by incrementing the enumerator and adding the entry at the end of the set / list. | ||
Adding entries this way is backwards-compatible and does not require incrementing the version number. | ||
Likewise, adding a new alias to an existing enumerator value is backwards-compatible. | ||
|
||
Any changes to the meaning of existing enumerator values are backwards-incompatible and should be as rare as possible. | ||
This includes, for example, removing an entry, adding an architecture somewhere else than at the end of the ordered list, or reordering the architectures. | ||
In such cases, the version should be incremented, specifications using this repository will need to update the version, and finally the implementations of the specifications need to adapt to the changed version. | ||
|
||
Version 0 is used for the initial draft until the SPV_INTEL_function_variants extension is ratified as EXT or KHR. | ||
Until then, contents of the registry is subject to change and breaking changes can occur. | ||
|
||
## TODO | ||
|
||
* Use templating engine like [Mako](https://www.makotemplates.org) to handle the file generation. | ||
* Improve the generated header to include also C++ header using C++ features. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.