Skip to content

pnnx convert torch cross and t (#4896) #29

pnnx convert torch cross and t (#4896)

pnnx convert torch cross and t (#4896) #29

name: windows-x64-gpu
on:
push:
branches: [master]
paths:
- '.github/workflows/windows-x64-gpu.yml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'src/*'
- 'src/layer/*'
- 'src/layer/x86/**'
- 'src/layer/vulkan/**'
- 'tests/**'
- 'tools/**'
- '!tools/pnnx/**'
- 'examples/**'
pull_request:
branches: [master]
paths:
- '.github/workflows/windows-x64-gpu.yml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'src/*'
- 'src/layer/*'
- 'src/layer/x86/**'
- 'src/layer/vulkan/**'
- 'tests/**'
- 'tools/**'
- '!tools/pnnx/**'
- 'examples/**'
concurrency:
group: windows-x64-gpu-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
windows-gpu:
name: ${{ matrix.vs-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- vs-version: vs2015
toolset-version: v140
os: windows-2019
- vs-version: vs2017
toolset-version: v141
os: windows-2019
- vs-version: vs2019
toolset-version: v142
os: windows-2022
- vs-version: vs2022
toolset-version: v143
os: windows-2022
env:
UseMultiToolTask: true
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: cache-protobuf
id: cache-protobuf
uses: actions/cache@v3
with:
path: "protobuf-install"
key: protobuf-${{ matrix.vs-version }}-x64-install-2
- name: protobuf
if: steps.cache-protobuf.outputs.cache-hit != 'true'
run: |
Invoke-WebRequest -Uri https://github.com/protocolbuffers/protobuf/archive/v3.11.2.zip -OutFile protobuf-3.11.2.zip
7z x ./protobuf-3.11.2.zip
cd protobuf-3.11.2
mkdir build-${{ matrix.vs-version }}; cd build-${{ matrix.vs-version }}; cmake -T ${{ matrix.toolset-version }},host=x64 -A x64 -DCMAKE_INSTALL_PREFIX="$env:GITHUB_WORKSPACE\protobuf-install" -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_MSVC_STATIC_RUNTIME=OFF -DNCNN_BUILD_TESTS=ON ../cmake
cmake --build . --config Release -j 2
cmake --build . --config Release --target install
- name: vulkansdk
run: |
Invoke-WebRequest -Uri https://sdk.lunarg.com/sdk/download/1.3.236.0/windows/VulkanSDK-1.3.236.0-Installer.exe?Human=true -OutFile VulkanSDK.exe
.\VulkanSDK.exe --accept-licenses --default-answer --confirm-command install
- name: cache-swiftshader
if: matrix.vs-version != 'vs2015'
id: cache-swiftshader
uses: actions/cache@v3
with:
path: swiftshader-install
key: swiftshader-${{ matrix.vs-version }}-x64-install-20230420
- name: checkout-swiftshader
if: matrix.vs-version != 'vs2015' && steps.cache-swiftshader.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: google/swiftshader
path: swiftshader
ref: dd55e592406dc0bae219df11adec6363840aff4a
- name: checkout-swiftshader-submodules
if: matrix.vs-version != 'vs2015' && steps.cache-swiftshader.outputs.cache-hit != 'true'
run: |
cd swiftshader
git -c submodule."third_party/git-hooks".update=none submodule update --init --recursive
- name: swiftshader
if: matrix.vs-version != 'vs2015' && steps.cache-swiftshader.outputs.cache-hit != 'true'
run: |
cd swiftshader
mkdir build-${{ matrix.vs-version }}; cd build-${{ matrix.vs-version }}
cmake -T ${{ matrix.toolset-version }},host=x64 -A x64 -DCMAKE_INSTALL_PREFIX=install -DSWIFTSHADER_BUILD_EGL=FALSE -DSWIFTSHADER_BUILD_GLESv2=FALSE -DSWIFTSHADER_BUILD_GLES_CM=FALSE -DSWIFTSHADER_BUILD_VULKAN=TRUE -DSWIFTSHADER_BUILD_PVR=FALSE -DSWIFTSHADER_BUILD_TESTS=FALSE -DSWIFTSHADER_ENABLE_ASTC=FALSE -DSWIFTSHADER_WARNINGS_AS_ERRORS=FALSE -DREACTOR_BACKEND=Subzero -DREACTOR_DEFAULT_OPT_LEVEL=Default -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --config Release -j 2
mkdir "$env:GITHUB_WORKSPACE/swiftshader-install"
Copy-Item -Path "Windows\*" -Destination "$env:GITHUB_WORKSPACE\swiftshader-install"
- name: build
run: |
$env:VULKAN_SDK="C:/VulkanSDK/1.3.236.0"
$env:Path+=";C:/VulkanSDK/1.3.236.0/Bin"
mkdir build; cd build
cmake -T ${{ matrix.toolset-version }},host=x64 -A x64 -DProtobuf_INCLUDE_DIR="$env:GITHUB_WORKSPACE\protobuf-install\include" -DProtobuf_LIBRARIES="$env:GITHUB_WORKSPACE\protobuf-install\lib\libprotobuf.lib" -DProtobuf_PROTOC_EXECUTABLE="$env:GITHUB_WORKSPACE\protobuf-install\bin\protoc.exe" -DNCNN_VULKAN=ON -DNCNN_BUILD_TESTS=ON ..
cmake --build . --config Release -j 2
- name: test
if: matrix.vs-version != 'vs2015'
run: |
echo "[Processor]`nThreadCount=1`n" > build/tests/Release/SwiftShader.ini
Copy-Item -Path "$env:GITHUB_WORKSPACE\swiftshader-install\vulkan-1.dll" -Destination 'build\tests'
$env:Path+=";C:/VulkanSDK/1.3.236.0/Bin"
cd build; ctest -C Release --output-on-failure -j 2
- name: build-shared
run: |
$env:VULKAN_SDK="C:/VulkanSDK/1.3.236.0"
$env:Path+=";C:/VulkanSDK/1.3.236.0/Bin"
mkdir build-shared; cd build-shared
cmake -T ${{ matrix.toolset-version }},host=x64 -A x64 -DProtobuf_INCLUDE_DIR="$env:GITHUB_WORKSPACE\protobuf-install\include" -DProtobuf_LIBRARIES="$env:GITHUB_WORKSPACE\protobuf-install\lib\libprotobuf.lib" -DProtobuf_PROTOC_EXECUTABLE="$env:GITHUB_WORKSPACE\protobuf-install\bin\protoc.exe" -DNCNN_VULKAN=ON -DNCNN_SHARED_LIB=ON ..
cmake --build . --config Release -j 2