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
2 changes: 1 addition & 1 deletion AdvantageBenchmark/privateBuild/host.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.Quantum.Sdk/0.15.2103131668-beta">
<Project Sdk="Microsoft.Quantum.Sdk/0.15.210324341-alpha">
<!-- Add project references to Simulator and other required packages: -->
<Import Project="..\..\src\Simulation\Common\Simulators.Dev.props" />

Expand Down
2 changes: 1 addition & 1 deletion AdvantageBenchmark/releasedBuild/quantum/quantum.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.Quantum.Sdk/0.15.2103131668-beta">
<Project Sdk="Microsoft.Quantum.Sdk/0.15.210324341-alpha">

<ItemGroup>
<QSharpCompile Include="..\..\privateBuild\quantum.qs" />
Expand Down
91 changes: 91 additions & 0 deletions Simulation.sln
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,24 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "QIR-static", "QIR-static",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "qir-gen", "src\QirRuntime\test\QIR-static\qsharp\qir-gen.csproj", "{DC69B7C8-7B25-4C12-878A-DF59722C306E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "FullstateSimulator", "FullstateSimulator", "{932E88FC-AB51-449D-937E-BB3050DF37C9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "qir-test-simulator", "src\QirRuntime\test\FullstateSimulator\qsharp\qir-test-simulator.csproj", "{D529DE2B-C65B-4B89-82F3-FF712BC832BC}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "QIR-dynamic", "QIR-dynamic", "{E0DE8EF7-A587-4D02-8813-B344365E5CF8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "qir-test-random", "src\QirRuntime\test\QIR-dynamic\qsharp\qir-test-random.csproj", "{9FCFB543-A126-41DF-80A3-40A6AFBA4F4F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "QIR-tracer", "QIR-tracer", "{99C04F12-B449-4832-BFD6-FE5E91BAE393}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tracer-qir", "src\QirRuntime\test\QIR-tracer\qsharp\tracer-qir.csproj", "{390608C0-35C4-4E81-8BF8-91F9EA9C1CDA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{306E9DC4-15F6-4D98-8846-34EBBBC45CB0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "StandaloneInputReference", "StandaloneInputReference", "{700A1D87-D0DE-4621-A6CD-3DC0AA47D492}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "qir-standalone-input-reference", "src\QirRuntime\samples\StandaloneInputReference\qsharp\qir-standalone-input-reference.csproj", "{91DF2E6D-65C1-478E-A276-337A40ADB1FB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -667,6 +685,70 @@ Global
{DC69B7C8-7B25-4C12-878A-DF59722C306E}.RelWithDebInfo|Any CPU.Build.0 = Debug|Any CPU
{DC69B7C8-7B25-4C12-878A-DF59722C306E}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU
{DC69B7C8-7B25-4C12-878A-DF59722C306E}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU
{D529DE2B-C65B-4B89-82F3-FF712BC832BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D529DE2B-C65B-4B89-82F3-FF712BC832BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D529DE2B-C65B-4B89-82F3-FF712BC832BC}.Debug|x64.ActiveCfg = Debug|Any CPU
{D529DE2B-C65B-4B89-82F3-FF712BC832BC}.Debug|x64.Build.0 = Debug|Any CPU
{D529DE2B-C65B-4B89-82F3-FF712BC832BC}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU
{D529DE2B-C65B-4B89-82F3-FF712BC832BC}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU
{D529DE2B-C65B-4B89-82F3-FF712BC832BC}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU
{D529DE2B-C65B-4B89-82F3-FF712BC832BC}.MinSizeRel|x64.Build.0 = Debug|Any CPU
{D529DE2B-C65B-4B89-82F3-FF712BC832BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D529DE2B-C65B-4B89-82F3-FF712BC832BC}.Release|Any CPU.Build.0 = Release|Any CPU
{D529DE2B-C65B-4B89-82F3-FF712BC832BC}.Release|x64.ActiveCfg = Release|Any CPU
{D529DE2B-C65B-4B89-82F3-FF712BC832BC}.Release|x64.Build.0 = Release|Any CPU
{D529DE2B-C65B-4B89-82F3-FF712BC832BC}.RelWithDebInfo|Any CPU.ActiveCfg = Debug|Any CPU
{D529DE2B-C65B-4B89-82F3-FF712BC832BC}.RelWithDebInfo|Any CPU.Build.0 = Debug|Any CPU
{D529DE2B-C65B-4B89-82F3-FF712BC832BC}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU
{D529DE2B-C65B-4B89-82F3-FF712BC832BC}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU
{9FCFB543-A126-41DF-80A3-40A6AFBA4F4F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9FCFB543-A126-41DF-80A3-40A6AFBA4F4F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9FCFB543-A126-41DF-80A3-40A6AFBA4F4F}.Debug|x64.ActiveCfg = Debug|Any CPU
{9FCFB543-A126-41DF-80A3-40A6AFBA4F4F}.Debug|x64.Build.0 = Debug|Any CPU
{9FCFB543-A126-41DF-80A3-40A6AFBA4F4F}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU
{9FCFB543-A126-41DF-80A3-40A6AFBA4F4F}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU
{9FCFB543-A126-41DF-80A3-40A6AFBA4F4F}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU
{9FCFB543-A126-41DF-80A3-40A6AFBA4F4F}.MinSizeRel|x64.Build.0 = Debug|Any CPU
{9FCFB543-A126-41DF-80A3-40A6AFBA4F4F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9FCFB543-A126-41DF-80A3-40A6AFBA4F4F}.Release|Any CPU.Build.0 = Release|Any CPU
{9FCFB543-A126-41DF-80A3-40A6AFBA4F4F}.Release|x64.ActiveCfg = Release|Any CPU
{9FCFB543-A126-41DF-80A3-40A6AFBA4F4F}.Release|x64.Build.0 = Release|Any CPU
{9FCFB543-A126-41DF-80A3-40A6AFBA4F4F}.RelWithDebInfo|Any CPU.ActiveCfg = Debug|Any CPU
{9FCFB543-A126-41DF-80A3-40A6AFBA4F4F}.RelWithDebInfo|Any CPU.Build.0 = Debug|Any CPU
{9FCFB543-A126-41DF-80A3-40A6AFBA4F4F}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU
{9FCFB543-A126-41DF-80A3-40A6AFBA4F4F}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU
{390608C0-35C4-4E81-8BF8-91F9EA9C1CDA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{390608C0-35C4-4E81-8BF8-91F9EA9C1CDA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{390608C0-35C4-4E81-8BF8-91F9EA9C1CDA}.Debug|x64.ActiveCfg = Debug|Any CPU
{390608C0-35C4-4E81-8BF8-91F9EA9C1CDA}.Debug|x64.Build.0 = Debug|Any CPU
{390608C0-35C4-4E81-8BF8-91F9EA9C1CDA}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU
{390608C0-35C4-4E81-8BF8-91F9EA9C1CDA}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU
{390608C0-35C4-4E81-8BF8-91F9EA9C1CDA}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU
{390608C0-35C4-4E81-8BF8-91F9EA9C1CDA}.MinSizeRel|x64.Build.0 = Debug|Any CPU
{390608C0-35C4-4E81-8BF8-91F9EA9C1CDA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{390608C0-35C4-4E81-8BF8-91F9EA9C1CDA}.Release|Any CPU.Build.0 = Release|Any CPU
{390608C0-35C4-4E81-8BF8-91F9EA9C1CDA}.Release|x64.ActiveCfg = Release|Any CPU
{390608C0-35C4-4E81-8BF8-91F9EA9C1CDA}.Release|x64.Build.0 = Release|Any CPU
{390608C0-35C4-4E81-8BF8-91F9EA9C1CDA}.RelWithDebInfo|Any CPU.ActiveCfg = Debug|Any CPU
{390608C0-35C4-4E81-8BF8-91F9EA9C1CDA}.RelWithDebInfo|Any CPU.Build.0 = Debug|Any CPU
{390608C0-35C4-4E81-8BF8-91F9EA9C1CDA}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU
{390608C0-35C4-4E81-8BF8-91F9EA9C1CDA}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU
{91DF2E6D-65C1-478E-A276-337A40ADB1FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{91DF2E6D-65C1-478E-A276-337A40ADB1FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{91DF2E6D-65C1-478E-A276-337A40ADB1FB}.Debug|x64.ActiveCfg = Debug|Any CPU
{91DF2E6D-65C1-478E-A276-337A40ADB1FB}.Debug|x64.Build.0 = Debug|Any CPU
{91DF2E6D-65C1-478E-A276-337A40ADB1FB}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU
{91DF2E6D-65C1-478E-A276-337A40ADB1FB}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU
{91DF2E6D-65C1-478E-A276-337A40ADB1FB}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU
{91DF2E6D-65C1-478E-A276-337A40ADB1FB}.MinSizeRel|x64.Build.0 = Debug|Any CPU
{91DF2E6D-65C1-478E-A276-337A40ADB1FB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{91DF2E6D-65C1-478E-A276-337A40ADB1FB}.Release|Any CPU.Build.0 = Release|Any CPU
{91DF2E6D-65C1-478E-A276-337A40ADB1FB}.Release|x64.ActiveCfg = Release|Any CPU
{91DF2E6D-65C1-478E-A276-337A40ADB1FB}.Release|x64.Build.0 = Release|Any CPU
{91DF2E6D-65C1-478E-A276-337A40ADB1FB}.RelWithDebInfo|Any CPU.ActiveCfg = Debug|Any CPU
{91DF2E6D-65C1-478E-A276-337A40ADB1FB}.RelWithDebInfo|Any CPU.Build.0 = Debug|Any CPU
{91DF2E6D-65C1-478E-A276-337A40ADB1FB}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU
{91DF2E6D-65C1-478E-A276-337A40ADB1FB}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -711,6 +793,15 @@ Global
{E9FC86D7-DBE1-44B8-BF7F-61109E1AFE86} = {223F1FAE-5551-4237-AE8A-73502B007003}
{9BED35A6-3FBF-4A55-8424-C801BEB64D68} = {E9FC86D7-DBE1-44B8-BF7F-61109E1AFE86}
{DC69B7C8-7B25-4C12-878A-DF59722C306E} = {9BED35A6-3FBF-4A55-8424-C801BEB64D68}
{932E88FC-AB51-449D-937E-BB3050DF37C9} = {E9FC86D7-DBE1-44B8-BF7F-61109E1AFE86}
{D529DE2B-C65B-4B89-82F3-FF712BC832BC} = {932E88FC-AB51-449D-937E-BB3050DF37C9}
{E0DE8EF7-A587-4D02-8813-B344365E5CF8} = {E9FC86D7-DBE1-44B8-BF7F-61109E1AFE86}
{9FCFB543-A126-41DF-80A3-40A6AFBA4F4F} = {E0DE8EF7-A587-4D02-8813-B344365E5CF8}
{99C04F12-B449-4832-BFD6-FE5E91BAE393} = {E9FC86D7-DBE1-44B8-BF7F-61109E1AFE86}
{390608C0-35C4-4E81-8BF8-91F9EA9C1CDA} = {99C04F12-B449-4832-BFD6-FE5E91BAE393}
{306E9DC4-15F6-4D98-8846-34EBBBC45CB0} = {223F1FAE-5551-4237-AE8A-73502B007003}
{700A1D87-D0DE-4621-A6CD-3DC0AA47D492} = {306E9DC4-15F6-4D98-8846-34EBBBC45CB0}
{91DF2E6D-65C1-478E-A276-337A40ADB1FB} = {700A1D87-D0DE-4621-A6CD-3DC0AA47D492}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {929C0464-86D8-4F70-8835-0A5EAF930821}
Expand Down
36 changes: 25 additions & 11 deletions src/QirRuntime/build-qir-runtime.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,33 @@
# Licensed under the MIT License.

& (Join-Path $PSScriptRoot .. .. build set-env.ps1)
Write-Host "##[info]Compile Q# Projects into QIR"
$qirStaticPath = Join-Path $PSScriptRoot test QIR-static qsharp
if (!(Test-Path (Join-Path $qirStaticPath qir *.ll))) {
Write-Host "##[info]Build Q# project for QIR tests"
dotnet build $qirStaticPath -c $Env:BUILD_CONFIGURATION -v $Env:BUILD_VERBOSITY
if ($LastExitCode -ne 0) {
Write-Host "##vso[task.logissue type=error;]Failed to compile Q# project at '$qirStaticPath' into QIR."
throw "Failed to compile Q# project at '$qirStaticPath' into QIR."

function Build-QirProject {
param (
[string]
$FolderPath
)

if (!(Test-Path (Join-Path $FolderPath qir *.ll))) {
Write-Host "##[info]Build Q# project for QIR tests '$FolderPath'"
dotnet build $FolderPath -c $Env:BUILD_CONFIGURATION -v $Env:BUILD_VERBOSITY
if ($LastExitCode -ne 0) {
Write-Host "##vso[task.logissue type=error;]Failed to compile Q# project at '$FolderPath' into QIR."
throw "Failed to compile Q# project at '$FolderPath' into QIR."
}
}
Copy-Item -Path (Join-Path $FolderPath qir *.ll) -Destination (Split-Path $FolderPath -Parent)
# Also copy to drops so it ends up in build artifacts, for easier post-build debugging.
Copy-Item -Path (Join-Path $FolderPath qir *.ll) -Destination $Env:DROPS_DIR
}
Copy-Item -Path (Join-Path $qirStaticPath qir *.ll) -Destination (Split-Path $qirStaticPath -Parent)
# Also copy to drops so it ends up in build artifacts, for easier post-build debugging.
Copy-Item -Path (Join-Path $qirStaticPath qir *.ll) -Destination $Env:DROPS_DIR

Write-Host "##[info]Compile Q# Projects into QIR"
Build-QirProject (Join-Path $PSScriptRoot test QIR-static qsharp)
Build-QirProject (Join-Path $PSScriptRoot test QIR-dynamic qsharp)
Build-QirProject (Join-Path $PSScriptRoot test QIR-tracer qsharp)
Build-QirProject (Join-Path $PSScriptRoot test FullstateSimulator qsharp)
Build-QirProject (Join-Path $PSScriptRoot samples StandaloneInputReference qsharp)


Write-Host "##[info]Build QIR Runtime"
$oldCC = $env:CC
Expand Down
2 changes: 2 additions & 0 deletions src/QirRuntime/lib/QIR/arrays.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ extern "C"

qa->ownsQubits = false;
}

quantum__rt__array_update_reference_count(qa, -1);
}

QirArray* quantum__rt__array_create_1d(int32_t itemSizeInBytes, int64_t count_items)
Expand Down
Loading