-
Notifications
You must be signed in to change notification settings - Fork 90
Refactor QIR runtime CMakeLists and dynamic libraries #549
Conversation
4576d00 to
2ed8c91
Compare
|
Of note: we want to pick better names than |
|
|
Yeah, I agree that
No, I don't expect there will be more under
QIR itself is not Q# specific, which is an important point worth doubling down on. Alan's blog post announcing QIR put it very directly:
That idea was part of what motivated me to make this split into multiple dlls in the first place. Having a set of gates defined in the QIR runtime, even if it's intended as an optional interface developers can choose not to inherit from, implies tying the infrastructure to a specific quantum hardware. So the idea was to separate the quantum gates from the rest and make it easy for someone to swap in a different set of intrinsic gates. That said, I'm realizing on further review that there is still some mixing going on here, because while everything defined in the runtime (prefixed with Edit: Removed some misunderstandings regarding which parts are Q# specific. |
kuzminrobin
left a comment
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.
Impressive number of changes.
|
Just thinking out loud here, but I wonder if it makes sense to split this out even further, perhaps into another repo (yes, I know the last thing we want is another repo, but hear me out). Everything that is part of @bettinaheim, @alan-geller Any thoughts on this? |
| @@ -0,0 +1 @@ | |||
| Checks: '-*,bugprone-*' No newline at end of file | |||
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.
I am wondering what were the specific reasons for not using the parent's clang-tidy configuration?
One pattern that might be useful if it is just a couple of checks that are different from the parent configuration would be using InheritParentConfig: true and adding/removing the necessary checks.
cesarzc
left a comment
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.
This change is great! I am a fan of the new naming convention and the ability to do dynamic linking :)
This change introduces a refactor and fixup of the CMake infrastructure and powershell scripts for our QirRuntime build. This is part of the work needed to address #544. In particular, it splits out what was one dynamic library target, qdk, and turns it into three targets for the main QIR runtime, the QSharp Core functionality (intrinsic gates and simulator), and the QIR tracer. It fixes the generation of that dll by including additional support for
dllexportwhen compiling on Windows and updates the corresponding IR files to also properly export API. The test for dynamic loading was subtly incorrect in a way that resulted in actually statically linking the dependencies, so this adjusts the test CMake to more explicitly use dynamic linking.Renaming any variables and refactoring tests further into their own separate CMake project were out of scope for this change and will be addressed in a later PR.