Skip to content

Commit 96bf226

Browse files
committed
gh-actions: Add loongarch64 CI
1 parent db9a42f commit 96bf226

File tree

1 file changed

+110
-0
lines changed

1 file changed

+110
-0
lines changed

.github/workflows/loongarch64.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: loongarch64 qemu test
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
TEST:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
include:
12+
- target: LOONGSONGENERIC
13+
triple: loongarch64-unknown-linux-gnu
14+
opts: NO_SHARED=1 TARGET=LOONGSONGENERIC
15+
- target: LOONGSON3R5
16+
triple: loongarch64-unknown-linux-gnu
17+
opts: NO_SHARED=1 TARGET=LOONGSON3R5
18+
- target: LOONGSON2K1000
19+
triple: loongarch64-unknown-linux-gnu
20+
opts: NO_SHARED=1 TARGET=LOONGSON2K1000
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v3
25+
26+
- name: Install APT deps
27+
run: |
28+
sudo add-apt-repository ppa:savoury1/virtualisation
29+
sudo apt-get update
30+
sudo apt-get install autoconf automake autotools-dev ninja-build make ccache \
31+
qemu-user-static
32+
33+
- name: Download and install loongarch64-toolchain
34+
run: |
35+
wget https://github.com/loongson/build-tools/releases/download/2022.09.06/loongarch64-clfs-7.3-cross-tools-gcc-glibc.tar.xz
36+
tar -xf loongarch64-clfs-7.3-cross-tools-gcc-glibc.tar.xz -C /opt
37+
38+
- name: Set env
39+
run: |
40+
echo "LD_LIBRARY_PATH=/opt/cross-tools/target/usr/lib64:/opt/cross-tools/loongarch64-unknown-linux-gnu/lib64:$LD_LIBRARY_PATH" >> $GITHUB_ENV
41+
echo "PATH=$GITHUB_WORKSPACE:/opt/cross-tools/bin:$PATH" >> $GITHUB_ENV
42+
43+
- name: Compilation cache
44+
uses: actions/cache@v3
45+
with:
46+
path: ~/.ccache
47+
key: ccache-${{ runner.os }}-${{ matrix.target }}-${{ github.ref }}-${{ github.sha }}
48+
restore-keys: |
49+
ccache-${{ runner.os }}-${{ matrix.target }}-${{ github.ref }}
50+
ccache-${{ runner.os }}-${{ matrix.target }}
51+
52+
- name: Configure ccache
53+
run: |
54+
test -d ~/.ccache || mkdir -p ~/.ccache
55+
echo "max_size = 300M" > ~/.ccache/ccache.conf
56+
echo "compression = true" >> ~/.ccache/ccache.conf
57+
ccache -s
58+
59+
- name: Disable utest dsdot:dsdot_n_1
60+
run: |
61+
echo -n > utest/test_dsdot.c
62+
echo "Due to the qemu versions 7.2 causing utest cases to fail,"
63+
echo "the utest dsdot:dsdot_n_1 have been temporarily disabled."
64+
65+
- name: Build OpenBLAS
66+
run: make CC='ccache ${{ matrix.triple }}-gcc -static' FC='ccache ${{ matrix.triple }}-gfortran -static' ${{ matrix.opts }} HOSTCC='ccache gcc' -j$(nproc)
67+
68+
- name: Test
69+
run: |
70+
qemu-loongarch64-static ./utest/openblas_utest
71+
OPENBLAS_NUM_THREADS=2 qemu-loongarch64-static ./ctest/xscblat1
72+
OPENBLAS_NUM_THREADS=2 qemu-loongarch64-static ./ctest/xdcblat1
73+
OPENBLAS_NUM_THREADS=2 qemu-loongarch64-static ./ctest/xccblat1
74+
OPENBLAS_NUM_THREADS=2 qemu-loongarch64-static ./ctest/xzcblat1
75+
OPENBLAS_NUM_THREADS=2 qemu-loongarch64-static ./ctest/xscblat2 < ./ctest/sin2
76+
OPENBLAS_NUM_THREADS=2 qemu-loongarch64-static ./ctest/xdcblat2 < ./ctest/din2
77+
OPENBLAS_NUM_THREADS=2 qemu-loongarch64-static ./ctest/xccblat2 < ./ctest/cin2
78+
OPENBLAS_NUM_THREADS=2 qemu-loongarch64-static ./ctest/xzcblat2 < ./ctest/zin2
79+
OPENBLAS_NUM_THREADS=2 qemu-loongarch64-static ./ctest/xscblat3 < ./ctest/sin3
80+
OPENBLAS_NUM_THREADS=2 qemu-loongarch64-static ./ctest/xdcblat3 < ./ctest/din3
81+
OPENBLAS_NUM_THREADS=2 qemu-loongarch64-static ./ctest/xccblat3 < ./ctest/cin3
82+
OPENBLAS_NUM_THREADS=2 qemu-loongarch64-static ./ctest/xzcblat3 < ./ctest/zin3
83+
OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 qemu-loongarch64-static ./test/sblat1
84+
OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 qemu-loongarch64-static ./test/dblat1
85+
OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 qemu-loongarch64-static ./test/cblat1
86+
OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 qemu-loongarch64-static ./test/zblat1
87+
OPENBLAS_NUM_THREADS=2 qemu-loongarch64-static ./test/sblat1
88+
OPENBLAS_NUM_THREADS=2 qemu-loongarch64-static ./test/dblat1
89+
OPENBLAS_NUM_THREADS=2 qemu-loongarch64-static ./test/cblat1
90+
OPENBLAS_NUM_THREADS=2 qemu-loongarch64-static ./test/zblat1
91+
rm -f ./test/?BLAT2.SUMM
92+
OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 qemu-loongarch64-static ./test/sblat2 < ./test/sblat2.dat
93+
OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 qemu-loongarch64-static ./test/dblat2 < ./test/dblat2.dat
94+
OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 qemu-loongarch64-static ./test/cblat2 < ./test/cblat2.dat
95+
OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 qemu-loongarch64-static ./test/zblat2 < ./test/zblat2.dat
96+
rm -f ./test/?BLAT2.SUMM
97+
OPENBLAS_NUM_THREADS=2 qemu-loongarch64-static ./test/sblat2 < ./test/sblat2.dat
98+
OPENBLAS_NUM_THREADS=2 qemu-loongarch64-static ./test/dblat2 < ./test/dblat2.dat
99+
OPENBLAS_NUM_THREADS=2 qemu-loongarch64-static ./test/cblat2 < ./test/cblat2.dat
100+
OPENBLAS_NUM_THREADS=2 qemu-loongarch64-static ./test/zblat2 < ./test/zblat2.dat
101+
rm -f ./test/?BLAT3.SUMM
102+
OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 qemu-loongarch64-static ./test/sblat3 < ./test/sblat3.dat
103+
OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 qemu-loongarch64-static ./test/dblat3 < ./test/dblat3.dat
104+
OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 qemu-loongarch64-static ./test/cblat3 < ./test/cblat3.dat
105+
OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 qemu-loongarch64-static ./test/zblat3 < ./test/zblat3.dat
106+
rm -f ./test/?BLAT3.SUMM
107+
OPENBLAS_NUM_THREADS=2 qemu-loongarch64-static ./test/sblat3 < ./test/sblat3.dat
108+
OPENBLAS_NUM_THREADS=2 qemu-loongarch64-static ./test/dblat3 < ./test/dblat3.dat
109+
OPENBLAS_NUM_THREADS=2 qemu-loongarch64-static ./test/cblat3 < ./test/cblat3.dat
110+
OPENBLAS_NUM_THREADS=2 qemu-loongarch64-static ./test/zblat3 < ./test/zblat3.dat

0 commit comments

Comments
 (0)