Skip to content

Commit

Permalink
Separate file for CI SYCL
Browse files Browse the repository at this point in the history
  • Loading branch information
nR3D committed Jan 18, 2024
1 parent e96bc41 commit bf2bedc
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 80 deletions.
95 changes: 95 additions & 0 deletions .github/workflows/ci-sycl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: CI

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ sycl-ci ]
pull_request:
branches: [ sycl-ci ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
VCPKG_VERSION: "1c5a340f6e10985e2d92af174a68dbd15c1fa4e1" # 29/05/2023 commit at https://github.com/microsoft/vcpkg/pull/29067
CTEST_PARALLEL_LEVEL: "1"

# A workflow is made up of one or more jobs that can run sequentially or in parallel
jobs:

Linux-SYCL-float:
runs-on: ubuntu-22.04
env:
VCPKG_DEFAULT_TRIPLET: x64-linux

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

- name: Install system dependencies
run: |
sudo apt update
sudo apt install -y \
apt-utils \
build-essential \
curl zip unzip tar `# when starting fresh on a WSL image for bootstrapping vcpkg`\
pkg-config `# for installing libraries with vcpkg`\
git \
cmake \
ninja-build
- uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}

- uses: friendlyanon/setup-vcpkg@v1 # Setup vcpkg into ${{github.workspace}}
with:
committish: ${{ env.VCPKG_VERSION }}
cache-version: ${{env.VCPKG_VERSION}}

- name: Install dependencies
run: |
${{github.workspace}}/vcpkg/vcpkg install --clean-after-build openblas[dynamic-arch] --allow-unsupported # last argument to remove after regression introduced by microsoft/vcpkg#30192 is addressed
# Simbody depends on (open)blas implementation, which -march=native by default, conflicting with cache restore, hence dynamic-arch feature
# Above problem might also be resolved by adding the hash of architecture in the cache key, esp. if more package do the same
${{github.workspace}}/vcpkg/vcpkg install --clean-after-build \
eigen3 \
tbb \
boost-program-options \
boost-geometry \
simbody \
gtest \
xsimd \
pybind11
- name: Install oneAPI
shell: bash
run: |
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
| 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
sudo apt -y update
sudo apt -y install intel-basekit
# or intel-hpckit for Intel HPC Toolkit
source /opt/intel/oneapi/setvars.sh
- name: Generate buildsystem using float (No test)
run: |
cmake -G Ninja \
-D CMAKE_BUILD_TYPE=Release \
-D SPHINXSYS_USE_FLOAT=ON \
-D CMAKE_TOOLCHAIN_FILE="${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake" \
-D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
-D SPHINXSYS_CI=ON \
-D CMAKE_CXX_COMPILER=icpx \
-D SPHINXSYS_USE_SYCL=ON \
-D SPHINXSYS_SYCL_TARGETS=spir64 \
-S ${{github.workspace}} \
-B ${{github.workspace}}/build
- name: Build using float
run: cmake --build build --config Release --verbose

- name: Run dambreak 2d
run : ${{github.workspace}}/build/tests/2d_examples/test_2d_dambreak_sycl/bin/test_2d_dambreak_sycl
82 changes: 2 additions & 80 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ name: CI
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master, sycl-ci ]
branches: [ master ]
pull_request:
branches: [ master, sycl-ci ]
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

Expand Down Expand Up @@ -174,84 +174,6 @@ jobs:
cd build
ctest --rerun-failed --output-on-failure
###############################################################################
Linux-SYCL-float:
runs-on: ubuntu-22.04
env:
VCPKG_DEFAULT_TRIPLET: x64-linux

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

- name: Install system dependencies
run: |
sudo apt update
sudo apt install -y \
apt-utils \
build-essential \
curl zip unzip tar `# when starting fresh on a WSL image for bootstrapping vcpkg`\
pkg-config `# for installing libraries with vcpkg`\
git \
cmake \
ninja-build
- uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}

- uses: friendlyanon/setup-vcpkg@v1 # Setup vcpkg into ${{github.workspace}}
with:
committish: ${{ env.VCPKG_VERSION }}
cache-version: ${{env.VCPKG_VERSION}}

- name: Install dependencies
run: |
${{github.workspace}}/vcpkg/vcpkg install --clean-after-build openblas[dynamic-arch] --allow-unsupported # last argument to remove after regression introduced by microsoft/vcpkg#30192 is addressed
# Simbody depends on (open)blas implementation, which -march=native by default, conflicting with cache restore, hence dynamic-arch feature
# Above problem might also be resolved by adding the hash of architecture in the cache key, esp. if more package do the same
${{github.workspace}}/vcpkg/vcpkg install --clean-after-build \
eigen3 \
tbb \
boost-program-options \
boost-geometry \
simbody \
gtest \
xsimd \
pybind11
- name: Install oneAPI
shell: bash
run: |
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
| 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
sudo apt update
sudo apt install intel-basekit
# or intel-hpckit for Intel HPC Toolkit
source /opt/intel/oneapi/setvars.sh
- name: Generate buildsystem using float (No test)
run: |
cmake -G Ninja \
-D CMAKE_BUILD_TYPE=Release \
-D SPHINXSYS_USE_FLOAT=ON \
-D CMAKE_TOOLCHAIN_FILE="${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake" \
-D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
-D SPHINXSYS_CI=ON \
-D CMAKE_CXX_COMPILER=/opt/intel/oneapi/compiler/latest/linux/bin/icpx \
-D SPHINXSYS_USE_SYCL=ON \
-D SPHINXSYS_SYCL_TARGETS=spir64 \
-S ${{github.workspace}} \
-B ${{github.workspace}}/build
- name: Build using float
run: cmake --build build --config Release --verbose

- name: Run dambreak 2d
run : build/tests/2d_examples/test_2d_dambreak_sycl/bin/test_2d_dambreak_sycl

###############################################################################

Windows:
Expand Down

0 comments on commit bf2bedc

Please sign in to comment.