From 18f96b6b2360e91c4af4481b8a1205608fd25758 Mon Sep 17 00:00:00 2001 From: Karl W Schulz Date: Mon, 3 Jun 2024 17:40:02 -0500 Subject: [PATCH] set CMAKE_HIP_ARCHITECTURES at configure time so that build matches desired execution environment Signed-off-by: Karl W Schulz --- .github/workflows/mi-rhel9.yml | 5 +++-- CMakeLists.txt | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/mi-rhel9.yml b/.github/workflows/mi-rhel9.yml index c42ef6db8..8cd2a8d62 100644 --- a/.github/workflows/mi-rhel9.yml +++ b/.github/workflows/mi-rhel9.yml @@ -81,11 +81,12 @@ jobs: mkdir build cd build ml cmake - cmake -DENABLE_TESTS=ON -DENABLE_COVERAGE=ON -DPYTEST_NUMPROCS=8 .. + cmake -DENABLE_TESTS=ON -DCMAKE_HIP_ARCHITECTURES=$CI_ARCH -DENABLE_COVERAGE=ON -DPYTEST_NUMPROCS=8 .. - name: Build tests and Run [profile] mode run: | cd build - srun -N 1 -J omniperf -p $CI_QUEUE -t 00:20:00 make; ctest -j 4 --resource-spec-file ../tests/4gpus.json --verbose -L profile + make + srun -N 1 -J omniperf -p $CI_QUEUE -t 00:20:00 ctest -j 4 --resource-spec-file ../tests/4gpus.json --verbose -L profile - name: Run [analyze workloads] mode if: '!cancelled()' run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index 283d25658..dabe1fe50 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -158,10 +158,11 @@ endif() # Setup testing collateral option(ENABLE_TESTS "Enable compilation of testing collateral" OFF) +set(CMAKE_HIP_FLAGS_RELEASE "-O2") if(${ENABLE_TESTS}) enable_language("C" "HIP") add_subdirectory(tests) - set(CMAKE_HIP_FLAGS_RELEASE "-O2") + endif() message(STATUS "Enable tests compilation: ${ENABLE_TESTS}")