forked from YADRO-KNS/halide_riscv
-
Notifications
You must be signed in to change notification settings - Fork 5
89 lines (73 loc) · 2.44 KB
/
test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Test on RISC-V
on: [workflow_dispatch, pull_request]
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Download GCC
run: |
python3 -m pip install --upgrade pip
python3 -m pip install gdown
gdown https://drive.google.com/uc?id=1U3JaUqWyRYvlhfA3lVEfwu56em-Gwonl
mkdir xuantie-gcc && cd xuantie-gcc
tar -xf ../xuantie-gcc-v2.8.0.tar.gz
- name: Download Halide
run: |
gdown https://drive.google.com/uc?id=1AoOtkFPF5yQkZIUJDvebk5unekgS0ACf
mkdir halide-install && cd halide-install
tar -xf ../halide-rvv.tar.gz
- name: Build for x86
run: |
mkdir build && cd build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DHalide_DIR=${{ github.workspace }}/halide-install/lib/cmake/Halide
make -j$(nproc --all)
- name: Generate code
run: |
export LD_LIBRARY_PATH=${{ github.workspace }}/halide-install/lib:$LD_LIBRARY_PATH
cd build
rm ${{ github.workspace }}/aot/*
./perf_algo --gtest_filter=*halide*
mv *.h *.s ${{ github.workspace }}/aot
- name: Build for RISC-V
run: |
export PATH=${{ github.workspace }}/xuantie-gcc/bin/:$PATH
mkdir build_rv64 && cd build_rv64
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/riscv64-071.toolchain.cmake \
-DHalide_INCLUDE_DIRS=${{ github.workspace }}/halide-install/include
make -j$(nproc --all)
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: halide_riscv
path: |
build_rv64/test_algo
build_rv64/perf_algo
build_rv64/libalgos.so
build_rv64/opencv-prefix/src/opencv-build/lib/*
test:
needs: build
runs-on: self-hosted
steps:
- name: CPU info
run: cat /proc/cpuinfo
- name: Download binaries
uses: actions/download-artifact@v4
with:
name: halide_riscv
- name: Run tests
run: |
chmod +x test_algo
export LD_LIBRARY_PATH=./:./opencv-prefix/src/opencv-build/lib:$LD_LIBRARY_PATH
./test_algo
- name: Run perf tests
run: |
chmod +x perf_algo
export LD_LIBRARY_PATH=./:./opencv-prefix/src/opencv-build/lib:$LD_LIBRARY_PATH
./perf_algo