-
Notifications
You must be signed in to change notification settings - Fork 45
refactor(dispatch): Generate the dispatch surface from a single declaration #372
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
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3cf6041
Generate the dispatch surface from a single declaration
ahuber21 e4cd87b
docs(dispatch): tighten the new comments to two lines each
ahuber21 ffa2a21
Add a link probe that checks the dispatch surface
ahuber21 e544788
build(dispatch): spell out the extents and ISA levels at configure time
ahuber21 75cf382
test(dispatch): check the built surface against its declaration
ahuber21 5fafe1d
docs(dispatch): document the surface bookkeeping and group the checkers
ahuber21 44dd9a6
Potential fix for pull request finding
ahuber21 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
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
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,66 @@ | ||
| <!-- | ||
| ~ Copyright 2026 Intel Corporation | ||
| ~ | ||
| ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
| ~ you may not use this file except in compliance with the License. | ||
| ~ You may obtain a copy of the License at | ||
| ~ | ||
| ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
| ~ | ||
| ~ Unless required by applicable law or agreed to in writing, software | ||
| ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
| ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| ~ See the License for the specific language governing permissions and | ||
| ~ limitations under the License. | ||
| --> | ||
|
|
||
| # Dispatch surface checks | ||
|
|
||
| These scripts are run by ctest to hold the built binary to the surface | ||
| declared in `cmake/dispatch-surface.cmake`. They are not part of building | ||
| the library. See `cmake/dispatch-surface.cmake` for documentation on the | ||
| declaration format, the current extent list and ISA levels, and how to add | ||
| a new level. | ||
|
|
||
| These tests are only added to the build when the x86 object libraries | ||
| exist. Run `ctest` from `<build>/tests`, not from the build root. | ||
|
|
||
| ## check-dispatch-linkage.cmake | ||
|
|
||
| **Test:** `dispatch_surface_linkage` | ||
|
|
||
| Verifies that every kernel declared in the surface is defined in the | ||
| archive, that the archive defines no undeclared kernels, and that a test | ||
| probe naming every kernel defines none of its own. Failure means a | ||
| declared kernel is missing or an extra kernel was built but not declared. | ||
|
|
||
| ## check-dispatch-declaration.cmake | ||
|
|
||
| **Test:** `dispatch_surface_declaration` | ||
|
|
||
| Verifies that the symbol count derived from the surface declaration matches | ||
| the symbol count in the archive and in a consumer object that names every | ||
| entry point. Failure means the declaration's extent list, ISA levels, type | ||
| pairs, or distance enumerator order disagrees with the built kernels. This | ||
| catches generator bugs that would pass linkage checks by being wrong | ||
| consistently in both the archive and the probe. | ||
|
|
||
| ## check-dispatch-instructions.cmake | ||
|
|
||
| **Test:** `dispatch_instructions_<infix>` (one test per ISA level) | ||
|
|
||
| Verifies that each level's object file stays within its instruction budget, | ||
| emitting only instructions the level's runtime predicate guarantees the host | ||
| supports. Failure means an object file contains instructions not guaranteed | ||
| by its level's predicate, causing illegal-instruction faults on hosts the | ||
| dispatcher routes to that level. | ||
|
|
||
| ## check-dispatch-execution.cmake | ||
|
|
||
| **Test:** `dispatch_surface_execution` | ||
|
|
||
| Verifies that a call through the entry points on the test host enters the | ||
| ISA level the host satisfies, observed by breaking in gdb on each level's | ||
| kernel and reporting which one runs. Failure means runtime dispatch routes | ||
| to the wrong level, or a specialization disappeared behind a preprocessor | ||
| guard while still linking and counting in the symbol table. | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like files in this directory intended for tests.
IMHO it makes sense to move them to
/test