Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Commit 4f378ac

Browse files
bettinaheimRyan Moreno (HE/HIM)
authored andcommitted
Sdk changes to support Qir targets (#1238)
1 parent 1523359 commit 4f378ac

File tree

13 files changed

+65
-50
lines changed

13 files changed

+65
-50
lines changed

examples/QIR/Development/Development.csproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.Quantum.Sdk/0.18.2107151063-beta">
1+
<Project Sdk="Microsoft.Quantum.Sdk/0.20.2110171573">
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
@@ -20,8 +20,8 @@
2020
<PackageReference Condition="$([MSBuild]::IsOsPlatform('Linux')) And '$(UbuntuVersion)' != '18.04'"
2121
Include="libLLVM.runtime.ubuntu.20.04-x64" Version="11.0.0"
2222
PrivateAssets="All" GeneratePathProperty="true" />
23-
<PackageReference Include="Microsoft.Quantum.Qir.Runtime" Version="0.18.2107151063-alpha" GeneratePathProperty="true" />
24-
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.18.2107151063-beta" GeneratePathProperty="true" />
23+
<PackageReference Include="Microsoft.Quantum.Qir.Runtime" Version="0.20.2110171573-alpha" GeneratePathProperty="true" />
24+
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.20.2110171573" GeneratePathProperty="true" />
2525
</ItemGroup>
2626

2727
<PropertyGroup>
@@ -136,6 +136,7 @@
136136
<ItemGroup>
137137
<_QirRuntimeLibFiles Include="$(QirRuntimeLibs)/**/*.*" Exclude="$(QirRuntimeLibs)/**/*.exe" />
138138
<_QirRuntimeHeaderFiles Include="$(QirRuntimeHeaders)/**/*.hpp" />
139+
<_QirRuntimeHeaderFiles Include="$(QirRuntimeHeaders)/**/*.h" />
139140
</ItemGroup>
140141
<Copy SourceFiles="$(SimulatorRuntime)" DestinationFolder="$(BuildOutputPath)" SkipUnchangedFiles="true" />
141142
<Copy SourceFiles="@(_QirRuntimeLibFiles)" DestinationFolder="$(BuildOutputPath)\%(RecursiveDir)" SkipUnchangedFiles="true" />

examples/QIR/Emission/Emission.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.Quantum.Sdk/0.18.2107151063-beta">
1+
<Project Sdk="Microsoft.Quantum.Sdk/0.20.2110171573">
22

33
<PropertyGroup>
44
<QscVerbosity>Detailed</QscVerbosity>

src/QsCompiler/QirGeneration/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ To enable QIR emission, open the project file in a text editor and add the follo
1313
```
1414
If the project builds successfully, the .ll file containing QIR can be found in `qir` folder in the project folder. Alternatively, the folder path can be specified via the `QirOutputPath` project property. The project file should look similar to this:
1515
```
16-
<Project Sdk="Microsoft.Quantum.Sdk/0.18.2107151063-beta">
16+
<Project Sdk="Microsoft.Quantum.Sdk/0.20.2110171573">
1717
<PropertyGroup>
1818
<OutputType>Exe</OutputType>
1919
<TargetFramework>netcoreapp3.1</TargetFramework>

src/QsCompiler/TestTargets/Libraries/Library1/Library1.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.18.210932364-alpha" />
9+
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.20.2110171573" />
1010
</ItemGroup>
1111

1212
<Import Project="$(MSBuildThisFileDirectory)../build/Library.props" />

src/QsCompiler/TestTargets/Libraries/Library2/Library2.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.18.210932364-alpha" />
9+
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.20.2110171573" />
1010
</ItemGroup>
1111

1212
<Import Project="$(MSBuildThisFileDirectory)../build/Library.props" />

src/QsCompiler/TestTargets/Simulation/Example/Example.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.Quantum.Sdk/0.18.2107151063-beta">
1+
<Project Sdk="Microsoft.Quantum.Sdk/0.20.2110171573">
22
<PropertyGroup>
33
<QscVerbosity>Detailed</QscVerbosity>
44
<OutputType>Exe</OutputType>

src/QsCompiler/TestTargets/Simulation/Target/QirExecution.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace Microsoft.Quantum.QsCompiler.Testing.Qir
1313
public static class JitCompilation
1414
{
1515
[DllImport("Microsoft.Quantum.Qir.QSharp.Core", ExactSpelling = true, CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
16-
public static extern IntPtr CreateFullstateSimulator(long seed);
16+
public static extern IntPtr CreateFullstateSimulatorC(long seed);
1717

1818
[DllImport("Microsoft.Quantum.Qir.Runtime", ExactSpelling = true, CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
1919
public static extern void InitializeQirContext(IntPtr driver, bool trackAllocatedObjects);
@@ -33,7 +33,7 @@ public static void BuildAndRun(string pathToBitcode, params string[] functionNam
3333
// To get this line to work, I had to change the CreateFullstateSimulator API to use raw pointers instead of shared pointers,
3434
// and I had to update both calls to be "extern 'C'" otherwise name mangling makes then impossible to call here.
3535
// This should be revised more broadly as we move the runtime to a C-style API for ABI compatibility across langauges.
36-
InitializeQirContext(CreateFullstateSimulator(0), true);
36+
InitializeQirContext(CreateFullstateSimulatorC(0), true);
3737

3838
if (!File.Exists(pathToBitcode))
3939
{

src/QsCompiler/TestTargets/Simulation/Target/Simulation.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
<PackageReference Include="libLLVM.runtime.osx-x64" Version="11.0.0" PrivateAssets="All" />
2222
<PackageReference Include="libLLVM.runtime.ubuntu.20.04-x64" Version="11.0.0" PrivateAssets="All" />
2323
<PackageReference Include="libLLVM.runtime.ubuntu.18.04-x64" Version="11.0.0" PrivateAssets="All" />
24-
<PackageReference Include="Microsoft.Quantum.Qir.Runtime" Version="0.18.210932364-alpha" ExcludeAssets="all" GeneratePathProperty="true" />
25-
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.18.210932364-alpha" GeneratePathProperty="true" />
24+
<PackageReference Include="Microsoft.Quantum.Qir.Runtime" Version="0.20.2110171573-alpha" ExcludeAssets="all" GeneratePathProperty="true" />
25+
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.20.2110171573" GeneratePathProperty="true" />
2626
</ItemGroup>
2727

2828
<Target Name="PrepareReferenceTests" Condition="'$(DesignTimeBuild)' != 'true'" BeforeTargets="CoreCompile">

src/QsCompiler/Tests.Compiler/Tests.Compiler.fsproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,8 +563,8 @@
563563
<PackageReference Include="libLLVM.runtime.osx-x64" Version="11.0.0" PrivateAssets="All" />
564564
<PackageReference Include="libLLVM.runtime.ubuntu.20.04-x64" Version="11.0.0" PrivateAssets="All" />
565565
<PackageReference Include="libLLVM.runtime.ubuntu.18.04-x64" Version="11.0.0" PrivateAssets="All" />
566-
<PackageReference Include="Microsoft.Quantum.Qir.Runtime" Version="0.18.210932364-alpha" GeneratePathProperty="true" />
567-
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.18.210932364-alpha" GeneratePathProperty="true" />
566+
<PackageReference Include="Microsoft.Quantum.Qir.Runtime" Version="0.20.2110171573-alpha" GeneratePathProperty="true" />
567+
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.20.2110171573" GeneratePathProperty="true" />
568568
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
569569
<PackageReference Include="xunit" Version="2.4.1" />
570570
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">

src/QuantumSdk/DefaultItems/DefaultItems.props.v.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
<PropertyGroup>
3232
<QscVerbosity>Normal</QscVerbosity>
3333
<CSharpGeneration>true</CSharpGeneration> <!-- at some point we may want to make False the default -->
34+
<EnableQirSubmission>false</EnableQirSubmission>
3435
<IncludeQSharpCorePackages>true</IncludeQSharpCorePackages>
3536
<IncludeProviderPackages>true</IncludeProviderPackages>
3637
<IncludeCSharpRuntime>true</IncludeCSharpRuntime>

0 commit comments

Comments
 (0)