CuPBoP/.github/workflows/build.yml

84 lines
4.5 KiB
YAML
Raw Normal View History

2022-01-14 02:30:45 +08:00
name: build
on:
push:
paths-ignore:
- '*.md'
pull_request:
paths-ignore:
- '*.md'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
2022-06-18 11:46:45 +08:00
version: "14.0"
2022-05-04 21:11:31 +08:00
- name: Download CUDA files used for compiling NVVM IR
run: |
cd ${{ github.workspace }}
wget https://www.dropbox.com/s/4pckqsjnl920gpn/cuda-10.1.tar.gz?dl=1
tar -xzf 'cuda-10.1.tar.gz?dl=1'
2022-09-08 07:50:49 +08:00
- name: Download external files
run: |
git submodule init
git submodule update
2022-01-14 02:30:45 +08:00
- name: Build project
run: |
mkdir build
cd build
2022-09-26 00:58:58 +08:00
cmake .. -DLLVM_CONFIG_PATH=`which llvm-config` -DCUDA_PATH=${{ github.workspace }}/cuda-10.1 -DHETERO_MARK_DATA=${{ github.workspace }}/data
2022-05-04 21:11:31 +08:00
make -j8
- name: clone SC evaluation code
run: |
cd ${{ github.workspace }}
2022-09-08 07:50:49 +08:00
git clone https://github.com/drcut/SC_evaluate
- name: Execute the static shared memory demo
run: |
cd ${{ github.workspace }}/examples/sharedMemory
clang++ -std=c++11 reverse.cu -I../.. --cuda-path=${{ github.workspace }}/cuda-10.1 --cuda-gpu-arch=sm_50 -L${{ github.workspace }}/cuda-10.1/lib64 -lcudart_static -ldl -lrt -pthread -save-temps -v || true
export LD_LIBRARY_PATH=${{ github.workspace }}/build/runtime:${{ github.workspace }}/build/runtime/threadPool:$LD_LIBRARY_PATH
export PATH=${{ github.workspace }}/build/compilation:$PATH
kernelTranslator reverse-cuda-nvptx64-nvidia-cuda-sm_50.bc kernel.bc
2022-09-16 09:04:51 +08:00
hostTranslator reverse-host-x86_64-unknown-linux-gnu.bc host.bc
llc --relocation-model=pic --filetype=obj kernel.bc
llc --relocation-model=pic --filetype=obj host.bc
g++ -o reverse -fPIC -no-pie -L${{ github.workspace }}/build/runtime -L${{ github.workspace }}/build/runtime/threadPool host.o kernel.o -lc -lCPUruntime -lthreadPool -lpthread
./reverse
- name: Execute the dynamic shared memory demo
run: |
cd ${{ github.workspace }}/examples/dynamicSharedMemory
clang++ -std=c++11 reverse.cu -I../.. --cuda-path=${{ github.workspace }}/cuda-10.1 --cuda-gpu-arch=sm_50 -L${{ github.workspace }}/cuda-10.1/lib64 -lcudart_static -ldl -lrt -pthread -save-temps -v || true
export LD_LIBRARY_PATH=${{ github.workspace }}/build/runtime:${{ github.workspace }}/build/runtime/threadPool:$LD_LIBRARY_PATH
export PATH=${{ github.workspace }}/build/compilation:$PATH
kernelTranslator reverse-cuda-nvptx64-nvidia-cuda-sm_50.bc kernel.bc
2022-09-16 09:04:51 +08:00
hostTranslator reverse-host-x86_64-unknown-linux-gnu.bc host.bc
llc --relocation-model=pic --filetype=obj kernel.bc
llc --relocation-model=pic --filetype=obj host.bc
g++ -o reverse -fPIC -no-pie -L${{ github.workspace }}/build/runtime -L${{ github.workspace }}/build/runtime/threadPool host.o kernel.o -lc -lCPUruntime -lthreadPool -lpthread
./reverse
2022-09-26 00:35:49 +08:00
- name: Execute Hetero-mark benchmark
2022-05-04 21:11:31 +08:00
run: |
2022-09-26 00:35:49 +08:00
cd ${{ github.workspace }}/build
2022-09-26 01:18:47 +08:00
make CTEST_OUTPUT_ON_FAILURE=1 test
2022-05-04 21:11:31 +08:00
- name: Execute the lavaMD example
2022-01-14 02:30:45 +08:00
run: |
2022-05-04 21:11:31 +08:00
cd ${{ github.workspace }}/SC_evaluate/rodinia-cox/lavaMD
clang++ kernel/kernel_gpu_cuda_wrapper.cu --cuda-path=${{ github.workspace }}/cuda-10.1 --cuda-gpu-arch=sm_61 -L${{ github.workspace }}/cuda-10.1/lib64 -lcudart_static -ldl -lrt -pthread -save-temps -v || true
export LD_LIBRARY_PATH=${{ github.workspace }}/build/runtime:${{ github.workspace }}/build/runtime/threadPool:$LD_LIBRARY_PATH
export PATH=${{ github.workspace }}/build/compilation:$PATH
kernelTranslator kernel_gpu_cuda_wrapper-cuda-nvptx64-nvidia-cuda-sm_61.bc kernel.bc
hostTranslator kernel_gpu_cuda_wrapper-host-x86_64-unknown-linux-gnu.bc host.bc
llc --relocation-model=pic --filetype=obj kernel.bc
llc --relocation-model=pic --filetype=obj host.bc
g++ -o lavaMD -fPIC -no-pie -I${{ github.workspace }}/runtime/threadPool/include -I${{ github.workspace }}/cuda-10.1/include -L${{ github.workspace }}/build/runtime -L${{ github.workspace }}/build/runtime/threadPool main.c host.o kernel.o util/timer/timer.c util/num/num.c -lpthread -lc -lCPUruntime -lthreadPool -pthread
2022-05-04 21:11:31 +08:00
./lavaMD -boxes1d 10