forked from AdaptiveCpp/AdaptiveCpp
-
Notifications
You must be signed in to change notification settings - Fork 0
186 lines (183 loc) · 8.41 KB
/
linux.yml
File metadata and controls
186 lines (183 loc) · 8.41 KB
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
name: Linux build and test
on: [push, pull_request]
jobs:
prep-container:
name: Prepare CI container clang ${{ matrix.clang }}, ${{ matrix.os }}, CUDA ${{matrix.cuda_major_version}}.${{matrix.cuda_minor_version}}.${{matrix.cuda_patch_version}}, ROCm ${{matrix.rocm}}
runs-on: ubuntu-22.04
permissions:
pull-requests: read
packages: write
actions: read
outputs:
docker_matrix: ${{ steps.matrix-output.outputs.json }}
strategy:
matrix:
clang: [15, 16, 17, 18, 19, 20]
os: [ubuntu-22.04]
cuda_major_version: [11]
cuda_minor_version: [0]
cuda_patch_version: [2]
rocm: [5.4.3]
include:
- clang: 17
os: ubuntu-22.04
cuda_major_version: 11
cuda_minor_version: 0
cuda_patch_version: 2
rocm: 5.6.1
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
fetch-depth: 20
- uses: ./.github/workflows/create-ci-docker
id: docker
with:
LLVM_VERSION: ${{ matrix.clang }}
ROCM_VERSION: ${{ matrix.rocm }}
CUDA_MAJOR_VERSION: ${{ matrix.cuda_major_version }}
CUDA_MINOR_VERSION: ${{ matrix.cuda_minor_version }}
CUDA_PATCH_VERSION: ${{ matrix.cuda_patch_version }}
BASE_TAG: ${{ matrix.os }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: beacon-biosignals/matrix-output@v1
id: matrix-output
with:
yaml: |
name: ${{ matrix.clang }}-${{ matrix.os }}
clang: ${{ matrix.clang }}
os: ${{ matrix.os }}
cuda: ${{matrix.cuda_major_version}}.${{matrix.cuda_minor_version}}.${{matrix.cuda_patch_version}}
rocm: ${{matrix.rocm}}
image: ${{ steps.docker.outputs.docker_image }}
test-clang-based:
name: clang ${{ matrix.docker.clang }}, ${{ matrix.test_kind }}, CUDA ${{matrix.docker.cuda}}, ROCm ${{matrix.docker.rocm}}, ${{ matrix.docker.os }}
runs-on: ${{ matrix.docker.os }}
needs: prep-container
strategy:
matrix:
docker: ${{fromJson(needs.prep-container.outputs.docker_matrix)}}
test_kind: [omp, sscp, smcp]
container:
image: ${{ matrix.docker.image }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.job }}-${{matrix.docker.clang}}-${{matrix.docker.os}}-${{matrix.docker.cuda}}-${{matrix.docker.rocm}}-${{ matrix.test_kind }}
- name: build AdaptiveCpp
run: |
mkdir build && cd build
cmake -GNinja -DCMAKE_CXX_COMPILER=/usr/bin/clang++-${{matrix.docker.clang}} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCLANG_EXECUTABLE_PATH=/usr/bin/clang++-${{matrix.docker.clang}} -DLLVM_DIR=/usr/lib/llvm-${{matrix.docker.clang}}/cmake -DWITH_CUDA_BACKEND=ON -DWITH_ROCM_BACKEND=ON -DWITH_LEVEL_ZERO_BACKEND=ON -DCMAKE_INSTALL_PREFIX=`pwd`/install -DCUDA_TOOLKIT_ROOT_DIR=/opt/cuda -DROCM_PATH=/opt/rocm ..
ninja install
cp /opt/cuda/lib64/stubs/libcuda.so `pwd`/install/lib/libcuda.so
cp /opt/cuda/lib64/stubs/libcuda.so `pwd`/install/lib/libcuda.so.1
- name: build CPU tests
if: matrix.test_kind == 'omp'
run: |
mkdir ${GITHUB_WORKSPACE}/build/tests-cpu
cd ${GITHUB_WORKSPACE}/build/tests-cpu
cmake -GNinja -DACPP_TARGETS="omp" -DAdaptiveCpp_DIR=${GITHUB_WORKSPACE}/build/install/lib/cmake/AdaptiveCpp ${GITHUB_WORKSPACE}/tests
ninja
- name: build generic SSCP tests
if: matrix.docker.clang >= 14 && matrix.test_kind == 'sscp'
run: |
mkdir ${GITHUB_WORKSPACE}/build/tests-sscp
cd ${GITHUB_WORKSPACE}/build/tests-sscp
cmake -GNinja -DACPP_TARGETS="generic" -DAdaptiveCpp_DIR=${GITHUB_WORKSPACE}/build/install/lib/cmake/AdaptiveCpp -DWITH_PSTL_TESTS=ON -DWITH_PCUDA_TESTS=ON ${GITHUB_WORKSPACE}/tests
ninja
- name: build CUDA tests
if: matrix.test_kind == 'smcp'
run: |
mkdir ${GITHUB_WORKSPACE}/build/tests-cuda
cd ${GITHUB_WORKSPACE}/build/tests-cuda
cmake -GNinja -DACPP_TARGETS="cuda:sm_60" -DAdaptiveCpp_DIR=${GITHUB_WORKSPACE}/build/install/lib/cmake/AdaptiveCpp ${GITHUB_WORKSPACE}/tests -DCMAKE_EXE_LINKER_FLAGS="-L/usr/lib/llvm-${{matrix.docker.clang}}/lib"
ninja
- name: build ROCm tests
if: matrix.test_kind == 'smcp'
run: |
mkdir ${GITHUB_WORKSPACE}/build/tests-rocm
cd ${GITHUB_WORKSPACE}/build/tests-rocm
cmake -GNinja -DACPP_TARGETS="hip:gfx906" -DAdaptiveCpp_DIR=${GITHUB_WORKSPACE}/build/install/lib/cmake/AdaptiveCpp ${GITHUB_WORKSPACE}/tests -DCMAKE_EXE_LINKER_FLAGS="-L/usr/lib/llvm-${{matrix.docker.clang}}/lib"
ninja
- name: build explicit multipass tests
if: matrix.test_kind == 'smcp'
run: |
mkdir ${GITHUB_WORKSPACE}/build/tests-emp
cd ${GITHUB_WORKSPACE}/build/tests-emp
cmake -GNinja -DACPP_TARGETS="omp;cuda.explicit-multipass:sm_60;hip:gfx906" -DAdaptiveCpp_DIR=${GITHUB_WORKSPACE}/build/install/lib/cmake/AdaptiveCpp ${GITHUB_WORKSPACE}/tests
ninja
- name: run CPU tests
if: matrix.test_kind == 'omp'
run: |
cd ${GITHUB_WORKSPACE}/build/tests-cpu
ACPP_VISIBILITY_MASK="omp" LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/build/install/lib ./sycl_tests
- name: run CPU SSCP tests
if: matrix.docker.clang >= 14 && matrix.test_kind == 'sscp'
run: |
cd ${GITHUB_WORKSPACE}/build/tests-sscp
ACPP_VISIBILITY_MASK="omp" LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/build/install/lib ./sycl_tests
- name: run PSTL tests on CPU
if: matrix.docker.clang >= 14 && matrix.test_kind == 'sscp'
run: |
cd ${GITHUB_WORKSPACE}/build/tests-sscp
ACPP_VISIBILITY_MASK="omp" LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/build/install/lib ./pstl_tests
- name: run PCUDA tests on CPU
if: matrix.docker.clang >= 14 && matrix.test_kind == 'sscp'
run: |
cd ${GITHUB_WORKSPACE}/build/tests-sscp
ACPP_VISIBILITY_MASK="omp" LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/build/install/lib ./pcuda_tests
test-nvcxx-based:
name: nvcxx ${{matrix.nvhpc}}, ${{matrix.os}}, CUDA ${{matrix.cuda}}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
nvhpc: [23.9]
cuda: [12.2]
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: install dependencies
run : |
sudo apt-get update
sudo apt-get install -y cmake libboost-all-dev wget gpg curl
- name: install nvcxx
run: |
MAJOR_VERSION=$(echo ${{matrix.nvhpc}} | sed 's/\..*//')
MINOR_VERSION=$(echo ${{matrix.nvhpc}} | sed 's/.*\.//')
curl https://developer.download.nvidia.com/hpc-sdk/ubuntu/DEB-GPG-KEY-NVIDIA-HPC-SDK | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg
echo 'deb [signed-by=/usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg] https://developer.download.nvidia.com/hpc-sdk/ubuntu/amd64 /' | sudo tee /etc/apt/sources.list.d/nvhpc.list
sudo apt-get update -y
sudo apt-get install -y nvhpc-${MAJOR_VERSION}-${MINOR_VERSION}
- name: build AdaptiveCpp
run: |
mkdir build && cd build
export NV_HPC_SDK_ROOT=/opt/nvidia/hpc_sdk/Linux_x86_64/${{matrix.nvhpc}}
export NV_HPC_CUDA_ROOT=${NV_HPC_SDK_ROOT}/cuda/${{matrix.cuda}}
cmake -DNVCXX_COMPILER=${NV_HPC_SDK_ROOT}/compilers/bin/nvc++ -DWITH_CUDA_BACKEND=ON -DACPP_COMPILER_FEATURE_PROFILE=none -DCMAKE_INSTALL_PREFIX=`pwd`/install -DCUDA_TOOLKIT_ROOT_DIR=${NV_HPC_CUDA_ROOT} ..
make -j2 install
cp ${NV_HPC_CUDA_ROOT}/lib64/stubs/libcuda.so `pwd`/install/lib/libcuda.so
cp ${NV_HPC_CUDA_ROOT}/lib64/stubs/libcuda.so `pwd`/install/lib/libcuda.so.1
- name: build tests
run: |
mkdir ${GITHUB_WORKSPACE}/build/tests-nvcxx
cmake -DACPP_TARGETS="cuda-nvcxx" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-DHIPSYCL_NO_FIBERS" -DAdaptiveCpp_DIR=${GITHUB_WORKSPACE}/build/install/lib/cmake/AdaptiveCpp ${GITHUB_WORKSPACE}/tests
make -j2