|
| 1 | +name: c910v qemu test |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +permissions: |
| 6 | + contents: read # to fetch code (actions/checkout) |
| 7 | + |
| 8 | +jobs: |
| 9 | + TEST: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + env: |
| 12 | + xuetie_toolchain: https://occ-oss-prod.oss-cn-hangzhou.aliyuncs.com/resource//1663142514282 |
| 13 | + toolchain_file_name: Xuantie-900-gcc-linux-5.10.4-glibc-x86_64-V2.6.1-20220906.tar.gz |
| 14 | + strategy: |
| 15 | + fail-fast: false |
| 16 | + matrix: |
| 17 | + include: |
| 18 | + - target: RISCV64_GENERIC |
| 19 | + triple: riscv64-linux-gnu |
| 20 | + apt_triple: riscv64-linux-gnu |
| 21 | + opts: NO_SHARED=1 TARGET=RISCV64_GENERIC |
| 22 | + - target: C910V |
| 23 | + triple: riscv64-unknown-linux-gnu |
| 24 | + apt_triple: riscv64-linux-gnu |
| 25 | + opts: NO_SHARED=1 TARGET=C910V |
| 26 | + |
| 27 | + steps: |
| 28 | + - name: Checkout repository |
| 29 | + uses: actions/checkout@v3 |
| 30 | + |
| 31 | + - name: install build deps |
| 32 | + run: | |
| 33 | + sudo apt-get update |
| 34 | + sudo apt-get install autoconf automake autotools-dev ninja-build make ccache \ |
| 35 | + gcc-${{ matrix.apt_triple }} gfortran-${{ matrix.apt_triple }} libgomp1-riscv64-cross |
| 36 | +
|
| 37 | + - name: checkout qemu |
| 38 | + uses: actions/checkout@v3 |
| 39 | + with: |
| 40 | + repository: T-head-Semi/qemu |
| 41 | + path: qemu |
| 42 | + ref: 1e692ebb43d396c52352406323fc782c1ac99a42 |
| 43 | + |
| 44 | + - name: build qemu |
| 45 | + run: | |
| 46 | + # Force use c910v qemu-user |
| 47 | + wget https://github.com/revyos/qemu/commit/5164bca5a4bcde4534dc1a9aa3a7f619719874cf.patch |
| 48 | + cd qemu |
| 49 | + patch -p1 < ../5164bca5a4bcde4534dc1a9aa3a7f619719874cf.patch |
| 50 | + ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=riscv64-linux-user --disable-system |
| 51 | + make -j$(nproc) |
| 52 | + make install |
| 53 | +
|
| 54 | + - name: Compilation cache |
| 55 | + uses: actions/cache@v3 |
| 56 | + with: |
| 57 | + path: ~/.ccache |
| 58 | + key: ccache-${{ runner.os }}-${{ matrix.target }}-${{ github.ref }}-${{ github.sha }} |
| 59 | + restore-keys: | |
| 60 | + ccache-${{ runner.os }}-${{ matrix.target }}-${{ github.ref }} |
| 61 | + ccache-${{ runner.os }}-${{ matrix.target }} |
| 62 | +
|
| 63 | + - name: Configure ccache |
| 64 | + run: | |
| 65 | + test -d ~/.ccache || mkdir -p ~/.ccache |
| 66 | + echo "max_size = 300M" > ~/.ccache/ccache.conf |
| 67 | + echo "compression = true" >> ~/.ccache/ccache.conf |
| 68 | + ccache -s |
| 69 | +
|
| 70 | + - name: build OpenBLAS |
| 71 | + run: | |
| 72 | + wget ${xuetie_toolchain}/${toolchain_file_name} |
| 73 | + tar -xvf ${toolchain_file_name} -C /opt |
| 74 | + export PATH="/opt/Xuantie-900-gcc-linux-5.10.4-glibc-x86_64-V2.6.1/bin:$PATH" |
| 75 | +
|
| 76 | + make CC='ccache ${{ matrix.triple }}-gcc -static' FC='ccache ${{ matrix.triple }}-gfortran -static' ${{ matrix.opts }} HOSTCC='ccache gcc' -j$(nproc) |
| 77 | +
|
| 78 | + - name: test |
| 79 | + run: | |
| 80 | + export PATH=$GITHUB_WORKSPACE/qemu-install/bin/:$PATH |
| 81 | + qemu-riscv64 ./utest/openblas_utest |
| 82 | + OPENBLAS_NUM_THREADS=2 qemu-riscv64 ./ctest/xscblat1 |
| 83 | + OPENBLAS_NUM_THREADS=2 qemu-riscv64 ./ctest/xdcblat1 |
| 84 | + OPENBLAS_NUM_THREADS=2 qemu-riscv64 ./ctest/xccblat1 |
| 85 | + OPENBLAS_NUM_THREADS=2 qemu-riscv64 ./ctest/xzcblat1 |
| 86 | + OPENBLAS_NUM_THREADS=2 qemu-riscv64 ./ctest/xscblat2 < ./ctest/sin2 |
| 87 | + OPENBLAS_NUM_THREADS=2 qemu-riscv64 ./ctest/xdcblat2 < ./ctest/din2 |
| 88 | + OPENBLAS_NUM_THREADS=2 qemu-riscv64 ./ctest/xccblat2 < ./ctest/cin2 |
| 89 | + OPENBLAS_NUM_THREADS=2 qemu-riscv64 ./ctest/xzcblat2 < ./ctest/zin2 |
| 90 | + OPENBLAS_NUM_THREADS=2 qemu-riscv64 ./ctest/xscblat3 < ./ctest/sin3 |
| 91 | + OPENBLAS_NUM_THREADS=2 qemu-riscv64 ./ctest/xdcblat3 < ./ctest/din3 |
| 92 | + OPENBLAS_NUM_THREADS=2 qemu-riscv64 ./ctest/xccblat3 < ./ctest/cin3 |
| 93 | + OPENBLAS_NUM_THREADS=2 qemu-riscv64 ./ctest/xzcblat3 < ./ctest/zin3 |
| 94 | + OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 qemu-riscv64 ./test/sblat1 |
| 95 | + OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 qemu-riscv64 ./test/dblat1 |
| 96 | + OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 qemu-riscv64 ./test/cblat1 |
| 97 | + OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 qemu-riscv64 ./test/zblat1 |
| 98 | + OPENBLAS_NUM_THREADS=2 qemu-riscv64 ./test/sblat1 |
| 99 | + OPENBLAS_NUM_THREADS=2 qemu-riscv64 ./test/dblat1 |
| 100 | + OPENBLAS_NUM_THREADS=2 qemu-riscv64 ./test/cblat1 |
| 101 | + OPENBLAS_NUM_THREADS=2 qemu-riscv64 ./test/zblat1 |
| 102 | + rm -f ./test/?BLAT2.SUMM |
| 103 | + OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 qemu-riscv64 ./test/sblat2 < ./test/sblat2.dat |
| 104 | + OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 qemu-riscv64 ./test/dblat2 < ./test/dblat2.dat |
| 105 | + OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 qemu-riscv64 ./test/cblat2 < ./test/cblat2.dat |
| 106 | + OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 qemu-riscv64 ./test/zblat2 < ./test/zblat2.dat |
| 107 | + rm -f ./test/?BLAT2.SUMM |
| 108 | + OPENBLAS_NUM_THREADS=2 qemu-riscv64 ./test/sblat2 < ./test/sblat2.dat |
| 109 | + OPENBLAS_NUM_THREADS=2 qemu-riscv64 ./test/dblat2 < ./test/dblat2.dat |
| 110 | + OPENBLAS_NUM_THREADS=2 qemu-riscv64 ./test/cblat2 < ./test/cblat2.dat |
| 111 | + OPENBLAS_NUM_THREADS=2 qemu-riscv64 ./test/zblat2 < ./test/zblat2.dat |
| 112 | + rm -f ./test/?BLAT3.SUMM |
| 113 | + OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 qemu-riscv64 ./test/sblat3 < ./test/sblat3.dat |
| 114 | + OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 qemu-riscv64 ./test/dblat3 < ./test/dblat3.dat |
| 115 | + OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 qemu-riscv64 ./test/cblat3 < ./test/cblat3.dat |
| 116 | + OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 qemu-riscv64 ./test/zblat3 < ./test/zblat3.dat |
| 117 | + rm -f ./test/?BLAT3.SUMM |
| 118 | + OPENBLAS_NUM_THREADS=2 qemu-riscv64 ./test/sblat3 < ./test/sblat3.dat |
| 119 | + OPENBLAS_NUM_THREADS=2 qemu-riscv64 ./test/dblat3 < ./test/dblat3.dat |
| 120 | + OPENBLAS_NUM_THREADS=2 qemu-riscv64 ./test/cblat3 < ./test/cblat3.dat |
| 121 | + OPENBLAS_NUM_THREADS=2 qemu-riscv64 ./test/zblat3 < ./test/zblat3.dat |
0 commit comments