-
Notifications
You must be signed in to change notification settings - Fork 14
93 lines (89 loc) · 4.98 KB
/
build.yml
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
90
91
92
93
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-20.04
steps:
- uses: actions/checkout@v2
- name: Install GCC 8
run: |
sudo apt-get update
sudo apt install gcc-8 g++-8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 80
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 80
- name: Install CUDA toolkit
uses: Jimver/cuda-toolkit@v0.2.16
with:
cuda: '10.1.243'
- name: Download LLVM
run: |
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0/clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz
tar -xf clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz
export PATH=$PWD/clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04/bin:$PATH
which clang
llvm-config --version
clang --version
llvm-config --includedir
- name: Download external files
run: |
git submodule init
git submodule update
- name: Build project
run: |
mkdir build
cd build
CC=gcc CXX=g++ cmake .. -DLLVM_CONFIG_PATH=`which llvm-config` -DCUDA_PATH=$CUDA_PATH -DHETERO_MARK_DATA=${{ github.workspace }}/data
make VERBOSE=1 -j8
- name: clone SC evaluation code
run: |
cd ${{ github.workspace }}
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=$CUDA_PATH --cuda-gpu-arch=sm_50 -L$CUDA_PATH/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
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
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 Hetero-mark benchmark
# run: |
# cd ${{ github.workspace }}/build
# make CTEST_OUTPUT_ON_FAILURE=1 test
# - 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 -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
# ./lavaMD -boxes1d 10