-
Notifications
You must be signed in to change notification settings - Fork 119
96 lines (92 loc) · 3.86 KB
/
Copy pathtest-acpp.yml
File metadata and controls
96 lines (92 loc) · 3.86 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
name: Test AdaptiveCpp
on: [push, pull_request]
jobs:
validate-lessons:
name: Validate Handling_Errors lesson
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.14"
- name: Validate lesson HTML
run: python ./Scripts/LessonChecker.py --verify Lesson_Materials/Handling_Errors/index.html
test-acpp:
name: acpp llvm ${{ matrix.clang }}, ${{ matrix.os }}
needs: validate-lessons
runs-on: ${{ matrix.os }}
strategy:
matrix:
clang: [20]
os: [ubuntu-22.04]
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Add Intel OpenCL apt repository
run: |
sudo wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | sudo gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
- name: Add LLVM apt repository
run: |
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc > /dev/null
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-${{matrix.clang}} main" | sudo tee /etc/apt/sources.list.d/llvm.list
sudo apt-get update
- name: Install OpenCL and LLVM packages
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: >-
intel-oneapi-runtime-opencl-2024
intel-oneapi-runtime-compilers-2024
ocl-icd-libopencl1
ocl-icd-opencl-dev
cmake
ninja-build
build-essential
git
clang-${{matrix.clang}}
lld-${{matrix.clang}}
libclang-${{matrix.clang}}-dev
clang-tools-${{matrix.clang}}
libomp-${{matrix.clang}}-dev
llvm-${{matrix.clang}}-dev
version: clang${{ matrix.clang }}
- name: cache AdaptiveCPP build
id: cache-adaptivecpp
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/adaptivecpp/build/install
key: ${{ runner.os }}-adaptivecpp-v25.10.0-clang${{ matrix.clang }}
- name: build AdaptiveCpp
if: steps.cache-adaptivecpp.outputs.cache-hit != 'true'
run: |
git clone https://github.com/adaptivecpp/adaptivecpp -b v25.10.0
mkdir -p adaptivecpp/build && cd adaptivecpp/build
cmake -DCMAKE_CXX_COMPILER=/usr/bin/clang++-${{matrix.clang}} -DCLANG_EXECUTABLE_PATH=/usr/bin/clang++-${{matrix.clang}} -DLLVM_DIR=/usr/lib/llvm-${{matrix.clang}}/cmake -DWITH_OPENCL_BACKEND=ON -DCMAKE_INSTALL_PREFIX=`pwd`/install ..
make -j2 install
- name: Print detected devices
run: |
${GITHUB_WORKSPACE}/adaptivecpp/build/install/bin/acpp-info
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.14"
- name: Extract code blocks from lesson
run: |
SNIPPETS="${GITHUB_WORKSPACE}/Code_Exercises/Lesson_Snippets"
LESSONS="Lesson_Materials/Handling_Errors/index.html"
python ./Scripts/LessonChecker.py --extract -o "${SNIPPETS}" "${LESSONS}"
- name: Build SYCLAcademy SYCL source code
run: |
mkdir -p ${GITHUB_WORKSPACE}/build && cd ${GITHUB_WORKSPACE}/build
cmake -DSYCL_ACADEMY_USE_ADAPTIVECPP=ON -DSYCL_ACADEMY_ENABLE_SOLUTIONS=ON -DSYCL_ACADEMY_INSTALL_ROOT=${GITHUB_WORKSPACE}/adaptivecpp/build/install ..
make -j2
- name: Run SYCLAcademy SYCL source code (OpenMP backend)
run: |
cd ${GITHUB_WORKSPACE}/build
ACPP_VISIBILITY_MASK="omp" ctest
- name: Run SYCLAcademy SYCL source code (OpenCL backend)
run: |
cd ${GITHUB_WORKSPACE}/build
ACPP_VISIBILITY_MASK="ocl" ctest