Update Data Parallelism with examples that can be compiled #176
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test AdaptiveCpp | |
| on: [push, pull_request] | |
| jobs: | |
| validate-lessons: | |
| name: Validate all lessons | |
| 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/*/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 | |
| Lesson_Materials/Buffer_Accessor/index.html | |
| Lesson_Materials/Data_Parallelism/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 |