Skip to content

Commit

Permalink
z
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui committed Dec 3, 2024
1 parent 3b0565e commit d4e9b72
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 3 deletions.
85 changes: 85 additions & 0 deletions .ci/test-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,91 @@ jobs:
- name: codecov
run: ./codecov -t ${{settings.CODECOV_TOKEN.access_token}} -C ${{ ci.sha }} -B ${{ ci.head_ref }} -f build/lcov.info

linux-gcc-riscv64:
name: linux-gcc-riscv64
strategy:
matrix:
OPENMP: ['OFF', 'ON']

runs-on:
pool-name: docker
container:
image: bkci/ci:ubuntu
steps:
- name: checkout
checkout: self
with:
strategy: FRESH_CHECKOUT
enableSubmodule: false
enableGitLfs: false

- name: install-deps
run: |
apt-get update
apt-get install -y lcov g++-riscv64-linux-gnu libcapstone4 libglib2.0-0
curl https://uploader.codecov.io/verification.gpg | gpg --no-default-keyring --keyring trustedkeys.gpg --import
curl -Os https://uploader.codecov.io/latest/linux/codecov
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
shasum -a 256 -c codecov.SHA256SUM
chmod +x codecov
- name: cache-qemu
id: cache-qemu
uses: cache@1.*
with:
cachePaths: qemu-install
cacheKey: qemu-riscv64-install-20230624-1

- name: checkout-qemu
if: steps.cache-qemu.outputs.cacheHit != 'true'
checkout: https://github.com/qemu/qemu.git
with:
pullType: COMMIT_ID
refName: b455ce4c2f300c8ba47cba7232dd03261368a4cb
localPath: qemu
enableSubmodule: false
enableGitLfs: false

- name: qemu
if: steps.cache-qemu.outputs.cacheHit != 'true'
run: |
echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye main' | tee -a /etc/apt/sources.list
echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye-updates main' | tee -a /etc/apt/sources.list
apt-get update
apt-get build-dep -y qemu
apt-get install -y python3-pip
python3 -m pip install --upgrade pip
apt-get remove -y python3-setuptools
pip3 install -U setuptools
cd qemu
wget https://raw.githubusercontent.com/nihui/ncnn-assets/master/qemu-patches/0007-linux-user-Expose-risc-v-V-isa-bit-in-get_elf_hwcap.patch
patch -p1 -i 0007-linux-user-Expose-risc-v-V-isa-bit-in-get_elf_hwcap.patch
./configure --prefix=${{ci.workspace}}/qemu-install --target-list=riscv64-linux-user --disable-system
make -j$(nproc)
make install
- name: build
run: |
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/riscv64-linux-gnu.toolchain.cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_OPENMP=${{matrix.OPENMP}} -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
cmake --build . -j 4
- name: test
run: |
export PATH=${{ci.workspace}}/qemu-install/bin:$PATH
cd build
TESTS_EXECUTABLE_LOADER=qemu-riscv64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/riscv64-linux-gnu" ctest --output-on-failure -j 4
- name: lcov-collect
run: |
cd build
lcov -d ./src -c -o lcov.info
lcov -r lcov.info '/usr/*' -o lcov.info
lcov -r lcov.info '*/build/*' -o lcov.info
lcov --list lcov.info
- name: codecov
run: ./codecov -t ${{settings.CODECOV_TOKEN.access_token}} -C ${{ ci.sha }} -B ${{ ci.head_ref }} -f build/lcov.info

linux-gcc-loongarch64:
name: linux-gcc-loongarch64
strategy:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/test-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,10 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
file: build-avx512-spr/lcov.info

linux-gcc-riscv64:
linux-gcc-riscv64-rvv:
strategy:
matrix:
openmp: [ON, OFF]
rvv: [ON, OFF]
runs-on: [self-hosted, linux, ubuntu]
steps:
- uses: actions/checkout@v4
Expand All @@ -159,7 +158,7 @@ jobs:
export RISCV_ROOT_PATH=/data/action/osd/riscv
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/riscv64-unknown-linux-gnu.toolchain.cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_RVV=${{ matrix.rvv }} -DNCNN_ZFH=${{ matrix.rvv }} -DNCNN_ZVFH=${{ matrix.rvv }} -DNCNN_OPENMP=${{ matrix.openmp }} -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON -DCMAKE_C_FLAGS="-O1" -DCMAKE_CXX_FLAGS="-O1" ..
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/riscv64-unknown-linux-gnu.toolchain.cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_RVV=ON -DNCNN_ZFH=ON -DNCNN_ZVFH=ON -DNCNN_OPENMP=${{ matrix.openmp }} -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON -DCMAKE_C_FLAGS="-O1" -DCMAKE_CXX_FLAGS="-O1" ..
cmake --build . -j 8
- name: test-vlen256
Expand Down

0 comments on commit d4e9b72

Please sign in to comment.