Skip to content

Adding IREE_EXTERNAL_HAL_DRIVERS cmake var. - #9380

Merged
benvanik merged 1 commit into
mainfrom
benvanik-external-hal-drivers
Jun 8, 2022
Merged

benvanik merged 1 commit into
mainfrom
benvanik-external-hal-drivers

Conversation

@benvanik

@benvanik benvanik commented Jun 8, 2022 •

Copy link
Copy Markdown
Collaborator

This allows for out-of-tree drivers by specifying the static library
target and registration function, ala LLVM_EXTERNAL_PROJECTS.

To test this the ROCM driver has been moved to an external driver and can
be enabled with -DIREE_EXTERNAL_HAL_DRIVERS=rocm during cmake config.
Note that now there's no need to change any IREE files to add a driver; the
targets can be defined before IREE is added as a subproject or will be included
via vars to allow for specifying the driver purely via cmake flags.

With some bazel work we'd be able to make the internal drivers work this
way too and remove a lot of boilerplate. For now the existing options are
preserved.

Fixes #9336.

@benvanik benvanik added infrastructure Relating to build systems, CI, or testing runtime Relating to the IREE runtime library labels Jun 8, 2022
@benvanik
benvanik requested a review from ScottTodd June 8, 2022 00:11
@benvanik

benvanik commented Jun 8, 2022

Copy link
Copy Markdown
Collaborator Author

/cc @powderluv I think this gives you what you want 🤞

This allows for out-of-tree drivers by specifying the static library
target and registration function, ala LLVM_EXTERNAL_PROJECTS.

To test this the ROCM driver has been moved to an external driver and can
be enabled with -DIREE_EXTERNAL_HAL_DRIVERS=rocm during cmake config.

With some bazel work we'd be able to make the internal drivers work this
way too and remove a lot of boilerplate. For now the existing options are
preserved.
@benvanik
benvanik force-pushed the benvanik-external-hal-drivers branch from f4eca54 to 4e6af05 Compare June 8, 2022 00:26
@benvanik
benvanik marked this pull request as ready for review June 8, 2022 00:26
@benvanik
benvanik enabled auto-merge June 8, 2022 04:35

@ScottTodd ScottTodd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@benvanik
benvanik merged commit 2474ecc into main Jun 8, 2022
@benvanik
benvanik deleted the benvanik-external-hal-drivers branch June 8, 2022 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infrastructure Relating to build systems, CI, or testing runtime Relating to the IREE runtime library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for external HAL modules

2 participants