Julia Parallel #76
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test on RISC-V | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- main | |
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* | |
sed -i 's|vfredusum|vfredsum|' idw.s | |
mv *.h *.s halide_runtime.o ${{ 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: Download test data | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install gdown | |
python3 -m gdown https://drive.google.com/uc?id=1tCgUEbdlLLad-ThZ5PO9gJyy9X5DCaUT | |
tar -xf test_data.tar.gz | |
- 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 |