Repository navigation
Move hal.executable.entry_point ops into hal.executable.target. - #2893
Merged
Merged
Conversation
ScottTodd
marked this pull request as ready for review
August 14, 2020 22:36
benvanik
approved these changes
Aug 15, 2020
| auto executableOp = cast<ExecutableOp>(targetOp.getParentOp()); | ||
| auto entryPointOps = | ||
| executableOp.getBlock().getOps<ExecutableEntryPointOp>(); | ||
| auto entryPointOps = targetOp.getBlock().getOps<ExecutableEntryPointOp>(); |
Collaborator
There was a problem hiding this comment.
this is much nicer! walking up the IR tree has a smell :)
Merged
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The HAL transformation pass pipeline "materializes interfaces" then "translates executables" for each configured target (source). As part of its executable translation, the VulkanSPIRV target "splits" dispatch functions using SplitDispatchFunctionPass, creating a schedule of
spv.EntryPointops to dispatch in sequence whenrecordDispatch()is called (source).For #1890, we want to change dispatch ops from using loose ordinals for entry points:
to using nested references:
To use references in that format, the VulkanSPIRV target should create new
hal.executable.entry_pointops which can be referenced whenever it splits dispatch functions. However, entry points are currently placed onhal.executableops, which can contain multiplehal.executable.targetops (e.g. several for "vulkan" and one for "vmla"). Thus, this PR moves entry points down intohal.executable.targetops so that each target can have more control over how it sets up its entry points.I explored a few different ways to structure the passes involved as part of this work, each with some tradeoffs. Happy to make changes now that I have a better handle on how this all fits together.