Skip to content
Open
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
77 changes: 77 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,84 @@
run: ctest -C Release --output-on-failure --parallel $NUMBER_OF_PROCESSORS
working-directory: ${{ github.workspace }}/build/windows/x86

gn-windows-x86_64:
runs-on: 'windows-2022-32core'
timeout-minutes: 30
env:
DEPOT_TOOLS_WIN_TOOLCHAIN: 0
steps:
- 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 (arm64, component)
run: |
gn gen --check --args="is_debug=true symbol_level=1 is_component_build=true target_cpu=\`"arm64\`"" out/arm64.dchecks
working-directory: ${{ github.workspace }}\XNNPACK
shell: powershell
- name: Generate build files (x64, dchecks)
run: |
gn gen --check --args="is_debug=false symbol_level=0 dcheck_always_on=true target_cpu=\`"x64\`"" out/x64.dchecks
working-directory: ${{ github.workspace }}\XNNPACK
shell: powershell
- name: Generate build files (x86, dchecks)
run: |
gn gen --check --args="is_debug=false symbol_level=0 dcheck_always_on=true target_cpu=\`"x86\`"" out/x86.dchecks
working-directory: ${{ github.workspace }}\XNNPACK
shell: powershell
- name: Build all targets (arm64, component)
run: |
autoninja -C out/arm64.dchecks
working-directory: ${{ github.workspace }}\XNNPACK
- name: Build all targets (x64 Release + debug checks)
run: |
autoninja -C out/x64.dchecks
working-directory: ${{ github.workspace }}\XNNPACK
- name: Build all targets (x86 Release + debug checks)
run: |
autoninja -C out/x86.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
- name: Run tests (x86)
run: |
python3 scripts/run-gn-tests.py out/x86.dchecks
working-directory: ${{ github.workspace }}\XNNPACK

cmake-macos-arm64:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
runs-on: macos-latest
timeout-minutes: 60
steps:
Expand Down
9 changes: 6 additions & 3 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,11 @@ 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 AVX512 support for x86 processors. Temporarily switched
# off on Windows because some AVX512 assembly kernels contain unsupported
# syntax.
xnnpack_enable_avx512 =
(target_cpu == "x64" || target_cpu == "x86") && !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 @@ -771,7 +774,7 @@ xnnpack_source_set("xnnpack") {
if (xnnpack_enable_avx512) {
deps += [ ":avx512_microkernels" ]
}
if (current_cpu == "x64") {
if (current_cpu == "x64" && !is_win) {
sources += AMD64_ASM_MICROKERNEL_SRCS
}
sources += ALL_SSE_MICROKERNEL_SRCS
Expand Down
4 changes: 4 additions & 0 deletions scripts/run-gn-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import datetime
import glob
import os
import platform
import sys

# Add tests that require sharding here.
Expand Down Expand Up @@ -134,7 +135,10 @@ async def main() -> None:
semaphore = asyncio.Semaphore(concurrency)

# Pick up the executables - must be named in this way to work
# If we're on Windows, the executable will have a .exe extension.
test_suites = list(sorted(glob.glob(args.out_dir + '/xnnpack_*_test')))
if platform.system() == "Windows":
test_suites = list(sorted(glob.glob(args.out_dir + '/xnnpack_*_test.exe')))

print(f'Discovered {len(test_suites)} test suites...')
# Create the list of tests to run, sharding the long ones.
Expand Down
Loading