Skip to content

Commit

Permalink
Merge pull request #732 from G-Ragghianti/gragghia/gpu_amd
Browse files Browse the repository at this point in the history
Adding gpu_amd and gpu_nvidia to CI
  • Loading branch information
abouteiller authored Feb 14, 2025
2 parents 5897407 + 1bc3b5f commit ad7a882
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/CI/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

source .github/CI/env_setup.sh

cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE $BUILD_CONFIG
cmake $GITHUB_WORKSPACE $BUILD_CONFIG


20 changes: 18 additions & 2 deletions .github/CI/env_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@ if [[ -z "$SPACK_SETUP" || ! -e "$SPACK_SETUP" ]]; then
exit 1
fi
source $SPACK_SETUP
spack env activate parsec
spack env activate -V parsec
spack load python
spack load cmake
spack load openmpi
spack load cuda
spack load ninja

DEBUG=ON
[ $BUILD_TYPE = "Release" ] && DEBUG=OFF
[ "$BUILD_TYPE" = "Release" ] && DEBUG=OFF

if [ -z "$BUILD_DIRECTORY" ]; then
echo Error! ENV \$BUILD_DIRECTORY is undefined.
Expand All @@ -25,6 +30,15 @@ if [ -z "$INSTALL_DIRECTORY" ]; then
exit 1
fi

export CUDA=OFF
export HIP=OFF
if [ "$DEVICE" = "gpu_nvidia" ]; then
spack load cuda
CUDA=ON
elif [ "$DEVICE" = "gpu_amd" ]; then
HIP=ON
fi

! read -d '' BUILD_CONFIG << EOF
-G Ninja
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
Expand All @@ -34,5 +48,7 @@ fi
-DPARSEC_PROF_TRACE=$PROFILING
-DMPIEXEC_PREFLAGS='--bind-to;none;--oversubscribe'
-DCMAKE_INSTALL_PREFIX=$INSTALL_DIRECTORY
-DPARSEC_GPU_WITH_CUDA=$CUDA
-DPARSEC_GPU_WITH_HIP=$HIP
EOF
export BUILD_CONFIG
6 changes: 4 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,26 @@ on:

jobs:
all:
runs-on: [self-hosted, Linux]
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
build_type : [ Debug, Release ]
shared_type : [ OFF, ON ]
profiling : [ OFF, ON ]
device: [ cpu, gpu_nvidia, gpu_amd ]
exclude:
- build_type: Debug
profiling: OFF
- build_type: Release
shared_type: OFF
name: "${{matrix.build_type}} Shared=${{matrix.shared_type}} Profile=${{matrix.profiling}}"
name: "${{matrix.build_type}} Shared=${{matrix.shared_type}} Profile=${{matrix.profiling}} ${{matrix.device}}"
runs-on: [ "${{matrix.device}}", self-hosted ]
env:
BUILD_TYPE: ${{matrix.build_type}}
SHARED_TYPE: ${{matrix.shared_type}}
PROFILING: ${{matrix.profiling}}
DEVICE: ${{matrix.device}}
BUILD_DIRECTORY: build
INSTALL_DIRECTORY: install
steps:
Expand Down

0 comments on commit ad7a882

Please sign in to comment.