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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ bld/
[Ll]og/
[Dd]rops/
[Dd]ocs/
**/qir-gen.ll

# Visual Studio 2015/2017 cache/options directory
.vs/
Expand Down
249 changes: 132 additions & 117 deletions Simulation.sln

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions bootstrap.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@ Push-Location (Join-Path $PSScriptRoot "build")
.\prerequisites.ps1
Pop-Location

# Temporary hack until switch qdk build pipeline to use the new build scripts (as a result it will build the native
# simulator twice, but the second build should be mostly noop)
if (($Env:CI -eq $null) -and ($Env:ENABLE_NATIVE -ne "false")) {
Push-Location (Join-Path $PSScriptRoot "src/Simulation/Native")
.\build-native-simulator.ps1
Pop-Location
}

if (-not (Test-Path Env:AGENT_OS)) {
if ($Env:ENABLE_NATIVE -ne "false") {
Write-Host "Build release flavor of the native simulator"
Expand Down
21 changes: 18 additions & 3 deletions build/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ if ($Env:ENABLE_NATIVE -ne "false") {
Write-Host "Skipping build of native simulator because ENABLE_NATIVE variable is set to: $Env:ENABLE_NATIVE."
}

if ($Env:ENABLE_QIRRUNTIME -ne "false") {
$qirRuntime = (Join-Path $PSScriptRoot "../src/Qir/Runtime")
& "$qirRuntime/build-qir-runtime.ps1"
if ($LastExitCode -ne 0) {
$script:all_ok = $False
}
} else {
Write-Host "Skipping build of qir runtime because ENABLE_QIRRUNTIME variable is set to: $Env:ENABLE_QIRRUNTIME"
}

function Build-One {
param(
[string]$action,
Expand Down Expand Up @@ -46,13 +56,18 @@ Build-One 'publish' '../src/Simulation/CSharpGeneration.App'
Build-One 'build' '../Simulation.sln'

if ($Env:ENABLE_QIRRUNTIME -ne "false") {
$qirRuntime = (Join-Path $PSScriptRoot "../src/Qir/Runtime")
& "$qirRuntime/build-qir-runtime.ps1"
$qirTests = (Join-Path $PSScriptRoot "../src/Qir/Tests")
& "$qirTests/build-qir-tests.ps1" -SkipQSharpBuild
if ($LastExitCode -ne 0) {
$script:all_ok = $False
}
$qirSamples = (Join-Path $PSScriptRoot "../src/Qir/Samples")
& "$qirSamples/build-qir-samples.ps1" -SkipQSharpBuild
if ($LastExitCode -ne 0) {
$script:all_ok = $False
}
} else {
Write-Host "Skipping build of qir runtime because ENABLE_QIRRUNTIME variable is set to: $Env:ENABLE_QIRRUNTIME"
Write-Host "Skipping build of qir tests because ENABLE_QIRRUNTIME variable is set to: $Env:ENABLE_QIRRUNTIME"
}

if (-not $all_ok) {
Expand Down
9 changes: 8 additions & 1 deletion build/manifest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ $artifacts = @{
"Microsoft.Quantum.QSharp.Core",
"Microsoft.Quantum.Type1.Core",
"Microsoft.Quantum.Type2.Core",
"Microsoft.Quantum.Type3.Core",
"Microsoft.Quantum.QSharp.Foundation"
"Microsoft.Quantum.Runtime.Core",
"Microsoft.Quantum.Simulators",
"Microsoft.Quantum.Xunit"
Expand All @@ -41,6 +43,7 @@ $artifacts = @{
".\src\Simulation\QSharpCore\bin\$Env:BUILD_CONFIGURATION\netstandard2.1\Microsoft.Quantum.QSharp.Core.dll",
".\src\Simulation\Type1Core\bin\$Env:BUILD_CONFIGURATION\netstandard2.1\Microsoft.Quantum.Type1.Core.dll",
".\src\Simulation\Type2Core\bin\$Env:BUILD_CONFIGURATION\netstandard2.1\Microsoft.Quantum.Type2.Core.dll",
".\src\Simulation\Type3Core\bin\$Env:BUILD_CONFIGURATION\netstandard2.1\Microsoft.Quantum.Type3.Core.dll",
".\src\Simulation\QSharpFoundation\bin\$Env:BUILD_CONFIGURATION\netstandard2.1\Microsoft.Quantum.QSharp.Foundation.dll",
".\src\Simulation\Simulators\bin\$Env:BUILD_CONFIGURATION\netstandard2.1\Microsoft.Quantum.Simulation.Common.dll",
".\src\Simulation\Simulators\bin\$Env:BUILD_CONFIGURATION\netstandard2.1\Microsoft.Quantum.Simulation.QCTraceSimulatorRuntime.dll",
Expand All @@ -49,7 +52,11 @@ $artifacts = @{
) | ForEach-Object { Join-Path $PSScriptRoot (Join-Path ".." $_) };

Native = @(
".\src\Simulation\Simulators\bin\$Env:BUILD_CONFIGURATION\netstandard2.1\Microsoft.Quantum.Simulator.Runtime.dll"
".\src\Simulation\Simulators\bin\$Env:BUILD_CONFIGURATION\netstandard2.1\Microsoft.Quantum.Simulator.Runtime.dll",
".\src\Qir\Runtime\build\$Env:BUILD_CONFIGURATION\bin\Microsoft.Quantum.Qir.QSharp.Core.dll",
".\src\Qir\Runtime\build\$Env:BUILD_CONFIGURATION\bin\Microsoft.Quantum.Qir.QSharp.Foundation.dll",
".\src\Qir\Runtime\build\$Env:BUILD_CONFIGURATION\bin\Microsoft.Quantum.Qir.Runtime.dll",
".\src\Qir\Runtime\build\$Env:BUILD_CONFIGURATION\bin\Microsoft.Quantum.Qir.Tracer.dll"
) | ForEach-Object { Join-Path $PSScriptRoot (Join-Path ".." $_) };
}

Expand Down
16 changes: 14 additions & 2 deletions build/test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,26 @@ if ($Env:ENABLE_QIRRUNTIME -ne "false") {
$script:all_ok = $False
}

$qirTests = (Join-Path $PSScriptRoot "../src/Qir/Tests")
& "$qirTests/test-qir-tests.ps1"
if ($LastExitCode -ne 0) {
$script:all_ok = $False
}

$qirSamples = (Join-Path $PSScriptRoot "../src/Qir/Samples")
& "$qirSamples/test-qir-samples.ps1"
if ($LastExitCode -ne 0) {
$script:all_ok = $False
}

$qirController = (Join-Path $PSScriptRoot "../src/Qir/Controller")
& "$qirController/test-qir-controller.ps1"

if ($LastExitCode -ne 0) {
$script:all_ok = $False
}
} else {
Write-Host "Skipping test of qir runtime because ENABLE_QIRRUNTIME variable is set to: $Env:ENABLE_QIRRUNTIME `
and ENABLE_NATIVE variable is set to: $Env:ENABLE_NATIVE."
Write-Host "Skipping test of qir runtime because ENABLE_QIRRUNTIME variable is set to: $Env:ENABLE_QIRRUNTIME."
}

if (-not $all_ok) {
Expand Down
74 changes: 37 additions & 37 deletions src/Qir/Runtime/.clang-format → src/Qir/.clang-format
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
---
Language: Cpp
BasedOnStyle: Microsoft
# page width
ColumnLimit: 120
ReflowComments: true
# tabs and indents
UseTab: Never
IndentWidth: 4
TabWidth: 4
AccessModifierOffset: -2
NamespaceIndentation: Inner
# line and statements layout
BreakBeforeBraces: Allman
BinPackParameters: false
AlignAfterOpenBracket: AlwaysBreak
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortFunctionsOnASingleLine: Empty
AllowAllConstructorInitializersOnNextLine: false
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeComma
# misc
Cpp11BracedListStyle: true
FixNamespaceComments: true
IncludeBlocks: Preserve
SpaceBeforeInheritanceColon : true
SpaceBeforeParens: ControlStatements
DerivePointerAlignment: false
PointerAlignment: Left
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html

---
Language: Cpp
BasedOnStyle: Microsoft

# page width
ColumnLimit: 120
ReflowComments: true

# tabs and indents
UseTab: Never
IndentWidth: 4
TabWidth: 4
AccessModifierOffset: -2
NamespaceIndentation: Inner

# line and statements layout
BreakBeforeBraces: Allman
BinPackParameters: false
AlignAfterOpenBracket: AlwaysBreak
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortFunctionsOnASingleLine: Empty
AllowAllConstructorInitializersOnNextLine: false
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeComma

# misc
Cpp11BracedListStyle: true
FixNamespaceComments: true
IncludeBlocks: Preserve
SpaceBeforeInheritanceColon : true
SpaceBeforeParens: ControlStatements
DerivePointerAlignment: false
PointerAlignment: Left
58 changes: 29 additions & 29 deletions src/Qir/Runtime/.clang-tidy → src/Qir/.clang-tidy
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
Checks:
'-*,bugprone-*,-readability-*,readability-identifier-*,readability-braces-around-statements'
WarningsAsErrors: '*'
HeaderFilterRegex: '.*'
CheckOptions:
- key: readability-identifier-naming.ClassCase
value: 'CamelCase'
- key: readability-identifier-naming.ClassPrefix
value: 'C'
- key: readability-identifier-naming.AbstractClassPrefix
value: 'I'
- key: readability-identifier-naming.StructCase
value: 'CamelCase'
- key: readability-identifier-naming.ParameterCase
value: 'camelBack'
- key: readability-identifier-naming.PrivateMemberCase
value: 'camelBack'
- key: readability-identifier-naming.LocalVariableCase
value: 'camelBack'
- key: readability-identifier-naming.TypeAliasCase
value: 'CamelCase'
- key: readability-identifier-naming.UnionCase
value: 'CamelCase'
- key: readability-identifier-naming.FunctionCase
value: 'CamelCase'
- key: readability-identifier-naming.NamespaceCase
value: 'CamelCase'
Checks:
'-*,bugprone-*,-readability-*,readability-identifier-*,readability-braces-around-statements'
WarningsAsErrors: '*'
HeaderFilterRegex: '.*'

CheckOptions:
- key: readability-identifier-naming.ClassCase
value: 'CamelCase'
- key: readability-identifier-naming.ClassPrefix
value: 'C'
- key: readability-identifier-naming.AbstractClassPrefix
value: 'I'
- key: readability-identifier-naming.StructCase
value: 'CamelCase'
- key: readability-identifier-naming.ParameterCase
value: 'camelBack'
- key: readability-identifier-naming.PrivateMemberCase
value: 'camelBack'
- key: readability-identifier-naming.LocalVariableCase
value: 'camelBack'
- key: readability-identifier-naming.TypeAliasCase
value: 'CamelCase'
- key: readability-identifier-naming.UnionCase
value: 'CamelCase'
- key: readability-identifier-naming.FunctionCase
value: 'CamelCase'
- key: readability-identifier-naming.NamespaceCase
value: 'CamelCase'

2 changes: 2 additions & 0 deletions src/Qir/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Ignore the generated qir files from Q# compiler
qir/
Loading