Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions examples/QIR/Development/Development.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.Quantum.Sdk/0.18.2107151063-beta">
<Project Sdk="Microsoft.Quantum.Sdk/0.20.2110171573">

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

<PropertyGroup>
Expand Down Expand Up @@ -136,6 +136,7 @@
<ItemGroup>
<_QirRuntimeLibFiles Include="$(QirRuntimeLibs)/**/*.*" Exclude="$(QirRuntimeLibs)/**/*.exe" />
<_QirRuntimeHeaderFiles Include="$(QirRuntimeHeaders)/**/*.hpp" />
<_QirRuntimeHeaderFiles Include="$(QirRuntimeHeaders)/**/*.h" />
</ItemGroup>
<Copy SourceFiles="$(SimulatorRuntime)" DestinationFolder="$(BuildOutputPath)" SkipUnchangedFiles="true" />
<Copy SourceFiles="@(_QirRuntimeLibFiles)" DestinationFolder="$(BuildOutputPath)\%(RecursiveDir)" SkipUnchangedFiles="true" />
Expand Down
2 changes: 1 addition & 1 deletion examples/QIR/Emission/Emission.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.Quantum.Sdk/0.18.2107151063-beta">
<Project Sdk="Microsoft.Quantum.Sdk/0.20.2110171573">

<PropertyGroup>
<QscVerbosity>Detailed</QscVerbosity>
Expand Down
2 changes: 1 addition & 1 deletion src/QsCompiler/QirGeneration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ To enable QIR emission, open the project file in a text editor and add the follo
```
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:
```
<Project Sdk="Microsoft.Quantum.Sdk/0.18.2107151063-beta">
<Project Sdk="Microsoft.Quantum.Sdk/0.20.2110171573">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.18.210932364-alpha" />
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.20.2110171573" />
</ItemGroup>

<Import Project="$(MSBuildThisFileDirectory)../build/Library.props" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.18.210932364-alpha" />
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.20.2110171573" />
</ItemGroup>

