Repository navigation
Adding iree_hal_driver_create_device_by_path & co. - #9413
Merged
Merged
Conversation
ScottTodd
reviewed
Jun 9, 2022
This adds the plumbing for creating devices by path specs in addition to creating them by driver-specific IDs. A helper was also added to create by ordinal to simplify tools that want to expose devices in a canonical form with other driver-specific tools. The creation methods also gain the ability to pass in key-value pair parameters. Drivers can now use these parameters to refine device selection and configure the devices during creation. The entire driver layer is optional so the extra string handling here is only in cases that desire it, and for devices that have no properties (like local-sync) it doesn't add a cost. A helper that parses a canonical device URI into the components for create_device_by_path was added as iree_hal_driver_create_device_by_uri and should be used by most hosting applications. For tooling and other one-shot situations an even more convienient iree_hal_create_device is added as an easy way to create devices with a massive footgun attached. This may explode when using multiple devices or recreating devices; the solution there is for the hosting application to create and cache the drivers it wants to ensure remain around. Progress on #9343.
benvanik
force-pushed
the
benvanik-device-params
branch
from
June 9, 2022 16:25
cd0fbe3 to
13bc27b
Compare
benvanik
marked this pull request as ready for review
June 9, 2022 16:25
benvanik
requested review from
GMNGeoffrey,
ThomasRaoux and
antiagainst
as code owners
June 9, 2022 16:25
benvanik
requested review from
ScottTodd
and removed request for
GMNGeoffrey,
ThomasRaoux and
antiagainst
June 9, 2022 16:25
ScottTodd
approved these changes
Jun 9, 2022
benvanik
enabled auto-merge (squash)
June 9, 2022 16:32
jpienaar
pushed a commit
to jpienaar/iree
that referenced
this pull request
Jun 10, 2022
This adds the plumbing for creating devices by path specs in addition to creating them by driver-specific IDs. A helper was also added to create by ordinal to simplify tools that want to expose devices in a canonical form with other driver-specific tools. The creation methods also gain the ability to pass in key-value pair parameters. Drivers can now use these parameters to refine device selection and configure the devices during creation. The entire driver layer is optional so the extra string handling here is only in cases that desire it, and for devices that have no properties (like local-sync) it doesn't add a cost. A helper that parses a canonical device URI into the components for create_device_by_path was added as iree_hal_driver_create_device_by_uri and should be used by most hosting applications. For tooling and other one-shot situations an even more convienient iree_hal_create_device is added as an easy way to create devices with a massive footgun attached. This may explode when using multiple devices or recreating devices; the solution there is for the hosting application to create and cache the drivers it wants to ensure remain around. Progress on iree-org#9343.
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.
This adds the plumbing for creating devices by path specs in addition
to creating them by driver-specific IDs. A helper was also added to
create by ordinal to simplify tools that want to expose devices in a
canonical form with other driver-specific tools.
The creation methods also gain the ability to pass in key-value pair
parameters. Drivers can now use these parameters to refine device
selection and configure the devices during creation. The entire driver
layer is optional so the extra string handling here is only in cases that
desire it, and for devices that have no properties (like local-sync) it
doesn't add a cost.
A helper that parses a canonical device URI into the components for
create_device_by_path was added as iree_hal_driver_create_device_by_uri
and should be used by most hosting applications. For tooling and other
one-shot situations an even more convienient iree_hal_create_device is
added as an easy way to create devices with a massive footgun attached.
This may explode when using multiple devices or recreating devices; the
solution there is for the hosting application to create and cache the
drivers it wants to ensure remain around.
Progress on #9343.