diff --git a/.github/workflows/ios-arm64-gpu.yml b/.github/workflows/ios-arm64-gpu.yml deleted file mode 100644 index 25f8cf4ad35..00000000000 --- a/.github/workflows/ios-arm64-gpu.yml +++ /dev/null @@ -1,133 +0,0 @@ -name: ios-arm64-gpu -on: - push: - branches: [master] - paths: - - '.github/workflows/ios-arm64-gpu.yml' - - 'toolchains/ios.toolchain.cmake' - - 'CMakeLists.txt' - - 'cmake/**' - - 'src/*' - - 'src/layer/*' - - 'src/layer/arm/**' - - 'src/layer/vulkan/**' - pull_request: - branches: [master] - paths: - - '.github/workflows/ios-arm64-gpu.yml' - - 'toolchains/ios.toolchain.cmake' - - 'CMakeLists.txt' - - 'cmake/**' - - 'src/*' - - 'src/layer/*' - - 'src/layer/arm/**' - - 'src/layer/vulkan/**' -concurrency: - group: ios-arm64-gpu-${{ github.ref }} - cancel-in-progress: true -env: - DEVELOPER_DIR: /Applications/Xcode_13.4.1.app/Contents/Developer - IOS_DEPLOYMENT_TARGET: '9.0' - ENABLE_BITCODE: OFF - ENABLE_ARC: OFF - ENABLE_VISIBILITY: OFF -permissions: - contents: read - -jobs: - ios-iphone-os-gpu: - runs-on: macos-12 - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - - name: cache-openmp - id: cache-openmp - uses: actions/cache@v4 - with: - path: openmp-install - key: openmp-ios-install-20230504 - - name: openmp - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - wget https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/openmp-11.0.0.src.tar.xz - tar -xf openmp-11.0.0.src.tar.xz - cd openmp-11.0.0.src - sed -i'' -e '/.size __kmp_unnamed_critical_addr/d' runtime/src/z_Linux_asm.S - sed -i'' -e 's/__kmp_unnamed_critical_addr/___kmp_unnamed_critical_addr/g' runtime/src/z_Linux_asm.S - - name: openmp-build-armv7 - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - cd openmp-11.0.0.src - mkdir -p build-armv7 && cd build-armv7 - cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=OS -DARCHS="armv7" \ - -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - -DPERL_EXECUTABLE=/usr/local/bin/perl \ - -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF .. - cmake --build . -j 3 - cmake --build . --target install - - name: openmp-build-arm64 - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - cd openmp-11.0.0.src - mkdir -p build-arm64 && cd build-arm64 - cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=OS64 -DARCHS="arm64" \ - -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - -DPERL_EXECUTABLE=/usr/local/bin/perl \ - -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF .. - cmake --build . -j 3 - cmake --build . --target install - - name: openmp-build-arm64e - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - cd openmp-11.0.0.src - mkdir -p build-arm64e && cd build-arm64e - cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=OS64 -DARCHS="arm64e" \ - -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - -DPERL_EXECUTABLE=/usr/local/bin/perl \ - -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF .. - cmake --build . -j 3 - cmake --build . --target install - - name: openmp-merge-fat-library - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - mkdir -p $GITHUB_WORKSPACE/openmp-install - cp -a openmp-11.0.0.src/build-arm64/install/include $GITHUB_WORKSPACE/openmp-install - mkdir -p $GITHUB_WORKSPACE/openmp-install/lib - lipo -create \ - openmp-11.0.0.src/build-armv7/install/lib/libomp.a \ - openmp-11.0.0.src/build-arm64/install/lib/libomp.a \ - openmp-11.0.0.src/build-arm64e/install/lib/libomp.a \ - -o $GITHUB_WORKSPACE/openmp-install/lib/libomp.a - - - name: install-openmp - run: | - sudo cp $GITHUB_WORKSPACE/openmp-install/include/* $DEVELOPER_DIR/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include - sudo cp $GITHUB_WORKSPACE/openmp-install/lib/libomp.a $DEVELOPER_DIR/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib - - - name: build-arm64 - run: | - mkdir build-arm64 && cd build-arm64 - cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake -DPLATFORM=OS64 -DARCHS="arm64" \ - -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DOpenMP_C_FLAGS="-Xclang -fopenmp" -DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \ - -DOpenMP_C_LIB_NAMES="libomp" -DOpenMP_CXX_LIB_NAMES="libomp" \ - -DOpenMP_libomp_LIBRARY="$DEVELOPER_DIR/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libomp.a" \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - -DNCNN_VULKAN=ON -DNCNN_BUILD_BENCHMARK=OFF .. - cmake --build . -j 3 - - name: build-arm64e - run: | - mkdir build-arm64e && cd build-arm64e - cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake -DPLATFORM=OS64 -DARCHS="arm64e" \ - -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DOpenMP_C_FLAGS="-Xclang -fopenmp" -DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \ - -DOpenMP_C_LIB_NAMES="libomp" -DOpenMP_CXX_LIB_NAMES="libomp" \ - -DOpenMP_libomp_LIBRARY="$DEVELOPER_DIR/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libomp.a" \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - -DNCNN_VULKAN=ON -DNCNN_BUILD_BENCHMARK=OFF .. - cmake --build . -j 3 diff --git a/.github/workflows/ios-cpu.yml b/.github/workflows/ios-cpu.yml deleted file mode 100644 index 501eac3377d..00000000000 --- a/.github/workflows/ios-cpu.yml +++ /dev/null @@ -1,140 +0,0 @@ -name: ios-cpu -on: - push: - branches: [master] - paths: - - '.github/workflows/ios-cpu.yml' - - 'toolchains/ios.toolchain.cmake' - - 'CMakeLists.txt' - - 'cmake/**' - - 'src/*' - - 'src/layer/*' - - 'src/layer/arm/**' - pull_request: - branches: [master] - paths: - - '.github/workflows/ios-cpu.yml' - - 'toolchains/ios.toolchain.cmake' - - 'CMakeLists.txt' - - 'cmake/**' - - 'src/*' - - 'src/layer/*' - - 'src/layer/arm/**' -concurrency: - group: ios-cpu-${{ github.ref }} - cancel-in-progress: true -env: - DEVELOPER_DIR: /Applications/Xcode_13.4.1.app/Contents/Developer - IOS_DEPLOYMENT_TARGET: '9.0' - ENABLE_BITCODE: OFF - ENABLE_ARC: OFF - ENABLE_VISIBILITY: OFF -permissions: - contents: read - -jobs: - ios-iphone-os: - runs-on: macos-12 - steps: - - uses: actions/checkout@v4 - - - name: cache-openmp - id: cache-openmp - uses: actions/cache@v4 - with: - path: openmp-install - key: openmp-ios-install-20230504 - - name: openmp - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - wget https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/openmp-11.0.0.src.tar.xz - tar -xf openmp-11.0.0.src.tar.xz - cd openmp-11.0.0.src - sed -i'' -e '/.size __kmp_unnamed_critical_addr/d' runtime/src/z_Linux_asm.S - sed -i'' -e 's/__kmp_unnamed_critical_addr/___kmp_unnamed_critical_addr/g' runtime/src/z_Linux_asm.S - - name: openmp-build-armv7 - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - cd openmp-11.0.0.src - mkdir -p build-armv7 && cd build-armv7 - cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=OS -DARCHS="armv7" \ - -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - -DPERL_EXECUTABLE=/usr/local/bin/perl \ - -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF .. - cmake --build . -j 3 - cmake --build . --target install - - name: openmp-build-arm64 - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - cd openmp-11.0.0.src - mkdir -p build-arm64 && cd build-arm64 - cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=OS64 -DARCHS="arm64" \ - -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - -DPERL_EXECUTABLE=/usr/local/bin/perl \ - -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF .. - cmake --build . -j 3 - cmake --build . --target install - - name: openmp-build-arm64e - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - cd openmp-11.0.0.src - mkdir -p build-arm64e && cd build-arm64e - cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=OS64 -DARCHS="arm64e" \ - -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - -DPERL_EXECUTABLE=/usr/local/bin/perl \ - -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF .. - cmake --build . -j 3 - cmake --build . --target install - - name: openmp-merge-fat-library - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - mkdir -p $GITHUB_WORKSPACE/openmp-install - cp -a openmp-11.0.0.src/build-arm64/install/include $GITHUB_WORKSPACE/openmp-install - mkdir -p $GITHUB_WORKSPACE/openmp-install/lib - lipo -create \ - openmp-11.0.0.src/build-armv7/install/lib/libomp.a \ - openmp-11.0.0.src/build-arm64/install/lib/libomp.a \ - openmp-11.0.0.src/build-arm64e/install/lib/libomp.a \ - -o $GITHUB_WORKSPACE/openmp-install/lib/libomp.a - - - name: install-openmp - run: | - sudo cp $GITHUB_WORKSPACE/openmp-install/include/* $DEVELOPER_DIR/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include - sudo cp $GITHUB_WORKSPACE/openmp-install/lib/libomp.a $DEVELOPER_DIR/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib - - - name: build-armv7 - run: | - mkdir build-armv7 && cd build-armv7 - cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake -DPLATFORM=OS -DARCHS="armv7" \ - -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DOpenMP_C_FLAGS="-Xclang -fopenmp" -DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \ - -DOpenMP_C_LIB_NAMES="libomp" -DOpenMP_CXX_LIB_NAMES="libomp" \ - -DOpenMP_libomp_LIBRARY="$DEVELOPER_DIR/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libomp.a" \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - .. - cmake --build . -j 3 - - name: build-arm64 - run: | - mkdir build-arm64 && cd build-arm64 - cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake -DPLATFORM=OS64 -DARCHS="arm64" \ - -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DOpenMP_C_FLAGS="-Xclang -fopenmp" -DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \ - -DOpenMP_C_LIB_NAMES="libomp" -DOpenMP_CXX_LIB_NAMES="libomp" \ - -DOpenMP_libomp_LIBRARY="$DEVELOPER_DIR/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libomp.a" \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - .. - cmake --build . -j 3 - - name: build-arm64e - run: | - mkdir build-arm64e && cd build-arm64e - cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake -DPLATFORM=OS64 -DARCHS="arm64e" \ - -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DOpenMP_C_FLAGS="-Xclang -fopenmp" -DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \ - -DOpenMP_C_LIB_NAMES="libomp" -DOpenMP_CXX_LIB_NAMES="libomp" \ - -DOpenMP_libomp_LIBRARY="$DEVELOPER_DIR/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libomp.a" \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - .. - cmake --build . -j 3 diff --git a/.github/workflows/ios-simulator-gpu.yml b/.github/workflows/ios-simulator-gpu.yml deleted file mode 100644 index 4babdb4e532..00000000000 --- a/.github/workflows/ios-simulator-gpu.yml +++ /dev/null @@ -1,133 +0,0 @@ -name: ios-simulator-gpu -on: - push: - branches: [master] - paths: - - '.github/workflows/ios-simulator-gpu.yml' - - 'toolchains/ios.toolchain.cmake' - - 'CMakeLists.txt' - - 'cmake/**' - - 'src/*' - - 'src/layer/*' - - 'src/layer/x86/**' - - 'src/layer/arm/**' - pull_request: - branches: [master] - paths: - - '.github/workflows/ios-simulator-gpu.yml' - - 'toolchains/ios.toolchain.cmake' - - 'CMakeLists.txt' - - 'cmake/**' - - 'src/*' - - 'src/layer/*' - - 'src/layer/x86/**' - - 'src/layer/arm/**' -concurrency: - group: ios-simulator-gpu-${{ github.ref }} - cancel-in-progress: true -env: - DEVELOPER_DIR: /Applications/Xcode_13.4.1.app/Contents/Developer - IOS_DEPLOYMENT_TARGET: '9.0' - ENABLE_BITCODE: OFF - ENABLE_ARC: OFF - ENABLE_VISIBILITY: OFF -permissions: - contents: read - -jobs: - ios-iphone-simulator-gpu: - runs-on: macos-12 - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - - name: cache-openmp - id: cache-openmp - uses: actions/cache@v4 - with: - path: openmp-install - key: openmp-ios-simulator-install-20230504 - - name: openmp - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - wget https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/openmp-11.0.0.src.tar.xz - tar -xf openmp-11.0.0.src.tar.xz - cd openmp-11.0.0.src - sed -i'' -e '/.size __kmp_unnamed_critical_addr/d' runtime/src/z_Linux_asm.S - sed -i'' -e 's/__kmp_unnamed_critical_addr/___kmp_unnamed_critical_addr/g' runtime/src/z_Linux_asm.S - - name: openmp-build-i386 - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - cd openmp-11.0.0.src - mkdir -p build-i386 && cd build-i386 - cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=SIMULATOR -DARCHS="i386" \ - -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - -DPERL_EXECUTABLE=/usr/local/bin/perl \ - -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF .. - cmake --build . -j 3 - cmake --build . --target install - - name: openmp-build-x86_64 - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - cd openmp-11.0.0.src - mkdir -p build-x86_64 && cd build-x86_64 - cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=SIMULATOR64 -DARCHS="x86_64" \ - -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - -DPERL_EXECUTABLE=/usr/local/bin/perl \ - -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF .. - cmake --build . -j 3 - cmake --build . --target install - - name: openmp-build-arm64 - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - cd openmp-11.0.0.src - mkdir -p build-arm64 && cd build-arm64 - cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=SIMULATORARM64 -DARCHS="arm64" \ - -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - -DPERL_EXECUTABLE=/usr/local/bin/perl \ - -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF .. - cmake --build . -j 3 - cmake --build . --target install - - name: openmp-merge-fat-library - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - mkdir -p $GITHUB_WORKSPACE/openmp-install - cp -a openmp-11.0.0.src/build-x86_64/install/include $GITHUB_WORKSPACE/openmp-install - mkdir -p $GITHUB_WORKSPACE/openmp-install/lib - lipo -create \ - openmp-11.0.0.src/build-i386/install/lib/libomp.a \ - openmp-11.0.0.src/build-x86_64/install/lib/libomp.a \ - openmp-11.0.0.src/build-arm64/install/lib/libomp.a \ - -o $GITHUB_WORKSPACE/openmp-install/lib/libomp.a - - - name: openmp-install - run: | - sudo cp $GITHUB_WORKSPACE/openmp-install/include/* $DEVELOPER_DIR/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include - sudo cp $GITHUB_WORKSPACE/openmp-install/lib/libomp.a $DEVELOPER_DIR/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib - - - name: build-x86_64 - run: | - mkdir build-x86_64 && cd build-x86_64 - cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake -DPLATFORM=SIMULATOR64 -DARCHS="x86_64" \ - -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DOpenMP_C_FLAGS="-Xclang -fopenmp" -DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \ - -DOpenMP_C_LIB_NAMES="libomp" -DOpenMP_CXX_LIB_NAMES="libomp" \ - -DOpenMP_libomp_LIBRARY="$DEVELOPER_DIR/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libomp.a" \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - -DNCNN_VULKAN=ON -DNCNN_BUILD_BENCHMARK=OFF .. - cmake --build . -j 3 - - name: build-arm64 - run: | - mkdir build-arm64 && cd build-arm64 - cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake -DPLATFORM=SIMULATORARM64 -DARCHS="arm64" \ - -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DOpenMP_C_FLAGS="-Xclang -fopenmp" -DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \ - -DOpenMP_C_LIB_NAMES="libomp" -DOpenMP_CXX_LIB_NAMES="libomp" \ - -DOpenMP_libomp_LIBRARY="$DEVELOPER_DIR/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libomp.a" \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - -DNCNN_VULKAN=ON -DNCNN_BUILD_BENCHMARK=OFF .. - cmake --build . -j 3 diff --git a/.github/workflows/ios-simulator.yml b/.github/workflows/ios-simulator.yml deleted file mode 100644 index 1d550638313..00000000000 --- a/.github/workflows/ios-simulator.yml +++ /dev/null @@ -1,142 +0,0 @@ -name: ios-simulator -on: - push: - branches: [master] - paths: - - '.github/workflows/ios-simulator.yml' - - 'toolchains/ios.toolchain.cmake' - - 'CMakeLists.txt' - - 'cmake/**' - - 'src/*' - - 'src/layer/*' - - 'src/layer/x86/**' - - 'src/layer/arm/**' - pull_request: - branches: [master] - paths: - - '.github/workflows/ios-simulator.yml' - - 'toolchains/ios.toolchain.cmake' - - 'CMakeLists.txt' - - 'cmake/**' - - 'src/*' - - 'src/layer/*' - - 'src/layer/x86/**' - - 'src/layer/arm/**' -concurrency: - group: ios-simulator-${{ github.ref }} - cancel-in-progress: true -env: - DEVELOPER_DIR: /Applications/Xcode_13.4.1.app/Contents/Developer - IOS_DEPLOYMENT_TARGET: '9.0' - ENABLE_BITCODE: OFF - ENABLE_ARC: OFF - ENABLE_VISIBILITY: OFF -permissions: - contents: read - -jobs: - ios-iphone-simulator: - runs-on: macos-12 - steps: - - uses: actions/checkout@v4 - - - name: cache-openmp - id: cache-openmp - uses: actions/cache@v4 - with: - path: openmp-install - key: openmp-ios-simulator-install-20230504 - - name: openmp - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - wget https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/openmp-11.0.0.src.tar.xz - tar -xf openmp-11.0.0.src.tar.xz - cd openmp-11.0.0.src - sed -i'' -e '/.size __kmp_unnamed_critical_addr/d' runtime/src/z_Linux_asm.S - sed -i'' -e 's/__kmp_unnamed_critical_addr/___kmp_unnamed_critical_addr/g' runtime/src/z_Linux_asm.S - - name: openmp-build-i386 - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - cd openmp-11.0.0.src - mkdir -p build-i386 && cd build-i386 - cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=SIMULATOR -DARCHS="i386" \ - -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - -DPERL_EXECUTABLE=/usr/local/bin/perl \ - -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF .. - cmake --build . -j 3 - cmake --build . --target install - - name: openmp-build-x86_64 - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - cd openmp-11.0.0.src - mkdir -p build-x86_64 && cd build-x86_64 - cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=SIMULATOR64 -DARCHS="x86_64" \ - -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - -DPERL_EXECUTABLE=/usr/local/bin/perl \ - -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF .. - cmake --build . -j 3 - cmake --build . --target install - - name: openmp-build-arm64 - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - cd openmp-11.0.0.src - mkdir -p build-arm64 && cd build-arm64 - cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=SIMULATORARM64 -DARCHS="arm64" \ - -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - -DPERL_EXECUTABLE=/usr/local/bin/perl \ - -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF .. - cmake --build . -j 3 - cmake --build . --target install - - name: openmp-merge-fat-library - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - mkdir -p $GITHUB_WORKSPACE/openmp-install - cp -a openmp-11.0.0.src/build-x86_64/install/include $GITHUB_WORKSPACE/openmp-install - mkdir -p $GITHUB_WORKSPACE/openmp-install/lib - lipo -create \ - openmp-11.0.0.src/build-i386/install/lib/libomp.a \ - openmp-11.0.0.src/build-x86_64/install/lib/libomp.a \ - openmp-11.0.0.src/build-arm64/install/lib/libomp.a \ - -o $GITHUB_WORKSPACE/openmp-install/lib/libomp.a - - - name: openmp-install - run: | - sudo cp $GITHUB_WORKSPACE/openmp-install/include/* $DEVELOPER_DIR/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include - sudo cp $GITHUB_WORKSPACE/openmp-install/lib/libomp.a $DEVELOPER_DIR/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib - - - name: build-i386 - run: | - mkdir build-i386 && cd build-i386 - cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake -DPLATFORM=SIMULATOR -DARCHS="i386" \ - -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DOpenMP_C_FLAGS="-Xclang -fopenmp" -DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \ - -DOpenMP_C_LIB_NAMES="libomp" -DOpenMP_CXX_LIB_NAMES="libomp" \ - -DOpenMP_libomp_LIBRARY="$DEVELOPER_DIR/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libomp.a" \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - .. - cmake --build . -j 3 - - name: build-x86_64 - run: | - mkdir build-x86_64 && cd build-x86_64 - cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake -DPLATFORM=SIMULATOR64 -DARCHS="x86_64" \ - -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DOpenMP_C_FLAGS="-Xclang -fopenmp" -DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \ - -DOpenMP_C_LIB_NAMES="libomp" -DOpenMP_CXX_LIB_NAMES="libomp" \ - -DOpenMP_libomp_LIBRARY="$DEVELOPER_DIR/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libomp.a" \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - .. - cmake --build . -j 3 - - name: build-arm64 - run: | - mkdir build-arm64 && cd build-arm64 - cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake -DPLATFORM=SIMULATORARM64 -DARCHS="arm64" \ - -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DOpenMP_C_FLAGS="-Xclang -fopenmp" -DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \ - -DOpenMP_C_LIB_NAMES="libomp" -DOpenMP_CXX_LIB_NAMES="libomp" \ - -DOpenMP_libomp_LIBRARY="$DEVELOPER_DIR/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libomp.a" \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - .. - cmake --build . -j 3 diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml new file mode 100644 index 00000000000..1908657eb80 --- /dev/null +++ b/.github/workflows/ios.yml @@ -0,0 +1,167 @@ +name: ios +on: + push: + branches: [master] + paths: + - '.github/workflows/ios.yml' + - 'toolchains/ios.toolchain.cmake' + - 'CMakeLists.txt' + - 'cmake/**' + - 'src/*' + - 'src/layer/*' + - 'src/layer/arm/**' + - 'src/layer/x86/**' + - 'src/layer/vulkan/**' + pull_request: + branches: [master] + paths: + - '.github/workflows/ios.yml' + - 'toolchains/ios.toolchain.cmake' + - 'CMakeLists.txt' + - 'cmake/**' + - 'src/*' + - 'src/layer/*' + - 'src/layer/arm/**' + - 'src/layer/x86/**' + - 'src/layer/vulkan/**' +concurrency: + group: ios-${{ github.ref }} + cancel-in-progress: true +env: + DEVELOPER_DIR: /Applications/Xcode_15.2.app/Contents/Developer + IOS_DEPLOYMENT_TARGET: '13.0' + ENABLE_BITCODE: OFF + ENABLE_ARC: OFF + ENABLE_VISIBILITY: OFF +permissions: + contents: read + +jobs: + build: + runs-on: macos-13 + env: + OPENMP_VERSION: '18.1.2' + OPENMP_CMAKE_OPTIONS: | + -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake \ + -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET \ + -DENABLE_BITCODE=$ENABLE_BITCODE \ + -DENABLE_ARC=$ENABLE_ARC \ + -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ + -DCMAKE_INSTALL_PREFIX=install \ + -DCMAKE_BUILD_TYPE=Release \ + -DPERL_EXECUTABLE=/usr/local/bin/perl \ + -DLIBOMP_ENABLE_SHARED=OFF \ + -DLIBOMP_OMPT_SUPPORT=OFF \ + -DLIBOMP_USE_HWLOC=OFF \ + + MOLTENVK_VERSION: 'v1.2.8' + NCNN_CMAKE_OPTIONS: | + -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake \ + -DDEPLOYMENT_TARGET=$IOS_DEPLOYMENT_TARGET \ + -DENABLE_BITCODE=$ENABLE_BITCODE \ + -DENABLE_ARC=$ENABLE_ARC \ + -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ + -DCMAKE_INSTALL_PREFIX=install \ + -DCMAKE_BUILD_TYPE=Release \ + -DOpenMP_C_FLAGS="-Xclang -fopenmp" -DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \ + -DOpenMP_C_LIB_NAMES="libomp" -DOpenMP_CXX_LIB_NAMES="libomp" \ + -DOpenMP_libomp_LIBRARY="libomp.a" \ + -DNCNN_VULKAN=ON \ + + steps: + - uses: actions/checkout@v4 + with: + submodules: true + + - name: cache-openmp + id: cache-openmp + uses: actions/cache@v4 + with: + path: openmp-install + key: openmp-ios-install-20240403 + - name: openmp + if: steps.cache-openmp.outputs.cache-hit != 'true' + run: | + wget https://github.com/llvm/llvm-project/releases/download/llvmorg-${{ env.OPENMP_VERSION }}/cmake-${{ env.OPENMP_VERSION }}.src.tar.xz + tar -xf cmake-${{ env.OPENMP_VERSION }}.src.tar.xz + wget https://github.com/llvm/llvm-project/releases/download/llvmorg-${{ env.OPENMP_VERSION }}/openmp-${{ env.OPENMP_VERSION }}.src.tar.xz + tar -xf openmp-${{ env.OPENMP_VERSION }}.src.tar.xz + mv cmake-${{ env.OPENMP_VERSION }}.src/Modules/* openmp-${{ env.OPENMP_VERSION }}.src/cmake/ + cd openmp-${{ env.OPENMP_VERSION }}.src + wget https://github.com/nihui/llvm-project/commit/ef8c35bcf5d9cfdb0764ffde6a63c04ec715bc37.patch + patch -p2 -i ef8c35bcf5d9cfdb0764ffde6a63c04ec715bc37.patch + wget https://github.com/nihui/llvm-project/commit/5c12711f9a21f41bea70566bf15a4026804d6b20.patch + patch -p2 -i 5c12711f9a21f41bea70566bf15a4026804d6b20.patch + - name: openmp-arm64 + if: steps.cache-openmp.outputs.cache-hit != 'true' + run: | + cd openmp-${{ env.OPENMP_VERSION }}.src + mkdir -p build-arm64 && cd build-arm64 + cmake ${{ env.OPENMP_CMAKE_OPTIONS }} -DPLATFORM=OS64 -DARCHS="arm64" .. + cmake --build . -j 4 + cmake --build . --target install + - name: openmp-simulator-x86_64 + if: steps.cache-openmp.outputs.cache-hit != 'true' + run: | + cd openmp-${{ env.OPENMP_VERSION }}.src + mkdir -p build-simulator-x86_64 && cd build-simulator-x86_64 + cmake ${{ env.OPENMP_CMAKE_OPTIONS }} -DPLATFORM=SIMULATOR64 -DARCHS="x86_64" .. + cmake --build . -j 4 + cmake --build . --target install + - name: openmp-simulator-arm64 + if: steps.cache-openmp.outputs.cache-hit != 'true' + run: | + cd openmp-${{ env.OPENMP_VERSION }}.src + mkdir -p build-simulator-arm64 && cd build-simulator-arm64 + cmake ${{ env.OPENMP_CMAKE_OPTIONS }} -DPLATFORM=SIMULATORARM64 -DARCHS="arm64" .. + cmake --build . -j 4 + cmake --build . --target install + - name: openmp-merge-fat-library + if: steps.cache-openmp.outputs.cache-hit != 'true' + run: | + mkdir -p $GITHUB_WORKSPACE/openmp-install + mkdir -p $GITHUB_WORKSPACE/openmp-install/ios + mkdir -p $GITHUB_WORKSPACE/openmp-install/ios-simulator + + cp -a openmp-${{ env.OPENMP_VERSION }}.src/build-arm64/install/include $GITHUB_WORKSPACE/openmp-install/ios + mkdir -p $GITHUB_WORKSPACE/openmp-install/ios/lib + cp openmp-${{ env.OPENMP_VERSION }}.src/build-arm64/install/lib/libomp.a $GITHUB_WORKSPACE/openmp-install/ios/lib/libomp.a + + cp -a openmp-${{ env.OPENMP_VERSION }}.src/build-simulator-x86_64/install/include $GITHUB_WORKSPACE/openmp-install/ios-simulator + mkdir -p $GITHUB_WORKSPACE/openmp-install/ios-simulator/lib + lipo -create \ + openmp-${{ env.OPENMP_VERSION }}.src/build-simulator-x86_64/install/lib/libomp.a \ + openmp-${{ env.OPENMP_VERSION }}.src/build-simulator-arm64/install/lib/libomp.a \ + -o $GITHUB_WORKSPACE/openmp-install/ios-simulator/lib/libomp.a + + - name: install-openmp + run: | + sudo cp $GITHUB_WORKSPACE/openmp-install/ios/include/* $DEVELOPER_DIR/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include + sudo cp $GITHUB_WORKSPACE/openmp-install/ios/lib/libomp.a $DEVELOPER_DIR/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib + + sudo cp $GITHUB_WORKSPACE/openmp-install/ios-simulator/include/* $DEVELOPER_DIR/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include + sudo cp $GITHUB_WORKSPACE/openmp-install/ios-simulator/lib/libomp.a $DEVELOPER_DIR/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib + + - name: moltenvk + run: | + wget -q https://github.com/KhronosGroup/MoltenVK/releases/download/${{ env.MOLTENVK_VERSION }}/MoltenVK-all.tar + tar -xf MoltenVK-all.tar + + - name: arm64 + run: | + mkdir build-arm64 && cd build-arm64 + cmake ${{ env.NCNN_CMAKE_OPTIONS }} -DPLATFORM=OS64 -DARCHS="arm64" \ + -DVulkan_LIBRARY=$GITHUB_WORKSPACE/MoltenVK/MoltenVK/static/MoltenVK.xcframework/ios-arm64/libMoltenVK.a .. + cmake --build . -j 4 + - name: simulator-x86_64 + run: | + mkdir build-simulator-x86_64 && cd build-simulator-x86_64 + cmake ${{ env.NCNN_CMAKE_OPTIONS }} -DPLATFORM=SIMULATOR64 -DARCHS="x86_64" \ + -DVulkan_LIBRARY=$GITHUB_WORKSPACE/MoltenVK/MoltenVK/static/MoltenVK.xcframework/ios-arm64_x86_64-simulator/libMoltenVK.a .. + cmake --build . -j 4 + - name: simulator-arm64 + run: | + mkdir build-simulator-arm64 && cd build-simulator-arm64 + cmake ${{ env.NCNN_CMAKE_OPTIONS }} -DPLATFORM=SIMULATORARM64 -DARCHS="arm64" \ + -DVulkan_LIBRARY=$GITHUB_WORKSPACE/MoltenVK/MoltenVK/static/MoltenVK.xcframework/ios-arm64_x86_64-simulator/libMoltenVK.a .. + cmake --build . -j 4 diff --git a/.github/workflows/mac-catalyst.yml b/.github/workflows/mac-catalyst.yml index 4dcdb06a6cd..60bffcc75f6 100644 --- a/.github/workflows/mac-catalyst.yml +++ b/.github/workflows/mac-catalyst.yml @@ -4,6 +4,7 @@ on: branches: [master] paths: - '.github/workflows/mac-catalyst.yml' + - 'toolchains/ios.toolchain.cmake' - 'CMakeLists.txt' - 'cmake/**' - 'src/*' @@ -15,6 +16,7 @@ on: branches: [master] paths: - '.github/workflows/mac-catalyst.yml' + - 'toolchains/ios.toolchain.cmake' - 'CMakeLists.txt' - 'cmake/**' - 'src/*' diff --git a/.github/workflows/macos-arm64-cpu.yml b/.github/workflows/macos-arm64-cpu.yml deleted file mode 100644 index 09351c2f08d..00000000000 --- a/.github/workflows/macos-arm64-cpu.yml +++ /dev/null @@ -1,116 +0,0 @@ -name: macos-arm64-cpu -on: - push: - branches: [master] - paths: - - '.github/workflows/macos-arm64-cpu.yml' - - 'CMakeLists.txt' - - 'cmake/**' - - 'src/*' - - 'src/layer/*' - - 'src/layer/arm/**' - pull_request: - branches: [master] - paths: - - '.github/workflows/macos-arm64-cpu.yml' - - 'CMakeLists.txt' - - 'cmake/**' - - 'src/*' - - 'src/layer/*' - - 'src/layer/arm/**' -concurrency: - group: macos-arm64-cpu-${{ github.ref }} - cancel-in-progress: true -env: - DEVELOPER_DIR: /Applications/Xcode_13.4.1.app/Contents/Developer - MAC_DEPLOYMENT_TARGET: '10.13' - MAC_ARM64_DEPLOYMENT_TARGET: '11.0' - ENABLE_BITCODE: OFF - ENABLE_ARC: OFF - ENABLE_VISIBILITY: OFF -permissions: - contents: read - -jobs: - macos-clang: - runs-on: macos-12 - steps: - - uses: actions/checkout@v4 - - - name: cache-openmp - id: cache-openmp - uses: actions/cache@v4 - with: - path: openmp-install - key: openmp-macos-install-20230504 - - name: openmp - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - wget https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/openmp-11.0.0.src.tar.xz - tar -xf openmp-11.0.0.src.tar.xz - cd openmp-11.0.0.src - sed -i'' -e '/.size __kmp_unnamed_critical_addr/d' runtime/src/z_Linux_asm.S - sed -i'' -e 's/__kmp_unnamed_critical_addr/___kmp_unnamed_critical_addr/g' runtime/src/z_Linux_asm.S - - name: openmp-build-x86_64 - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - cd openmp-11.0.0.src - mkdir -p build-x86_64 && cd build-x86_64 - cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=MAC -DARCHS="x86_64" \ - -DDEPLOYMENT_TARGET=$MAC_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - -DPERL_EXECUTABLE=/usr/local/bin/perl \ - -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF .. - cmake --build . -j 3 - cmake --build . --target install - - name: openmp-build-arm64 - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - cd openmp-11.0.0.src - mkdir -p build-arm64 && cd build-arm64 - cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=MAC_ARM64 -DARCHS="arm64" \ - -DDEPLOYMENT_TARGET=$MAC_ARM64_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - -DPERL_EXECUTABLE=/usr/local/bin/perl \ - -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF .. - cmake --build . -j 3 - cmake --build . --target install - - name: openmp-merge-fat-library - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - mkdir -p $GITHUB_WORKSPACE/openmp-install - cp -a openmp-11.0.0.src/build-x86_64/install/include $GITHUB_WORKSPACE/openmp-install - mkdir -p $GITHUB_WORKSPACE/openmp-install/lib - lipo -create \ - openmp-11.0.0.src/build-x86_64/install/lib/libomp.a \ - openmp-11.0.0.src/build-arm64/install/lib/libomp.a \ - -o $GITHUB_WORKSPACE/openmp-install/lib/libomp.a - - - name: install-openmp - run: | - sudo cp $GITHUB_WORKSPACE/openmp-install/include/* $DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include - sudo cp $GITHUB_WORKSPACE/openmp-install/lib/libomp.a $DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib - - - name: build - run: | - mkdir build && cd build - cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake -DPLATFORM=MAC_ARM64 -DARCHS="arm64" \ - -DDEPLOYMENT_TARGET=$MAC_ARM64_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DOpenMP_C_FLAGS="-Xclang -fopenmp" -DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \ - -DOpenMP_C_LIB_NAMES="libomp" -DOpenMP_CXX_LIB_NAMES="libomp" \ - -DOpenMP_libomp_LIBRARY="$DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libomp.a" \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF .. - cmake --build . -j 3 - - - name: build-shared - run: | - mkdir build-shared && cd build-shared - cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake -DPLATFORM=MAC_ARM64 -DARCHS="arm64" \ - -DDEPLOYMENT_TARGET=$MAC_ARM64_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DOpenMP_C_FLAGS="-Xclang -fopenmp" -DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \ - -DOpenMP_C_LIB_NAMES="libomp" -DOpenMP_CXX_LIB_NAMES="libomp" \ - -DOpenMP_libomp_LIBRARY="$DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libomp.a" \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_SHARED_LIB=ON .. - cmake --build . -j 3 diff --git a/.github/workflows/macos-arm64-gpu.yml b/.github/workflows/macos-arm64-gpu.yml deleted file mode 100644 index 1dbbe31ec32..00000000000 --- a/.github/workflows/macos-arm64-gpu.yml +++ /dev/null @@ -1,108 +0,0 @@ -name: macos-arm64-gpu -on: - push: - branches: [master] - paths: - - '.github/workflows/macos-arm64-gpu.yml' - - 'CMakeLists.txt' - - 'cmake/**' - - 'src/*' - - 'src/layer/*' - - 'src/layer/arm/**' - - 'src/layer/vulkan/**' - pull_request: - branches: [master] - paths: - - '.github/workflows/macos-arm64-gpu.yml' - - 'CMakeLists.txt' - - 'cmake/**' - - 'src/*' - - 'src/layer/*' - - 'src/layer/arm/**' - - 'src/layer/vulkan/**' -concurrency: - group: macos-arm64-gpu-${{ github.ref }} - cancel-in-progress: true -env: - DEVELOPER_DIR: /Applications/Xcode_13.4.1.app/Contents/Developer - MAC_DEPLOYMENT_TARGET: '10.9' - MAC_ARM64_DEPLOYMENT_TARGET: '11.0' - ENABLE_BITCODE: OFF - ENABLE_ARC: OFF - ENABLE_VISIBILITY: OFF -permissions: - contents: read - -jobs: - macos-clang-gpu: - runs-on: macos-12 - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - - name: cache-openmp - id: cache-openmp - uses: actions/cache@v4 - with: - path: openmp-install - key: openmp-macos-install-20230504 - - name: openmp - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - wget https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/openmp-11.0.0.src.tar.xz - tar -xf openmp-11.0.0.src.tar.xz - cd openmp-11.0.0.src - sed -i'' -e '/.size __kmp_unnamed_critical_addr/d' runtime/src/z_Linux_asm.S - sed -i'' -e 's/__kmp_unnamed_critical_addr/___kmp_unnamed_critical_addr/g' runtime/src/z_Linux_asm.S - - name: openmp-build-x86_64 - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - cd openmp-11.0.0.src - mkdir -p build-x86_64 && cd build-x86_64 - cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=MAC -DARCHS="x86_64" \ - -DDEPLOYMENT_TARGET=$MAC_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - -DPERL_EXECUTABLE=/usr/local/bin/perl \ - -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF .. - cmake --build . -j 3 - cmake --build . --target install - - name: openmp-build-arm64 - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - cd openmp-11.0.0.src - mkdir -p build-arm64 && cd build-arm64 - cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=MAC_ARM64 -DARCHS="arm64" \ - -DDEPLOYMENT_TARGET=$MAC_ARM64_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - -DPERL_EXECUTABLE=/usr/local/bin/perl \ - -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF .. - cmake --build . -j 3 - cmake --build . --target install - - name: openmp-merge-fat-library - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - mkdir -p $GITHUB_WORKSPACE/openmp-install - cp -a openmp-11.0.0.src/build-x86_64/install/include $GITHUB_WORKSPACE/openmp-install - mkdir -p $GITHUB_WORKSPACE/openmp-install/lib - lipo -create \ - openmp-11.0.0.src/build-x86_64/install/lib/libomp.a \ - openmp-11.0.0.src/build-arm64/install/lib/libomp.a \ - -o $GITHUB_WORKSPACE/openmp-install/lib/libomp.a - - - name: install-openmp - run: | - sudo cp $GITHUB_WORKSPACE/openmp-install/include/* $DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include - sudo cp $GITHUB_WORKSPACE/openmp-install/lib/libomp.a $DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib - - - name: build - run: | - mkdir build && cd build - cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake -DPLATFORM=MAC_ARM64 -DARCHS="arm64" \ - -DDEPLOYMENT_TARGET=$MAC_ARM64_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DOpenMP_C_FLAGS="-Xclang -fopenmp" -DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \ - -DOpenMP_C_LIB_NAMES="libomp" -DOpenMP_CXX_LIB_NAMES="libomp" \ - -DOpenMP_libomp_LIBRARY="$DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libomp.a" \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - -DNCNN_VULKAN=ON -DNCNN_BUILD_BENCHMARK=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF .. - cmake --build . -j 3 diff --git a/.github/workflows/macos-x64-cpu.yml b/.github/workflows/macos-x64-cpu.yml deleted file mode 100644 index 6db56205b70..00000000000 --- a/.github/workflows/macos-x64-cpu.yml +++ /dev/null @@ -1,132 +0,0 @@ -name: macos-x64-cpu -on: - push: - branches: [master] - paths: - - '.github/workflows/macos-x64-cpu.yml' - - 'CMakeLists.txt' - - 'cmake/**' - - 'src/*' - - 'src/layer/*' - - 'src/layer/x86/**' - - 'tests/**' - - 'tools/**' - - '!tools/pnnx/**' - - 'examples/**' - pull_request: - branches: [master] - paths: - - '.github/workflows/macos-x64-cpu.yml' - - 'CMakeLists.txt' - - 'cmake/**' - - 'src/*' - - 'src/layer/*' - - 'src/layer/x86/**' - - 'tests/**' - - 'tools/**' - - '!tools/pnnx/**' - - 'examples/**' -concurrency: - group: macos-x64-cpu-${{ github.ref }} - cancel-in-progress: true -env: - DEVELOPER_DIR: /Applications/Xcode_13.4.1.app/Contents/Developer - MAC_DEPLOYMENT_TARGET: '10.9' - MAC_ARM64_DEPLOYMENT_TARGET: '11.0' - ENABLE_BITCODE: OFF - ENABLE_ARC: OFF - ENABLE_VISIBILITY: OFF -permissions: - contents: read - -jobs: - macos-clang: - runs-on: macos-12 - steps: - - uses: actions/checkout@v4 - - - name: protobuf - run: brew install protobuf opencv3 - - - name: cache-openmp - id: cache-openmp - uses: actions/cache@v4 - with: - path: openmp-install - key: openmp-macos-install-20230504 - - name: openmp - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - wget https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/openmp-11.0.0.src.tar.xz - tar -xf openmp-11.0.0.src.tar.xz - cd openmp-11.0.0.src - sed -i'' -e '/.size __kmp_unnamed_critical_addr/d' runtime/src/z_Linux_asm.S - sed -i'' -e 's/__kmp_unnamed_critical_addr/___kmp_unnamed_critical_addr/g' runtime/src/z_Linux_asm.S - - name: openmp-build-x86_64 - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - cd openmp-11.0.0.src - mkdir -p build-x86_64 && cd build-x86_64 - cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=MAC -DARCHS="x86_64" \ - -DDEPLOYMENT_TARGET=$MAC_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - -DPERL_EXECUTABLE=/usr/local/bin/perl \ - -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF .. - cmake --build . -j 3 - cmake --build . --target install - - name: openmp-build-arm64 - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - cd openmp-11.0.0.src - mkdir -p build-arm64 && cd build-arm64 - cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=MAC_ARM64 -DARCHS="arm64" \ - -DDEPLOYMENT_TARGET=$MAC_ARM64_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - -DPERL_EXECUTABLE=/usr/local/bin/perl \ - -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF .. - cmake --build . -j 3 - cmake --build . --target install - - name: openmp-merge-fat-library - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - mkdir -p $GITHUB_WORKSPACE/openmp-install - cp -a openmp-11.0.0.src/build-x86_64/install/include $GITHUB_WORKSPACE/openmp-install - mkdir -p $GITHUB_WORKSPACE/openmp-install/lib - lipo -create \ - openmp-11.0.0.src/build-x86_64/install/lib/libomp.a \ - openmp-11.0.0.src/build-arm64/install/lib/libomp.a \ - -o $GITHUB_WORKSPACE/openmp-install/lib/libomp.a - - - name: install-openmp - run: | - sudo cp $GITHUB_WORKSPACE/openmp-install/include/* $DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include - sudo cp $GITHUB_WORKSPACE/openmp-install/lib/libomp.a $DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib - - - name: build - run: | - mkdir build && cd build - cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake -DPLATFORM=MAC -DARCHS="x86_64" \ - -DDEPLOYMENT_TARGET=$MAC_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DOpenMP_C_FLAGS="-Xclang -fopenmp" -DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \ - -DOpenMP_C_LIB_NAMES="libomp" -DOpenMP_CXX_LIB_NAMES="libomp" \ - -DOpenMP_libomp_LIBRARY="$DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libomp.a" \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - -DNCNN_BUILD_TESTS=ON .. - cmake --build . -j 3 - - - name: test - run: | - cd build - ctest --output-on-failure -j 3 - - - name: build-shared - run: | - mkdir build-shared && cd build-shared - cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake -DPLATFORM=MAC -DARCHS="x86_64" \ - -DDEPLOYMENT_TARGET=$MAC_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DOpenMP_C_FLAGS="-Xclang -fopenmp" -DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \ - -DOpenMP_C_LIB_NAMES="libomp" -DOpenMP_CXX_LIB_NAMES="libomp" \ - -DOpenMP_libomp_LIBRARY="$DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libomp.a" \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - -DNCNN_SHARED_LIB=ON .. - cmake --build . -j 3 diff --git a/.github/workflows/macos-x64-gpu.yml b/.github/workflows/macos-x64-gpu.yml deleted file mode 100644 index bfb2ae5805b..00000000000 --- a/.github/workflows/macos-x64-gpu.yml +++ /dev/null @@ -1,163 +0,0 @@ -name: macos-x64-gpu -on: - push: - branches: [master] - paths: - - '.github/workflows/macos-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/macos-x64-gpu.yml' - - 'CMakeLists.txt' - - 'cmake/**' - - 'src/*' - - 'src/layer/*' - - 'src/layer/x86/**' - - 'src/layer/vulkan/**' - - 'tests/**' - - 'tools/**' - - '!tools/pnnx/**' - - 'examples/**' -concurrency: - group: macos-x64-gpu-${{ github.ref }} - cancel-in-progress: true -env: - DEVELOPER_DIR: /Applications/Xcode_13.4.1.app/Contents/Developer - MAC_DEPLOYMENT_TARGET: '10.9' - MAC_ARM64_DEPLOYMENT_TARGET: '11.0' - ENABLE_BITCODE: OFF - ENABLE_ARC: OFF - ENABLE_VISIBILITY: OFF -permissions: - contents: read - -jobs: - macos-clang-gpu: - runs-on: macos-12 - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: protobuf - run: brew install protobuf opencv3 - - - name: cache-openmp - id: cache-openmp - uses: actions/cache@v4 - with: - path: openmp-install - key: openmp-macos-install-20230504 - - name: openmp - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - wget https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/openmp-11.0.0.src.tar.xz - tar -xf openmp-11.0.0.src.tar.xz - cd openmp-11.0.0.src - sed -i'' -e '/.size __kmp_unnamed_critical_addr/d' runtime/src/z_Linux_asm.S - sed -i'' -e 's/__kmp_unnamed_critical_addr/___kmp_unnamed_critical_addr/g' runtime/src/z_Linux_asm.S - - name: openmp-build-x86_64 - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - cd openmp-11.0.0.src - mkdir -p build-x86_64 && cd build-x86_64 - cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=MAC -DARCHS="x86_64" \ - -DDEPLOYMENT_TARGET=$MAC_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - -DPERL_EXECUTABLE=/usr/local/bin/perl \ - -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF .. - cmake --build . -j 3 - cmake --build . --target install - - name: openmp-build-arm64 - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - cd openmp-11.0.0.src - mkdir -p build-arm64 && cd build-arm64 - cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake -DPLATFORM=MAC_ARM64 -DARCHS="arm64" \ - -DDEPLOYMENT_TARGET=$MAC_ARM64_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - -DPERL_EXECUTABLE=/usr/local/bin/perl \ - -DLIBOMP_ENABLE_SHARED=OFF -DLIBOMP_OMPT_SUPPORT=OFF -DLIBOMP_USE_HWLOC=OFF .. - cmake --build . -j 3 - cmake --build . --target install - - name: openmp-merge-fat-library - if: steps.cache-openmp.outputs.cache-hit != 'true' - run: | - mkdir -p $GITHUB_WORKSPACE/openmp-install - cp -a openmp-11.0.0.src/build-x86_64/install/include $GITHUB_WORKSPACE/openmp-install - mkdir -p $GITHUB_WORKSPACE/openmp-install/lib - lipo -create \ - openmp-11.0.0.src/build-x86_64/install/lib/libomp.a \ - openmp-11.0.0.src/build-arm64/install/lib/libomp.a \ - -o $GITHUB_WORKSPACE/openmp-install/lib/libomp.a - - - name: install-openmp - run: | - sudo cp $GITHUB_WORKSPACE/openmp-install/include/* $DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include - sudo cp $GITHUB_WORKSPACE/openmp-install/lib/libomp.a $DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib - - - name: cache-swiftshader - id: cache-swiftshader - uses: actions/cache@v4 - with: - path: swiftshader-install - key: swiftshader-macos-install-20230420 - - name: checkout-swiftshader - if: steps.cache-swiftshader.outputs.cache-hit != 'true' - uses: actions/checkout@v4 - with: - repository: google/swiftshader - path: swiftshader - ref: dd55e592406dc0bae219df11adec6363840aff4a - - name: checkout-swiftshader-submodules - if: 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: steps.cache-swiftshader.outputs.cache-hit != 'true' - run: | - cd swiftshader - mkdir -p build; cd build - cmake -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 . -j 3 - mkdir $GITHUB_WORKSPACE/swiftshader-install - cp Darwin/* $GITHUB_WORKSPACE/swiftshader-install - - - name: build - run: | - mkdir build && cd build - cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake -DPLATFORM=MAC -DARCHS="x86_64" \ - -DDEPLOYMENT_TARGET=$MAC_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DOpenMP_C_FLAGS="-Xclang -fopenmp" -DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \ - -DOpenMP_C_LIB_NAMES="libomp" -DOpenMP_CXX_LIB_NAMES="libomp" \ - -DOpenMP_libomp_LIBRARY="$DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libomp.a" \ - -DVulkan_LIBRARY=$GITHUB_WORKSPACE/swiftshader-install/libvulkan.dylib \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - -DNCNN_VULKAN=ON -DNCNN_BUILD_TESTS=ON .. - cmake --build . -j 3 - - name: test - run: | - printf "[Processor]\nThreadCount=1\n" > build/tests/SwiftShader.ini - cd build && ctest --output-on-failure -j 3 - - name: build-shared - run: | - mkdir build-shared && cd build-shared - cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake -DPLATFORM=MAC -DARCHS="x86_64" \ - -DDEPLOYMENT_TARGET=$MAC_DEPLOYMENT_TARGET -DENABLE_BITCODE=$ENABLE_BITCODE -DENABLE_ARC=$ENABLE_ARC -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ - -DOpenMP_C_FLAGS="-Xclang -fopenmp" -DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \ - -DOpenMP_C_LIB_NAMES="libomp" -DOpenMP_CXX_LIB_NAMES="libomp" \ - -DOpenMP_libomp_LIBRARY="$DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libomp.a" \ - -DVulkan_LIBRARY=$GITHUB_WORKSPACE/swiftshader-install/libvulkan.dylib \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install \ - -DNCNN_VULKAN=ON -DNCNN_SHARED_LIB=ON .. - cmake --build . -j 3 diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 00000000000..e4df7880ac5 --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,198 @@ +name: macos +on: + push: + branches: [master] + paths: + - '.github/workflows/macos.yml' + - 'toolchains/ios.toolchain.cmake' + - 'CMakeLists.txt' + - 'cmake/**' + - 'src/*' + - 'src/layer/*' + - 'src/layer/arm/**' + - 'src/layer/x86/**' + - 'src/layer/vulkan/**' + - 'tests/**' + - 'tools/**' + - '!tools/pnnx/**' + - 'examples/**' + pull_request: + branches: [master] + paths: + - '.github/workflows/macos.yml' + - 'toolchains/ios.toolchain.cmake' + - 'CMakeLists.txt' + - 'cmake/**' + - 'src/*' + - 'src/layer/*' + - 'src/layer/arm/**' + - 'src/layer/x86/**' + - 'src/layer/vulkan/**' + - 'tests/**' + - 'tools/**' + - '!tools/pnnx/**' + - 'examples/**' +concurrency: + group: macos-${{ github.ref }} + cancel-in-progress: true +env: + DEVELOPER_DIR: /Applications/Xcode_15.2.app/Contents/Developer + MAC_DEPLOYMENT_TARGET: '11.0' + ENABLE_BITCODE: OFF + ENABLE_ARC: OFF + ENABLE_VISIBILITY: OFF +permissions: + contents: read + +jobs: + build: + runs-on: macos-13 + env: + OPENMP_VERSION: '18.1.2' + OPENMP_CMAKE_OPTIONS: | + -DCMAKE_TOOLCHAIN_FILE=../../toolchains/ios.toolchain.cmake \ + -DDEPLOYMENT_TARGET=$MAC_DEPLOYMENT_TARGET \ + -DENABLE_BITCODE=$ENABLE_BITCODE \ + -DENABLE_ARC=$ENABLE_ARC \ + -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ + -DCMAKE_INSTALL_PREFIX=install \ + -DCMAKE_BUILD_TYPE=Release \ + -DPERL_EXECUTABLE=/usr/local/bin/perl \ + -DLIBOMP_ENABLE_SHARED=OFF \ + -DLIBOMP_OMPT_SUPPORT=OFF \ + -DLIBOMP_USE_HWLOC=OFF \ + + MOLTENVK_VERSION: 'v1.2.8' + NCNN_CMAKE_OPTIONS: | + -DCMAKE_TOOLCHAIN_FILE=../toolchains/ios.toolchain.cmake \ + -DDEPLOYMENT_TARGET=$MAC_DEPLOYMENT_TARGET \ + -DENABLE_BITCODE=$ENABLE_BITCODE \ + -DENABLE_ARC=$ENABLE_ARC \ + -DENABLE_VISIBILITY=$ENABLE_VISIBILITY \ + -DCMAKE_INSTALL_PREFIX=install \ + -DCMAKE_BUILD_TYPE=Release \ + -DOpenMP_C_FLAGS="-Xclang -fopenmp" -DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \ + -DOpenMP_C_LIB_NAMES="libomp" -DOpenMP_CXX_LIB_NAMES="libomp" \ + -DOpenMP_libomp_LIBRARY="libomp.a" \ + -DNCNN_VULKAN=ON \ + + steps: + - uses: actions/checkout@v4 + with: + submodules: true + + - name: cache-openmp + id: cache-openmp + uses: actions/cache@v4 + with: + path: openmp-install + key: openmp-macos-install-20240403 + - name: openmp + if: steps.cache-openmp.outputs.cache-hit != 'true' + run: | + wget https://github.com/llvm/llvm-project/releases/download/llvmorg-${{ env.OPENMP_VERSION }}/cmake-${{ env.OPENMP_VERSION }}.src.tar.xz + tar -xf cmake-${{ env.OPENMP_VERSION }}.src.tar.xz + wget https://github.com/llvm/llvm-project/releases/download/llvmorg-${{ env.OPENMP_VERSION }}/openmp-${{ env.OPENMP_VERSION }}.src.tar.xz + tar -xf openmp-${{ env.OPENMP_VERSION }}.src.tar.xz + mv cmake-${{ env.OPENMP_VERSION }}.src/Modules/* openmp-${{ env.OPENMP_VERSION }}.src/cmake/ + cd openmp-${{ env.OPENMP_VERSION }}.src + wget https://github.com/nihui/llvm-project/commit/ef8c35bcf5d9cfdb0764ffde6a63c04ec715bc37.patch + patch -p2 -i ef8c35bcf5d9cfdb0764ffde6a63c04ec715bc37.patch + wget https://github.com/nihui/llvm-project/commit/5c12711f9a21f41bea70566bf15a4026804d6b20.patch + patch -p2 -i 5c12711f9a21f41bea70566bf15a4026804d6b20.patch + - name: openmp-x86_64 + if: steps.cache-openmp.outputs.cache-hit != 'true' + run: | + cd openmp-${{ env.OPENMP_VERSION }}.src + mkdir -p build-x86_64 && cd build-x86_64 + cmake ${{ env.OPENMP_CMAKE_OPTIONS }} -DPLATFORM=MAC -DARCHS="x86_64" .. + cmake --build . -j 4 + cmake --build . --target install + - name: openmp-arm64 + if: steps.cache-openmp.outputs.cache-hit != 'true' + run: | + cd openmp-${{ env.OPENMP_VERSION }}.src + mkdir -p build-arm64 && cd build-arm64 + cmake ${{ env.OPENMP_CMAKE_OPTIONS }} -DPLATFORM=MAC_ARM64 -DARCHS="arm64" .. + cmake --build . -j 4 + cmake --build . --target install + - name: openmp-merge-fat-library + if: steps.cache-openmp.outputs.cache-hit != 'true' + run: | + mkdir -p $GITHUB_WORKSPACE/openmp-install + cp -a openmp-${{ env.OPENMP_VERSION }}.src/build-x86_64/install/include $GITHUB_WORKSPACE/openmp-install + mkdir -p $GITHUB_WORKSPACE/openmp-install/lib + lipo -create \ + openmp-${{ env.OPENMP_VERSION }}.src/build-x86_64/install/lib/libomp.a \ + openmp-${{ env.OPENMP_VERSION }}.src/build-arm64/install/lib/libomp.a \ + -o $GITHUB_WORKSPACE/openmp-install/lib/libomp.a + + - name: install-openmp + run: | + sudo cp $GITHUB_WORKSPACE/openmp-install/include/* $DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include + sudo cp $GITHUB_WORKSPACE/openmp-install/lib/libomp.a $DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib + + - name: cache-swiftshader + id: cache-swiftshader + uses: actions/cache@v4 + with: + path: swiftshader-install + key: swiftshader-macos-install-20230420 + - name: checkout-swiftshader + if: steps.cache-swiftshader.outputs.cache-hit != 'true' + uses: actions/checkout@v4 + with: + repository: google/swiftshader + path: swiftshader + ref: dd55e592406dc0bae219df11adec6363840aff4a + - name: checkout-swiftshader-submodules + if: 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: steps.cache-swiftshader.outputs.cache-hit != 'true' + run: | + cd swiftshader + mkdir -p build; cd build + cmake -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 . -j 3 + mkdir $GITHUB_WORKSPACE/swiftshader-install + cp Darwin/* $GITHUB_WORKSPACE/swiftshader-install + + - name: moltenvk + run: | + wget -q https://github.com/KhronosGroup/MoltenVK/releases/download/${{ env.MOLTENVK_VERSION }}/MoltenVK-all.tar + tar -xf MoltenVK-all.tar + + - name: arm64 + run: | + mkdir build-arm64 && cd build-arm64 + cmake ${{ env.NCNN_CMAKE_OPTIONS }} -DPLATFORM=MAC_ARM64 -DARCHS="arm64" \ + -DVulkan_LIBRARY=$GITHUB_WORKSPACE/MoltenVK/MoltenVK/static/MoltenVK.xcframework/macos-arm64_x86_64/libMoltenVK.a .. + cmake --build . -j 4 + - name: x86_64 + run: | + mkdir build-x86_64 && cd build-x86_64 + cmake ${{ env.NCNN_CMAKE_OPTIONS }} -DPLATFORM=MAC -DARCHS="x86_64" \ + -DVulkan_LIBRARY=$GITHUB_WORKSPACE/swiftshader-install/libvulkan.dylib \ + -DNCNN_BUILD_TESTS=ON .. + cmake --build . -j 4 + + - name: arm64-shared + run: | + mkdir build-arm64-shared && cd build-arm64-shared + cmake ${{ env.NCNN_CMAKE_OPTIONS }} -DPLATFORM=MAC_ARM64 -DARCHS="arm64" -DNCNN_SHARED_LIB=ON \ + -DVulkan_LIBRARY=$GITHUB_WORKSPACE/MoltenVK/MoltenVK/dynamic/MoltenVK.xcframework/macos-arm64_x86_64/MoltenVK.framework/MoltenVK .. + cmake --build . -j 4 + - name: x86_64-shared + run: | + mkdir build-x86_64-shared && cd build-x86_64-shared + cmake ${{ env.NCNN_CMAKE_OPTIONS }} -DPLATFORM=MAC -DARCHS="x86_64" -DNCNN_SHARED_LIB=ON \ + -DVulkan_LIBRARY=$GITHUB_WORKSPACE/MoltenVK/MoltenVK/dynamic/MoltenVK.xcframework/macos-arm64_x86_64/MoltenVK.framework/MoltenVK .. + cmake --build . -j 4 + + - name: x86_64-test + run: | + printf "[Processor]\nThreadCount=1\n" > build-x86_64/tests/SwiftShader.ini + cd build-x86_64 && ctest --output-on-failure -j 4 diff --git a/README.md b/README.md index aa05b040192..e97ca3449d5 100644 --- a/README.md +++ b/README.md @@ -135,9 +135,9 @@ https://github.com/Tencent/ncnn/releases/latest [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240102-ios-vulkan-bitcode.zip) -