<Import Project="$(MSBuildThisFileDirectory)../build/Library.props" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.Quantum.Sdk/0.18.2107151063-beta">
<Project Sdk="Microsoft.Quantum.Sdk/0.20.2110171573">
<PropertyGroup>
<QscVerbosity>Detailed</QscVerbosity>
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Microsoft.Quantum.QsCompiler.Testing.Qir
public static class JitCompilation
{
[DllImport("Microsoft.Quantum.Qir.QSharp.Core", ExactSpelling = true, CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
public static extern IntPtr CreateFullstateSimulator(long seed);
public static extern IntPtr CreateFullstateSimulatorC(long seed);

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

if (!File.Exists(pathToBitcode))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
<PackageReference Include="libLLVM.runtime.osx-x64" Version="11.0.0" PrivateAssets="All" />
<PackageReference Include="libLLVM.runtime.ubuntu.20.04-x64" Version="11.0.0" PrivateAssets="All" />
<PackageReference Include="libLLVM.runtime.ubuntu.18.04-x64" Version="11.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.Quantum.Qir.Runtime" Version="0.18.210932364-alpha" ExcludeAssets="all" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.18.210932364-alpha" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.Quantum.Qir.Runtime" Version="0.20.2110171573-alpha" ExcludeAssets="all" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.20.2110171573" GeneratePathProperty="true" />
</ItemGroup>

<Target Name="PrepareReferenceTests" Condition="'$(DesignTimeBuild)' != 'true'" BeforeTargets="CoreCompile">
Expand Down
4 changes: 2 additions & 2 deletions src/QsCompiler/Tests.Compiler/Tests.Compiler.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -563,8 +563,8 @@
<PackageReference Include="libLLVM.runtime.osx-x64" Version="11.0.0" PrivateAssets="All" />
<PackageReference Include="libLLVM.runtime.ubuntu.20.04-x64" Version="11.0.0" PrivateAssets="All" />
<PackageReference Include="libLLVM.runtime.ubuntu.18.04-x64" Version="11.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.Quantum.Qir.Runtime" Version="0.18.210932364-alpha" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.18.210932364-alpha" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.Quantum.Qir.Runtime" Version="0.20.2110171573-alpha" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.20.2110171573" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<PropertyGroup>
<QscVerbosity>Normal</QscVerbosity>
<CSharpGeneration>true</CSharpGeneration> <!-- at some point we may want to make False the default -->
<EnableQirSubmission>false</EnableQirSubmission>
<IncludeQSharpCorePackages>true</IncludeQSharpCorePackages>
<IncludeProviderPackages>true</IncludeProviderPackages>
<IncludeCSharpRuntime>true</IncludeCSharpRuntime>
Expand Down
29 changes: 23 additions & 6 deletions src/QuantumSdk/DefaultItems/DefaultItems.targets
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

<!-- Initializing the ResolvedProcessorArchitecture to either HoneywellProcessor, IonQProcessor, QCIProcessor, MicrosoftSimulator or Unspecified.-->
<PropertyGroup>
<!-- These architectures are in production and available for public use. -->
<ResolvedProcessorArchitecture Condition="('$(ResolvedQSharpOutputType)' == 'QSharpExe' Or '$(NoEntryPoint)' == 'true') And $(ExecutionTarget.StartsWith('honeywell'))">HoneywellProcessor</ResolvedProcessorArchitecture>
<ResolvedProcessorArchitecture Condition="('$(ResolvedQSharpOutputType)' == 'QSharpExe' Or '$(NoEntryPoint)' == 'true') And $(ExecutionTarget.StartsWith('ionq'))">IonQProcessor</ResolvedProcessorArchitecture>
<ResolvedProcessorArchitecture Condition="('$(ResolvedQSharpOutputType)' == 'QSharpExe' Or '$(NoEntryPoint)' == 'true') And $(ExecutionTarget.StartsWith('qci'))">QCIProcessor</ResolvedProcessorArchitecture>
Expand All @@ -38,13 +39,19 @@
<ResolvedProcessorArchitecture Condition="'$(ResolvedProcessorArchitecture)' != 'HoneywellProcessor' And '$(ResolvedProcessorArchitecture)' != 'IonQProcessor' And '$(ResolvedProcessorArchitecture)' != 'QCIProcessor' And '$(ResolvedProcessorArchitecture)' != 'Unspecified' And '$(ResolvedProcessorArchitecture)' != 'MicrosoftSimulator'"></ResolvedProcessorArchitecture>
<ValidExecutionTargets Condition="'$(ResolvedQSharpOutputType)' == 'QSharpExe' Or '$(NoEntryPoint)' == 'true'">Possible values must match 'ionq*', 'honeywell*', 'qci*', 'microsoft.simulator*', or 'Any'.</ValidExecutionTargets>
<ValidExecutionTargets Condition="'$(ResolvedQSharpOutputType)' == 'QSharpLibrary'">The execution target for a Q# library needs to be 'Any'.</ValidExecutionTargets>
<!--
These architectures are currently under active development and not available for public use yet.
Targeting is disabled since the code will be targeted by the QIR compiler, and Q# diagnostics are not yet enabled for these architectures.
-->
<ResolvedProcessorArchitecture Condition="('$(ResolvedQSharpOutputType)' == 'QSharpExe' Or '$(NoEntryPoint)' == 'true') And $(ExecutionTarget.StartsWith('honeywell.qir'))">HoneywellQirProcessor</ResolvedProcessorArchitecture>
<ResolvedProcessorArchitecture Condition="('$(ResolvedQSharpOutputType)' == 'QSharpExe' Or '$(NoEntryPoint)' == 'true') And $(ExecutionTarget.StartsWith('qci.qir'))">QCIQirProcessor</ResolvedProcessorArchitecture>
</PropertyGroup>

<!-- Resolving the QuantumIntrinsics to either Type1, Type2, Type3, or Default.-->
<PropertyGroup>
<ResolvedQuantumIntrinsics Condition="'$(ResolvedProcessorArchitecture)' == 'HoneywellProcessor'">Type1</ResolvedQuantumIntrinsics>
<ResolvedQuantumIntrinsics Condition="'$(ResolvedProcessorArchitecture)' == 'HoneywellProcessor' Or '$(ResolvedProcessorArchitecture)' == 'HoneywellQirProcessor'">Type1</ResolvedQuantumIntrinsics>
<ResolvedQuantumIntrinsics Condition="'$(ResolvedProcessorArchitecture)' == 'IonQProcessor'">Type2</ResolvedQuantumIntrinsics>
<ResolvedQuantumIntrinsics Condition="'$(ResolvedProcessorArchitecture)' == 'QCIProcessor'">Type3</ResolvedQuantumIntrinsics>
<ResolvedQuantumIntrinsics Condition="'$(ResolvedProcessorArchitecture)' == 'QCIProcessor' Or '$(ResolvedProcessorArchitecture)' == 'QCIQirProcessor'">Type3</ResolvedQuantumIntrinsics>
<ResolvedQuantumIntrinsics Condition="'$(ResolvedProcessorArchitecture)' == 'MicrosoftSimulator'">Default</ResolvedQuantumIntrinsics>
<ResolvedQuantumIntrinsics Condition="'$(ResolvedProcessorArchitecture)' != 'HoneywellProcessor' And '$(ResolvedProcessorArchitecture)' != 'IonQProcessor' And '$(ResolvedProcessorArchitecture)' != 'QCIProcessor'">Default</ResolvedQuantumIntrinsics>
</PropertyGroup>
Expand All @@ -71,6 +78,7 @@
<QSharpDocsGeneration Condition="'$(QSharpDocsOutputPath)' != '' And '$(QSharpDocsGeneration)' == 'default'">true</QSharpDocsGeneration>
<QSharpDocsGeneration Condition="'$(QSharpDocsOutputPath)' == '' And '$(QSharpDocsGeneration)' == 'default'">false</QSharpDocsGeneration>
<CSharpGeneration Condition="$(QirGeneration)">false</CSharpGeneration>
<EnableQirSubmission Condition="'$(ResolvedProcessorArchitecture)' == 'MicrosoftSimulator' Or $(ResolvedProcessorArchitecture.Contains('QirProcessor'))">true</EnableQirSubmission>
<!-- path compatible assembly name -->
<PathCompatibleAssemblyName>$([System.String]::Copy('$(AssemblyName)').Replace(' ',''))</PathCompatibleAssemblyName>
<!-- output path for files generated during compilation -->
Expand All @@ -96,7 +104,7 @@
</PropertyGroup>


<!-- Computes the ResolvedTargetSpecificDecompositions property. Generates a build error if more than one target package has been specified. -->
<!-- Populates the ResolvedTargetSpecificDecompositions item group. -->
<Target Name="ResolveTargetPackage" DependsOnTargets="ResolveProjectReferences;ResolveAssemblyReferences" BeforeTargets="BeforeQSharpCompile">
<ItemGroup>
<ResolvedTargetSpecificDecompositions Include="@(_ResolvedProjectReferencePaths)" Condition="@(_ResolvedProjectReferencePaths->Count()) &gt; 0 And %(_ResolvedProjectReferencePaths.IsTargetPackage)" />
Expand All @@ -107,17 +115,26 @@
<_ResolvedTargetPackageReference Include="$(%(_TargetPackageReferencePathProperty.Identity))" />
<ResolvedTargetSpecificDecompositions Include="@(_ResolvedTargetPackageReference->Split(`;`))" />
</ItemGroup>
<Error Condition="@(ResolvedTargetSpecificDecompositions->Count()) &gt; 1" Text="More than one target package was defined. The defined target package needs to be unique." />
<Error
Condition="@(ResolvedTargetSpecificDecompositions->Count()) == 0 And @(_ResolvedTargetPackageReference->Count()) &gt; 0"
Text="Invalid target package. The target package is expected to specify the dll containing the decompositions to load." />
<Message
Condition="@(ResolvedTargetSpecificDecompositions->Count()) &gt; 0 And ('$(QscVerbosity)' == 'Detailed' Or '$(QscVerbosity)' == 'Diagnostic')"
Text="Resolved target package assembly: @(ResolvedTargetSpecificDecompositions)"
Text="Resolved target package assemblies: @(ResolvedTargetSpecificDecompositions)"
Importance="High" />
</Target>

<!-- Computes ResolvedQscReferences, ResolvedQscReferencesAndPriorities, QscProjectReference and QscPackageReference. -->
<!-- Populates the ResolvedQSharpReferences item group. -->
<Target Name="ResolveQSharpReferences" DependsOnTargets="ResolveTargetPackage;ResolveAssemblyReferences;_CopyFilesMarkedCopyLocal" BeforeTargets="BeforeQSharpCompile">
<ItemGroup>
<ResolvedQSharpReferences
Include="@(ReferencePath)"
Exclude="@(ResolvedTargetSpecificDecompositions)"
Condition="$([System.Text.RegularExpressions.Regex]::IsMatch(%(FullPath), '(?i)system.|mscorlib|netstandard.library|microsoft.netcore.app|csharp|fsharp|microsoft.visualstudio|microsoft.testplatform|microsoft.codeanalysis|fparsec|newtonsoft|roslynwrapper|yamldotnet|markdig|serilog')) == false" />
</ItemGroup>
</Target>

<!-- Populates ResolvedQscReferences, ResolvedQscReferencesAndPriorities, QscProjectReference and QscPackageReference. -->
<Target Name="ResolveQscReferences" DependsOnTargets="ResolveProjectReferences;ResolveAssemblyReferences" BeforeTargets="BeforeQSharpCompile">
<!-- get the assembly path for all relevant project references which are passed as qsc references -->
<ItemGroup>
Expand Down
Loading