Skip to content

Commit

Permalink
Merge pull request #72 from matthew-mccall/kokkosWorkflow
Browse files Browse the repository at this point in the history
Add Support for Building with Kokkos in Actions
  • Loading branch information
cwsmith authored Jan 11, 2024
2 parents 8208a61 + 2146fe5 commit c5f1dc9
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 10 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/cmake-cuda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: CMake test matrix with CUDA
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-22.04
container: nvidia/cuda:12.3.0-devel-ubuntu22.04

strategy:
matrix:
mempool: [on, off]

steps:
- uses: actions/checkout@v4
with:
path: omega_h

- uses: actions/checkout@v4
with:
repository: kokkos/kokkos
path: kokkos

- name: Install CMake and ZLib
run: apt update && apt install -y cmake zlib1g-dev

- name: Configure Kokkos
shell: bash
working-directory: ${{github.workspace}}/kokkos
run: cmake .
-Bbuild
-DKokkos_ENABLE_CUDA=on
-DKokkos_ARCH_TURING75=on
-DCMAKE_INSTALL_PREFIX=build/install

- name: Build Kokkos
shell: bash
run: cmake --build $GITHUB_WORKSPACE/kokkos/build --target install

- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/omega_h
run: cmake .
-Bbuild
-DCMAKE_VERBOSE_MAKEFILE=on
-DOmega_h_USE_MPI=off
-DOmega_h_USE_CUDA=on
-DOmega_h_CUDA_ARCH=75
-DOmega_h_USE_Kokkos=on
-DKokkos_PREFIX=$GITHUB_WORKSPACE/kokkos/build/install
-DBUILD_TESTING=on
-DBUILD_SHARED_LIBS=off
-DENABLE_CTEST_MEMPOOL=${{ matrix.mempool }}

- name: Build
working-directory: ${{github.workspace}}/omega_h/build
shell: bash
run: cmake --build . -j2
48 changes: 38 additions & 10 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,61 @@ jobs:
strategy:
matrix:
compiler: [g++, clang++]
kokkos: [on, off]
mempool: [on, off]
exclude:
- kokkos: off
mempool: on

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
path: omega_h

- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/build
- uses: actions/checkout@v4
if: ${{ matrix.kokkos == 'on' }}
with:
repository: kokkos/kokkos
path: kokkos

- name: Configure Kokkos
if: ${{ matrix.kokkos == 'on' }}
shell: bash
working-directory: ${{github.workspace}}/kokkos
run: cmake .
-Bbuild
-DCMAKE_CXX_COMPILER=${{ matrix.compiler }}
-DCMAKE_INSTALL_PREFIX=build/install

- name: Build Kokkos
if: ${{ matrix.kokkos == 'on' }}
shell: bash
run: cmake --build $GITHUB_WORKSPACE/kokkos/build --target install

- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE
working-directory: ${{github.workspace}}/omega_h
run: cmake .
-Bbuild
-DCMAKE_CXX_COMPILER=${{ matrix.compiler }}
-DCMAKE_VERBOSE_MAKEFILE=on
-DOmega_h_USE_MPI=off
-DOmega_h_USE_CUDA=off
-DOmega_h_USE_Kokkos=${{ matrix.kokkos }}
-DKokkos_PREFIX=$GITHUB_WORKSPACE/kokkos/build/install
-DBUILD_TESTING=ON
-DBUILD_SHARED_LIBS=OFF
-DENABLE_CTEST_MEMPOOL=${{ matrix.mempool }}

- name: Build
working-directory: ${{runner.workspace}}/build
working-directory: ${{github.workspace}}/omega_h/build
shell: bash
run: cmake --build .
run: cmake --build . -j2

- name: Test
working-directory: ${{runner.workspace}}/build
working-directory: ${{github.workspace}}/omega_h/build
shell: bash
run: ctest

- name: Print
if: always()
run: cat ${{runner.workspace}}/build/Testing/Temporary/LastTest.log
run: cat ${{github.workspace}}/omega_h/build/Testing/Temporary/LastTest.log

0 comments on commit c5f1dc9

Please sign in to comment.