Skip to content
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
61 changes: 61 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,67 @@ jobs:
run: ccache -s
shell: bash

gn-windows-x86_64:
runs-on: 'windows-2022-8core'
timeout-minutes: 30
env:
DEPOT_TOOLS_WIN_TOOLCHAIN: 0
steps:
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.job }}
max-size: "500M"
save: ${{ inputs.update-caches }}
- name: Install Depot Tools
uses: newkdev/setup-depot-tools@v1.0.1
- name: Write .gclient
shell: powershell
run: |
Set-Content -Path .gclient -Value "
solutions = [
{ 'name': 'XNNPACK',
'url': 'https://github.com/google/XNNPACK',
'deps_file': 'DEPS',
'managed': False,
'custom_deps': {},
},
]
"
working-directory: ${{ github.workspace }}
- name: Setup build environment
shell: bash
run: |
echo "VCVARSALL=$(vswhere -products \* -latest -property installationPath)\\VC\\Auxiliary\\Build\\vcvarsall.bat" >> $GITHUB_ENV
- name: Sync to commit and run hooks
shell: powershell
run: gclient sync -vv --revision $env:GITHUB_SHA
- name: Write LASTCHANGE files
shell: powershell
run: |
$LastChangeContents = @(
"LASTCHANGE=$env:GITHUB_SHA-$env:GITHUB_REF_NAME"
"LASTCHANGE_YEAR=$(git log -1 --pretty=%Y)"
)

Set-Content -Path build/util/LASTCHANGE -Value $LastChangeContents
$UnixTime = git log -1 --pretty=%ct
Set-Content -Path build/util/LASTCHANGE.committime -Value $UnixTime
working-directory: ${{ github.workspace }}\XNNPACK
- name: Generate build files (x64, dchecks)
run: |
gn gen --check --args="is_debug=false symbol_level=0 dcheck_always_on=true cc_wrapper=\`"ccache\`" target_cpu=\`"x64\`"" out/x64.dchecks
working-directory: ${{ github.workspace }}\XNNPACK
shell: powershell
- name: Build all targets (x64 Release + debug checks)
run: |
autoninja -C out/x64.dchecks
working-directory: ${{ github.workspace }}\XNNPACK
- name: Run tests (x64)
run: |
python3 scripts/run-gn-tests.py out/x64.dchecks
working-directory: ${{ github.workspace }}\XNNPACK

cmake-macos-arm64:
runs-on: macos-latest
timeout-minutes: 60
Expand Down
11 changes: 7 additions & 4 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,10 @@ declare_args() {
# Enables AVX2 support for x86 processors
xnnpack_enable_avx2 = target_cpu == "x64" || target_cpu == "x86"

# Enables AVX512 support for x86 processors
xnnpack_enable_avx512 = target_cpu == "x64" || target_cpu == "x86"
# Enables AVX-512 support for x86 processors. Temporarily switched
# off on Windows because some AVX-512 assembly kernels contain unsupported
# syntax. TODO: crbug.com/523327327 - Re-enable this.
xnnpack_enable_avx512 = target_cpu == "x64" && !is_win

# Enables VNNI extensions, which are separate from AVX512-VNNI
xnnpack_enable_avx_vnni = target_cpu == "x64" || target_cpu == "x86"
Expand Down Expand Up @@ -177,7 +179,6 @@ config("xnnpack_private_config") {
"XNN_ENABLE_ARM_I8MM=1",
"XNN_ENABLE_ASSEMBLY=1",
"XNN_ENABLE_ARM_FP16_VECTOR=1",
"XNN_ENABLE_RNDNU16=1",
]
if (xnnpack_enable_arm_kleidiai) {
defines += [ "XNN_ENABLE_KLEIDIAI=1" ]
Expand Down Expand Up @@ -918,6 +919,7 @@ xnnpack_source_set("scalar_microkernels") {
deps = [
":microkernel_defs",
":microkernel_headers",
"//third_party/fxdiv",
]
sources = ALL_SCALAR_MICROKERNEL_SRCS
}
Expand Down Expand Up @@ -965,6 +967,7 @@ xnnpack_source_set("xnnpack") {
":scalar_microkernels",
":subgraph",
":table",
"//third_party/fxdiv",
]
if (xnnpack_enable_arm_kleidiai) {
deps += [ "//third_party/kleidiai" ]
Expand Down Expand Up @@ -1025,7 +1028,7 @@ xnnpack_source_set("xnnpack") {
if (xnnpack_enable_avx512) {
deps += [ ":avx512_microkernels" ]
}
if (current_cpu == "x64") {
if (!is_win) {
sources += AMD64_ASM_MICROKERNEL_SRCS
}
sources += ALL_SSE_MICROKERNEL_SRCS
Expand Down
7 changes: 7 additions & 0 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,13 @@ deps = {
}

hooks = [
{
# Update the Windows toolchain if necessary.
'name': 'win_toolchain',
'pattern': '.',
'condition': 'checkout_win',
'action': ['python3', 'build/vs_toolchain.py', 'update', '--force'],
},
{
# Update the Mac toolchain if necessary.
'name': 'mac_toolchain',
Expand Down
Loading
Loading