From a7969e8f744cf8a98014393d4a74f5a14dc0e3f8 Mon Sep 17 00:00:00 2001 From: Han Ruobing Date: Wed, 4 May 2022 09:11:31 -0400 Subject: [PATCH] add CI/CD for unittest --- .github/workflows/build.yml | 131 ++++++++++++++++++++++++++++++++++-- 1 file changed, 127 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 05e8dc3..368d98d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,13 +22,136 @@ jobs: uses: KyleMayes/install-llvm-action@v1 with: version: "10.0" + - name: Download CUDA header files + run: | + cd ${{ github.workspace }} + wget https://www.dropbox.com/s/r18io0zu3idke5p/cuda-header.tar.gz?dl=1 + tar -xzf 'cuda-header.tar.gz?dl=1' + cp -r include/* runtime/threadPool/include/ + - 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' - name: Build project run: | mkdir build cd build cmake .. -DLLVM_CONFIG_PATH=`which llvm-config` - make - - name: Execute the test example + make -j8 + - name: clone SC evaluation code run: | - cd ${{ github.workspace }}/compilation/examples - bash run_example.sh + cd ${{ github.workspace }} + git clone https://github.com/drcut/SC_evaluate + - name: Download data used to verify + run: | + cd ${{ github.workspace }}/SC_evaluate/Hetero-cox + wget https://www.dropbox.com/s/ie2hcxw9lfoghg8/data.tar.gz?dl=1 + tar -xzf 'data.tar.gz?dl=1' + - name: Execute the AES example + run: | + cd ${{ github.workspace }}/SC_evaluate/Hetero-cox/src/aes + clang++ -std=c++11 cuda/aes_cuda_benchmark.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 aes_cuda_benchmark-cuda-nvptx64-nvidia-cuda-sm_50.bc kernel.bc + hostTranslator aes_cuda_benchmark-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 aes -fPIC -no-pie -L${{ github.workspace }}/build/runtime -L${{ github.workspace }}/build/runtime/threadPool cuda/main.cc host.o kernel.o *.cc ../common/benchmark/*.cc ../common/command_line_option/*.cc ../common/time_measurement/*.cc -I../.. -lpthread -lc -lx86Runtime -lthreadPool + ./aes -i ../../data/aes/1KB.data -k ../../data/aes/key.data -q -v + - name: Execute the BS example + run: | + cd ${{ github.workspace }}/SC_evaluate/Hetero-cox/src/bs + clang++ -std=c++11 cuda/bs_cuda_benchmark.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 bs_cuda_benchmark-cuda-nvptx64-nvidia-cuda-sm_50.bc kernel.bc + hostTranslator bs_cuda_benchmark-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 bs -fPIC -no-pie -I${{ github.workspace }}/runtime/threadPool/include -L${{ github.workspace }}/build/runtime -L${{ github.workspace }}/build/runtime/threadPool cuda/main.cc host.o kernel.o *.cc ../common/benchmark/*.cc ../common/command_line_option/*.cc ../common/time_measurement/*.cc -I../.. -lpthread -lc -lx86Runtime -lthreadPool + ./bs -x 16777216 -q -t --chunk 512 -v + - name: Execute the EP example + run: | + cd ${{ github.workspace }}/SC_evaluate/Hetero-cox/src/ep + clang++ -std=c++11 cuda/ep_cuda_benchmark.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 ep_cuda_benchmark-cuda-nvptx64-nvidia-cuda-sm_50.bc kernel.bc + hostTranslator ep_cuda_benchmark-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 ep -fPIC -no-pie -I${{ github.workspace }}/runtime/threadPool/include -L${{ github.workspace }}/build/runtime -L${{ github.workspace }}/build/runtime/threadPool cuda/main.cc host.o kernel.o *.cc ../common/benchmark/*.cc ../common/command_line_option/*.cc ../common/time_measurement/*.cc -I../.. -lpthread -lc -lx86Runtime -lthreadPool + ./ep -q -v + - name: Execute the FIR example + run: | + cd ${{ github.workspace }}/SC_evaluate/Hetero-cox/src/fir + clang++ -std=c++11 cuda/fir_cuda_benchmark.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 fir_cuda_benchmark-cuda-nvptx64-nvidia-cuda-sm_50.bc kernel.bc + hostTranslator fir_cuda_benchmark-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 fir -fPIC -no-pie -I${{ github.workspace }}/runtime/threadPool/include -L${{ github.workspace }}/build/runtime -L${{ github.workspace }}/build/runtime/threadPool cuda/main.cc host.o kernel.o *.cc ../common/benchmark/*.cc ../common/command_line_option/*.cc ../common/time_measurement/*.cc -I../.. -lpthread -lc -lx86Runtime -lthreadPool + ./fir -q -v + - name: Execute the GA example + run: | + cd ${{ github.workspace }}/SC_evaluate/Hetero-cox/src/ga + clang++ -std=c++11 cuda/ga_cuda_benchmark.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 ga_cuda_benchmark-cuda-nvptx64-nvidia-cuda-sm_50.bc kernel.bc + hostTranslator ga_cuda_benchmark-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 ga -fPIC -no-pie -I${{ github.workspace }}/runtime/threadPool/include -L${{ github.workspace }}/build/runtime -L${{ github.workspace }}/build/runtime/threadPool cuda/main.cc host.o kernel.o *.cc ../common/benchmark/*.cc ../common/command_line_option/*.cc ../common/time_measurement/*.cc -I../.. -lpthread -lc -lx86Runtime -lthreadPool + - name: Execute the HIST example + run: | + cd ${{ github.workspace }}/SC_evaluate/Hetero-cox/src/hist + clang++ -std=c++11 cuda/hist_cuda_benchmark.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 hist_cuda_benchmark-cuda-nvptx64-nvidia-cuda-sm_50.bc kernel.bc + hostTranslator hist_cuda_benchmark-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 hist -fPIC -no-pie -I${{ github.workspace }}/runtime/threadPool/include -L${{ github.workspace }}/build/runtime -L${{ github.workspace }}/build/runtime/threadPool cuda/main.cc host.o kernel.o *.cc ../common/benchmark/*.cc ../common/command_line_option/*.cc ../common/time_measurement/*.cc -I../.. -lpthread -lc -lx86Runtime -lthreadPool + ./hist -q -v + - name: Execute the KMeans example + run: | + cd ${{ github.workspace }}/SC_evaluate/Hetero-cox/src/kmeans + clang++ -std=c++11 cuda/kmeans_cuda_benchmark.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 kmeans_cuda_benchmark-cuda-nvptx64-nvidia-cuda-sm_50.bc kernel.bc + hostTranslator kmeans_cuda_benchmark-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 kmeans -fPIC -no-pie -I${{ github.workspace }}/runtime/threadPool/include -L${{ github.workspace }}/build/runtime -L${{ github.workspace }}/build/runtime/threadPool cuda/main.cc host.o kernel.o *.cc ../common/benchmark/*.cc ../common/command_line_option/*.cc ../common/time_measurement/*.cc -I../.. -lpthread -lc -lx86Runtime -lthreadPool + ./kmeans -i ../../data/kmeans/100_34.txt -q -v + - name: Execute the PR example + run: | + cd ${{ github.workspace }}/SC_evaluate/Hetero-cox/src/pr + clang++ -std=c++11 cuda/pr_cuda_benchmark.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 pr_cuda_benchmark-cuda-nvptx64-nvidia-cuda-sm_50.bc kernel.bc + hostTranslator pr_cuda_benchmark-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 pr -fPIC -no-pie -I${{ github.workspace }}/runtime/threadPool/include -L${{ github.workspace }}/build/runtime -L${{ github.workspace }}/build/runtime/threadPool cuda/main.cc host.o kernel.o *.cc ../common/benchmark/*.cc ../common/command_line_option/*.cc ../common/time_measurement/*.cc -I../.. -lpthread -lc -lx86Runtime -lthreadPool + ./pr -i ../../data/pr/8192.data -q -v + - name: Execute the lavaMD example + run: | + 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 -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 -lx86Runtime -lthreadPool -pthread + ./lavaMD -boxes1d 10