From f9fb64ad45a4e76fb926f683f517baff61447768 Mon Sep 17 00:00:00 2001 From: Michael Howard Date: Thu, 12 Mar 2026 15:07:09 -0500 Subject: [PATCH 01/34] Fix compile issues, enable GitHub Actions --- .github/workflows/test.yml | 37 +++++++++++++++++++++++++++++++++++++ .pre-commit-config.yaml | 15 +++++++++++++++ CMakeLists.txt | 2 +- CODE_OF_CONDUCT.md | 1 - doc/runtime.md | 1 - tests/CMakeLists.txt | 9 +++------ tests/cuda/CMakeLists.txt | 16 +--------------- 7 files changed, 57 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/test.yml create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..41ed941 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,37 @@ +name: test + +on: + pull_request: + + push: + branches: + - main + + workflow_call: + +concurrency: + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: true + +jobs: + build-cuda: + name: build + runs-on: ubuntu-24.04 + container: + image: nvidia/cuda:${{ matrix.cuda }}-devel-ubuntu24.04 + strategy: + fail-fast: false + matrix: + cuda: ["12.8.1", "13.1.1"] + steps: + - name: Checkout code + uses: actions/checkout@v6 + - name: Configure + run: | + cmake -S . -B build -DCMAKE_BUILD_TYPE=Release + - name: Build + run: | + cmake --build build + - name: Install + run: | + cmake --install build diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..7b78b65 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,15 @@ +ci: + autofix_prs: false + autoupdate_schedule: quarterly + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v6.0.0 + hooks: + - id: check-added-large-files + - id: check-merge-conflict + - id: check-yaml + - id: end-of-file-fixer + - id: mixed-line-ending + - id: requirements-txt-fixer + - id: trailing-whitespace diff --git a/CMakeLists.txt b/CMakeLists.txt index 79cf2d2..ac4eebb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ # Maintainer: mphoward -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.18) project(hipper VERSION 0.2.0 LANGUAGES CXX) set(CMAKE_CXX_STANDARD 14) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 12da96d..177569e 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -125,4 +125,3 @@ enforcement ladder](https://github.com/mozilla/diversity). For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations. - diff --git a/doc/runtime.md b/doc/runtime.md index 10d7e61..21a4f3b 100644 --- a/doc/runtime.md +++ b/doc/runtime.md @@ -376,4 +376,3 @@ | `cudaProfilerStop` | `hipProfilerStop` | `hipper::profilerStop`\* | \*: feature only available with `HIPPER_USE_DEPRECATED`. - diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 2959b6e..b4ca37c 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -14,14 +14,11 @@ set(HIPPER_TEST_LABELS CUB ) -# look for catch quietly, and pull down v2.12.2 if not found -if(POLICY CMP0074) - cmake_policy(SET CMP0074 NEW) -endif() -find_package(Catch2 QUIET) +# look for catch quietly, and pull down v2.13.10 if not found +find_package(Catch2 2 QUIET) if(NOT Catch2_FOUND) message(STATUS "Downloading Catch2...") - set(url https://github.com/catchorg/Catch2/releases/download/v2.12.2/catch.hpp) + set(url https://github.com/catchorg/Catch2/releases/download/v2.13.10/catch.hpp) file(DOWNLOAD ${url} "${CMAKE_CURRENT_BINARY_DIR}/catch2/catch.hpp" STATUS status) list(GET status 0 error) if(error) diff --git a/tests/cuda/CMakeLists.txt b/tests/cuda/CMakeLists.txt index c6ebd23..f75ddf1 100644 --- a/tests/cuda/CMakeLists.txt +++ b/tests/cuda/CMakeLists.txt @@ -16,21 +16,7 @@ target_link_libraries(test_hipper_cuda PRIVATE hipper::hipper Catch2::Catch2) target_compile_definitions(test_hipper_cuda PRIVATE HIPPER_CUDA) # set cuda architectures for build -if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.18) - set_property(TARGET test_hipper_cuda PROPERTY CUDA_ARCHITECTURES 60-real 70) -else() - set(CUDA_ARCHITECTURES "60;70") - set(TEST_NVCC_OPTIONS ) - foreach(_arch ${CUDA_ARCHITECTURES}) - set(TEST_NVCC_OPTIONS "${TEST_NVCC_OPTIONS} -gencode=arch=compute_${_arch},code=sm_${_arch}") - endforeach() - set(_sorted_arches ${CUDA_ARCHITECTURES}) - list(SORT _sorted_arches) - list(REVERSE _sorted_arches) - list(GET _sorted_arches 0 _max_arch) - set(TEST_NVCC_OPTIONS "${TEST_NVCC_OPTIONS} -gencode=arch=compute_${_max_arch},code=compute_${_max_arch}") - set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} ${TEST_NVCC_OPTIONS}") -endif() +set_property(TARGET test_hipper_cuda PROPERTY CUDA_ARCHITECTURES 75) foreach(label ${HIPPER_TEST_LABELS}) add_test(NAME hipper-cuda-${label} COMMAND test_hipper_cuda "[${label}]") From dcac8c56d8f35199f9b949f20c1ee4823a7b0ada Mon Sep 17 00:00:00 2001 From: Michael Howard Date: Thu, 12 Mar 2026 15:11:12 -0500 Subject: [PATCH 02/34] Add cmake dependency --- .github/workflows/test.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 41ed941..22b7f03 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,7 @@ concurrency: jobs: build-cuda: - name: build + name: build [CUDA ${{ matrix.cuda }}] runs-on: ubuntu-24.04 container: image: nvidia/cuda:${{ matrix.cuda }}-devel-ubuntu24.04 @@ -24,6 +24,10 @@ jobs: matrix: cuda: ["12.8.1", "13.1.1"] steps: + - name: Setup environment + run: | + apt-get update + apt-get install --yes cmake - name: Checkout code uses: actions/checkout@v6 - name: Configure From 89b8d560c88309222390daea2d43cdb2a6313fd3 Mon Sep 17 00:00:00 2001 From: Michael Howard Date: Thu, 12 Mar 2026 15:13:54 -0500 Subject: [PATCH 03/34] Set C++17 as minimum --- .github/workflows/test.yml | 4 ++-- CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 22b7f03..c4ef169 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,7 @@ concurrency: jobs: build-cuda: - name: build [CUDA ${{ matrix.cuda }}] + name: CUDA ${{ matrix.cuda }} runs-on: ubuntu-24.04 container: image: nvidia/cuda:${{ matrix.cuda }}-devel-ubuntu24.04 @@ -24,7 +24,7 @@ jobs: matrix: cuda: ["12.8.1", "13.1.1"] steps: - - name: Setup environment + - name: Install dependencies run: | apt-get update apt-get install --yes cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index ac4eebb..0755e63 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ cmake_minimum_required(VERSION 3.18) project(hipper VERSION 0.2.0 LANGUAGES CXX) -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 17) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/tools") # check if hipper is being used directly or via add_subdirectory From afe24fa9ae3fc3b974e255964bb261e69b2c9ee4 Mon Sep 17 00:00:00 2001 From: Michael Howard Date: Thu, 12 Mar 2026 15:24:29 -0500 Subject: [PATCH 04/34] Add additional CUDA versions --- .github/workflows/test.yml | 64 +++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c4ef169..02867c5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,41 +1,41 @@ name: test on: - pull_request: + pull_request: - push: - branches: - - main + push: + branches: + - main - workflow_call: + workflow_call: concurrency: - group: "${{ github.workflow }}-${{ github.ref }}" - cancel-in-progress: true + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: true jobs: - build-cuda: - name: CUDA ${{ matrix.cuda }} - runs-on: ubuntu-24.04 - container: - image: nvidia/cuda:${{ matrix.cuda }}-devel-ubuntu24.04 - strategy: - fail-fast: false - matrix: - cuda: ["12.8.1", "13.1.1"] - steps: - - name: Install dependencies - run: | - apt-get update - apt-get install --yes cmake - - name: Checkout code - uses: actions/checkout@v6 - - name: Configure - run: | - cmake -S . -B build -DCMAKE_BUILD_TYPE=Release - - name: Build - run: | - cmake --build build - - name: Install - run: | - cmake --install build + build-cuda: + name: CUDA ${{ matrix.cuda }} + runs-on: ubuntu-24.04 + container: + image: nvidia/cuda:${{ matrix.cuda }}-devel-ubuntu24.04 + strategy: + fail-fast: false + matrix: + cuda: ["12.6.3", "12.8.1", "12.9.1", "13.0.2", "13.1.1"] + steps: + - name: Install dependencies + run: | + apt-get update + apt-get install --yes cmake + - name: Checkout code + uses: actions/checkout@v6 + - name: Configure + run: | + cmake -S . -B build -DCMAKE_BUILD_TYPE=Release + - name: Build + run: | + cmake --build build + - name: Install + run: | + cmake --install build From 788ecb40a41b658f73a9e312eef073d6d748841f Mon Sep 17 00:00:00 2001 From: Michael Howard Date: Thu, 12 Mar 2026 15:38:21 -0500 Subject: [PATCH 05/34] Try testing only HIP --- .github/workflows/test.yml | 44 ++++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 02867c5..5b4da29 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,20 +14,46 @@ concurrency: cancel-in-progress: true jobs: - build-cuda: - name: CUDA ${{ matrix.cuda }} + # build-cuda: + # name: CUDA ${{ matrix.cuda }} + # runs-on: ubuntu-24.04 + # container: + # image: nvidia/cuda:${{ matrix.cuda }}-devel-ubuntu24.04 + # strategy: + # fail-fast: false + # matrix: + # cuda: ["12.6.3", "12.8.1", "12.9.1", "13.0.2", "13.1.1"] + # steps: + # - name: Install dependencies + # run: | + # apt-get update + # apt-get install --yes cmake + # - name: Checkout code + # uses: actions/checkout@v6 + # - name: Configure + # run: | + # cmake -S . -B build -DCMAKE_BUILD_TYPE=Release + # - name: Build + # run: | + # cmake --build build + # - name: Install + # run: | + # cmake --install build + + build-hip: + name: HIP 7.2 runs-on: ubuntu-24.04 - container: - image: nvidia/cuda:${{ matrix.cuda }}-devel-ubuntu24.04 - strategy: - fail-fast: false - matrix: - cuda: ["12.6.3", "12.8.1", "12.9.1", "13.0.2", "13.1.1"] steps: - name: Install dependencies run: | apt-get update - apt-get install --yes cmake + apt-get install cmake python3-setuptools python3-wheel + - name: Install HIP + run: | + wget https://repo.radeon.com/amdgpu-install/7.2/ubuntu/noble/amdgpu-install_7.2.70200-1_all.deb -O amdgpu-install.deb + sudo apt install ./amdgpu-install.deb + sudo usermod -a -G render,video $LOGNAME + sudo apt install rocm - name: Checkout code uses: actions/checkout@v6 - name: Configure From 5abfbbd9ff1f66599e6caaeb45a567a165eb9b82 Mon Sep 17 00:00:00 2001 From: Michael Howard Date: Thu, 12 Mar 2026 15:39:24 -0500 Subject: [PATCH 06/34] Try running apt differently --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5b4da29..7fd3cab 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -46,8 +46,8 @@ jobs: steps: - name: Install dependencies run: | - apt-get update - apt-get install cmake python3-setuptools python3-wheel + apt update + apt install --yes cmake python3-setuptools python3-wheel - name: Install HIP run: | wget https://repo.radeon.com/amdgpu-install/7.2/ubuntu/noble/amdgpu-install_7.2.70200-1_all.deb -O amdgpu-install.deb From b9ff253417b25202d596a72618f3648e5bb0b0ac Mon Sep 17 00:00:00 2001 From: Michael Howard Date: Thu, 12 Mar 2026 15:40:54 -0500 Subject: [PATCH 07/34] Try running different order --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7fd3cab..9a8f0e8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,18 +44,18 @@ jobs: name: HIP 7.2 runs-on: ubuntu-24.04 steps: + - name: Checkout code + uses: actions/checkout@v6 - name: Install dependencies run: | - apt update - apt install --yes cmake python3-setuptools python3-wheel + apt-get update + apt-get install cmake python3-setuptools python3-wheel - name: Install HIP run: | wget https://repo.radeon.com/amdgpu-install/7.2/ubuntu/noble/amdgpu-install_7.2.70200-1_all.deb -O amdgpu-install.deb sudo apt install ./amdgpu-install.deb sudo usermod -a -G render,video $LOGNAME sudo apt install rocm - - name: Checkout code - uses: actions/checkout@v6 - name: Configure run: | cmake -S . -B build -DCMAKE_BUILD_TYPE=Release From c79e73a2609aec91e1415aadeacdb0e0046c5702 Mon Sep 17 00:00:00 2001 From: Michael Howard Date: Thu, 12 Mar 2026 15:42:48 -0500 Subject: [PATCH 08/34] Try simpler --- .github/workflows/test.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9a8f0e8..237cfb6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -49,19 +49,19 @@ jobs: - name: Install dependencies run: | apt-get update - apt-get install cmake python3-setuptools python3-wheel - - name: Install HIP - run: | - wget https://repo.radeon.com/amdgpu-install/7.2/ubuntu/noble/amdgpu-install_7.2.70200-1_all.deb -O amdgpu-install.deb - sudo apt install ./amdgpu-install.deb - sudo usermod -a -G render,video $LOGNAME - sudo apt install rocm - - name: Configure - run: | - cmake -S . -B build -DCMAKE_BUILD_TYPE=Release - - name: Build - run: | - cmake --build build - - name: Install - run: | - cmake --install build + apt-get install --yes cmake python3-setuptools python3-wheel + # - name: Install HIP + # run: | + # wget https://repo.radeon.com/amdgpu-install/7.2/ubuntu/noble/amdgpu-install_7.2.70200-1_all.deb -O amdgpu-install.deb + # sudo apt install ./amdgpu-install.deb + # sudo usermod -a -G render,video $LOGNAME + # sudo apt install rocm + # - name: Configure + # run: | + # cmake -S . -B build -DCMAKE_BUILD_TYPE=Release + # - name: Build + # run: | + # cmake --build build + # - name: Install + # run: | + # cmake --install build From 4683e19618b559019165a7a3eacd1659b2ceb3b8 Mon Sep 17 00:00:00 2001 From: Michael Howard Date: Thu, 12 Mar 2026 15:43:39 -0500 Subject: [PATCH 09/34] Use sudo --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 237cfb6..5bfae7e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -48,8 +48,8 @@ jobs: uses: actions/checkout@v6 - name: Install dependencies run: | - apt-get update - apt-get install --yes cmake python3-setuptools python3-wheel + sudo apt-get update + sudo apt-get install --yes cmake python3-setuptools python3-wheel # - name: Install HIP # run: | # wget https://repo.radeon.com/amdgpu-install/7.2/ubuntu/noble/amdgpu-install_7.2.70200-1_all.deb -O amdgpu-install.deb From 4aab01835bfc7d779237b992771c7e227873ced9 Mon Sep 17 00:00:00 2001 From: Michael Howard Date: Thu, 12 Mar 2026 15:44:30 -0500 Subject: [PATCH 10/34] Try rocm again --- .github/workflows/test.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5bfae7e..4c1431f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -50,12 +50,12 @@ jobs: run: | sudo apt-get update sudo apt-get install --yes cmake python3-setuptools python3-wheel - # - name: Install HIP - # run: | - # wget https://repo.radeon.com/amdgpu-install/7.2/ubuntu/noble/amdgpu-install_7.2.70200-1_all.deb -O amdgpu-install.deb - # sudo apt install ./amdgpu-install.deb - # sudo usermod -a -G render,video $LOGNAME - # sudo apt install rocm + - name: Install HIP + run: | + wget https://repo.radeon.com/amdgpu-install/7.2/ubuntu/noble/amdgpu-install_7.2.70200-1_all.deb -O amdgpu-install.deb + sudo apt-get install --yes ./amdgpu-install.deb + sudo usermod -a -G render,video $LOGNAME + sudo apt-get install --yes rocm # - name: Configure # run: | # cmake -S . -B build -DCMAKE_BUILD_TYPE=Release From e259a3ce8d4cbe41c99800533904036d700ef194 Mon Sep 17 00:00:00 2001 From: Michael Howard Date: Thu, 12 Mar 2026 15:56:27 -0500 Subject: [PATCH 11/34] Try building HIP from source --- .github/workflows/test.yml | 82 +++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 45 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4c1431f..95da0e9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,54 +14,46 @@ concurrency: cancel-in-progress: true jobs: - # build-cuda: - # name: CUDA ${{ matrix.cuda }} - # runs-on: ubuntu-24.04 - # container: - # image: nvidia/cuda:${{ matrix.cuda }}-devel-ubuntu24.04 - # strategy: - # fail-fast: false - # matrix: - # cuda: ["12.6.3", "12.8.1", "12.9.1", "13.0.2", "13.1.1"] - # steps: - # - name: Install dependencies - # run: | - # apt-get update - # apt-get install --yes cmake - # - name: Checkout code - # uses: actions/checkout@v6 - # - name: Configure - # run: | - # cmake -S . -B build -DCMAKE_BUILD_TYPE=Release - # - name: Build - # run: | - # cmake --build build - # - name: Install - # run: | - # cmake --install build - - build-hip: - name: HIP 7.2 + build-cuda: + name: CUDA ${{ matrix.cuda }}, ROCm ${{ matrix.rocm }} runs-on: ubuntu-24.04 + container: + image: nvidia/cuda:${{ matrix.cuda }}-devel-ubuntu24.04 + strategy: + fail-fast: false + matrix: + #cuda: ["12.6.3", "12.8.1", "12.9.1", "13.0.2", "13.1.1"] + cuda: ["12.8.1"] + rocm: ["7.2.0"] steps: + - name: Install build dependencies + run: | + apt-get update + apt-get install --yes cmake + - name: Clone HIP + uses: actions/checkout@v6 + with: + repository: ROCm/rocm-systems + ref: rocm-${{ matrix.rocm }} + path: rocm-systems + - name: Install HIP + run: | + export CLR_DIR="$(readlink -f rocm-systems/projects/clr)" + export HIP_DIR="$(readlink -f rocm-systems/projects/hip)" + export HIP_OTHER="$(readlink -f rocm-systems/projects/hipother)" + cd "$CLR_DIR" + mkdir build + cd build + cmake -DHIP_COMMON_DIR=$HIP_DIR -DHIP_PLATFORM=nvidia -DCLR_BUILD_HIP=ON -DCLR_BUILD_OCL=OFF -DHIPNV_DIR=$HIP_OTHER/hipnv .. + make install - name: Checkout code uses: actions/checkout@v6 - - name: Install dependencies + - name: Configure run: | - sudo apt-get update - sudo apt-get install --yes cmake python3-setuptools python3-wheel - - name: Install HIP + cmake -S . -B build -DCMAKE_BUILD_TYPE=Release + - name: Build + run: | + cmake --build build + - name: Install run: | - wget https://repo.radeon.com/amdgpu-install/7.2/ubuntu/noble/amdgpu-install_7.2.70200-1_all.deb -O amdgpu-install.deb - sudo apt-get install --yes ./amdgpu-install.deb - sudo usermod -a -G render,video $LOGNAME - sudo apt-get install --yes rocm - # - name: Configure - # run: | - # cmake -S . -B build -DCMAKE_BUILD_TYPE=Release - # - name: Build - # run: | - # cmake --build build - # - name: Install - # run: | - # cmake --install build + cmake --install build From 8fece4b149a64dfcf98b0d66146404080446e65d Mon Sep 17 00:00:00 2001 From: Michael Howard Date: Thu, 12 Mar 2026 16:09:27 -0500 Subject: [PATCH 12/34] Try changing CMake setup --- .github/workflows/test.yml | 2 +- CMakeLists.txt | 2 +- tests/hip/CMakeLists.txt | 21 +++++++++------------ 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 95da0e9..66bdfce 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -50,7 +50,7 @@ jobs: uses: actions/checkout@v6 - name: Configure run: | - cmake -S . -B build -DCMAKE_BUILD_TYPE=Release + cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/opt/rocm - name: Build run: | cmake --build build diff --git a/CMakeLists.txt b/CMakeLists.txt index 0755e63..d349b6a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ # Maintainer: mphoward -cmake_minimum_required(VERSION 3.18) +cmake_minimum_required(VERSION 3.28) project(hipper VERSION 0.2.0 LANGUAGES CXX) set(CMAKE_CXX_STANDARD 17) diff --git a/tests/hip/CMakeLists.txt b/tests/hip/CMakeLists.txt index 263039b..f749566 100644 --- a/tests/hip/CMakeLists.txt +++ b/tests/hip/CMakeLists.txt @@ -2,25 +2,22 @@ # Copyright (c) 2021, Auburn University # This file is released under the Modified BSD License. -if(NOT DEFINED HIP_PATH) - if(NOT DEFINED ENV{HIP_PATH}) - set(HIP_PATH "/opt/rocm/hip" CACHE PATH "Path to which HIP has been installed") - else() - set(HIP_PATH $ENV{HIP_PATH} CACHE PATH "Path to which HIP has been installed") - endif() -endif() -set(CMAKE_MODULE_PATH "${HIP_PATH}/cmake" ${CMAKE_MODULE_PATH}) - -find_package(HIP QUIET) -if(NOT HIP_FOUND) +include(CheckLanguage) +check_language(HIP) +if(NOT CMAKE_HIP_COMPILER) message(STATUS "No HIP compiler, skipping HIP tests.") return() +else() + enable_language(HIP) endif() -hip_add_executable(test_hipper_hip ${HIPPER_TEST_FILES}) +add_executable(test_hipper_hip ${HIPPER_TEST_FILES} LANGUAGES HIP) target_link_libraries(test_hipper_hip PRIVATE hipper::hipper Catch2::Catch2) target_compile_definitions(test_hipper_hip PRIVATE HIPPER_HIP) +# set cuda architectures for build +set_property(TARGET test_hipper_hip PROPERTY HIP_PLATFORM nvidia HIP_ARCHITECTURES 75) + foreach(label ${HIPPER_TEST_LABELS}) add_test(NAME hipper-hip-${label} COMMAND test_hipper_hip "[${label}]") endforeach() From 89437c7425487b27a6ff260266707c6b1c7c559b Mon Sep 17 00:00:00 2001 From: Michael Howard Date: Thu, 12 Mar 2026 16:27:49 -0500 Subject: [PATCH 13/34] Try package manager again --- .github/workflows/test.yml | 42 +++++++++++++++----------------------- 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 66bdfce..eb9e410 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,30 +30,22 @@ jobs: run: | apt-get update apt-get install --yes cmake - - name: Clone HIP - uses: actions/checkout@v6 - with: - repository: ROCm/rocm-systems - ref: rocm-${{ matrix.rocm }} - path: rocm-systems - name: Install HIP run: | - export CLR_DIR="$(readlink -f rocm-systems/projects/clr)" - export HIP_DIR="$(readlink -f rocm-systems/projects/hip)" - export HIP_OTHER="$(readlink -f rocm-systems/projects/hipother)" - cd "$CLR_DIR" - mkdir build - cd build - cmake -DHIP_COMMON_DIR=$HIP_DIR -DHIP_PLATFORM=nvidia -DCLR_BUILD_HIP=ON -DCLR_BUILD_OCL=OFF -DHIPNV_DIR=$HIP_OTHER/hipnv .. - make install - - name: Checkout code - uses: actions/checkout@v6 - - name: Configure - run: | - cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/opt/rocm - - name: Build - run: | - cmake --build build - - name: Install - run: | - cmake --install build + wget https://repo.radeon.com/amdgpu-install/7.2/ubuntu/noble/amdgpu-install_7.2.70200-1_all.deb + apt-get install ./amdgpu-install_7.2.70200-1_all.deb + apt-get update + apt-get install python3-setuptools python3-wheel + usermod -a -G render,video $LOGNAME + apt-get install rocm + # - name: Checkout code + # uses: actions/checkout@v6 + # - name: Configure + # run: | + # cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/opt/rocm + # - name: Build + # run: | + # cmake --build build + # - name: Install + # run: | + # cmake --install build From 69c1cacdd2993fadfe3b258f4e0c7afa2db426b5 Mon Sep 17 00:00:00 2001 From: Michael Howard Date: Thu, 12 Mar 2026 16:30:11 -0500 Subject: [PATCH 14/34] Try package manager again --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eb9e410..bf06cf1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,7 +29,7 @@ jobs: - name: Install build dependencies run: | apt-get update - apt-get install --yes cmake + apt-get install --yes cmake wget - name: Install HIP run: | wget https://repo.radeon.com/amdgpu-install/7.2/ubuntu/noble/amdgpu-install_7.2.70200-1_all.deb From 5db09f000b233e64423164bbd8b3509a789b63f4 Mon Sep 17 00:00:00 2001 From: Michael Howard Date: Thu, 12 Mar 2026 16:34:26 -0500 Subject: [PATCH 15/34] Back to separate tests --- .github/workflows/test.yml | 63 ++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 30 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bf06cf1..bd16ded 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,38 +14,41 @@ concurrency: cancel-in-progress: true jobs: - build-cuda: - name: CUDA ${{ matrix.cuda }}, ROCm ${{ matrix.rocm }} + # build-cuda: + # name: CUDA ${{ matrix.cuda }} + # runs-on: ubuntu-24.04 + # container: + # image: nvidia/cuda:${{ matrix.cuda }}-devel-ubuntu24.04 + # strategy: + # fail-fast: false + # matrix: + # cuda: ["12.6.3", "12.8.1", "12.9.1", "13.0.2", "13.1.1"] + # steps: + # - name: Install build dependencies + # run: | + # apt-get update + # apt-get install --yes cmake + # - name: Checkout code + # uses: actions/checkout@v6 + # - name: Configure + # run: | + # cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/opt/rocm + # - name: Build + # run: | + # cmake --build build + # - name: Install + # run: | + # cmake --install build + + build-hip: + name: ROCm 7.2 runs-on: ubuntu-24.04 - container: - image: nvidia/cuda:${{ matrix.cuda }}-devel-ubuntu24.04 - strategy: - fail-fast: false - matrix: - #cuda: ["12.6.3", "12.8.1", "12.9.1", "13.0.2", "13.1.1"] - cuda: ["12.8.1"] - rocm: ["7.2.0"] steps: - name: Install build dependencies - run: | - apt-get update - apt-get install --yes cmake wget - - name: Install HIP run: | wget https://repo.radeon.com/amdgpu-install/7.2/ubuntu/noble/amdgpu-install_7.2.70200-1_all.deb - apt-get install ./amdgpu-install_7.2.70200-1_all.deb - apt-get update - apt-get install python3-setuptools python3-wheel - usermod -a -G render,video $LOGNAME - apt-get install rocm - # - name: Checkout code - # uses: actions/checkout@v6 - # - name: Configure - # run: | - # cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/opt/rocm - # - name: Build - # run: | - # cmake --build build - # - name: Install - # run: | - # cmake --install build + sudo apt-get install --yes ./amdgpu-install_7.2.70200-1_all.deb + sudo apt-get update + sudo apt-get install --yes cmake python3-setuptools python3-wheel + sudo usermod -a -G render,video $LOGNAME + sudo apt-get install --yes rocm From 0286f4b3d122153d5aaf6cb871b8fe9a8bddd2ec Mon Sep 17 00:00:00 2001 From: Michael Howard Date: Thu, 12 Mar 2026 16:43:08 -0500 Subject: [PATCH 16/34] Try stripping down to just HIP SDK --- .github/workflows/test.yml | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bd16ded..d2c98a2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,11 +44,34 @@ jobs: name: ROCm 7.2 runs-on: ubuntu-24.04 steps: - - name: Install build dependencies + - name: Install ROCm run: | wget https://repo.radeon.com/amdgpu-install/7.2/ubuntu/noble/amdgpu-install_7.2.70200-1_all.deb sudo apt-get install --yes ./amdgpu-install_7.2.70200-1_all.deb sudo apt-get update - sudo apt-get install --yes cmake python3-setuptools python3-wheel + sudo apt-get install --yes python3-setuptools python3-wheel sudo usermod -a -G render,video $LOGNAME - sudo apt-get install --yes rocm + sudo apt-get install --yes rocm-hip-sdk + + sudo tee --append /etc/ld.so.conf.d/rocm.conf < Date: Thu, 12 Mar 2026 16:44:49 -0500 Subject: [PATCH 17/34] Get even leaner --- .github/workflows/test.yml | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d2c98a2..2b715fd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -49,8 +49,6 @@ jobs: wget https://repo.radeon.com/amdgpu-install/7.2/ubuntu/noble/amdgpu-install_7.2.70200-1_all.deb sudo apt-get install --yes ./amdgpu-install_7.2.70200-1_all.deb sudo apt-get update - sudo apt-get install --yes python3-setuptools python3-wheel - sudo usermod -a -G render,video $LOGNAME sudo apt-get install --yes rocm-hip-sdk sudo tee --append /etc/ld.so.conf.d/rocm.conf < Date: Thu, 12 Mar 2026 21:20:26 -0500 Subject: [PATCH 18/34] Refactor tests --- .github/actions/build-install.yml | 23 ++++++++++++ .github/workflows/test.yml | 60 ++++++++++--------------------- CMakeLists.txt | 14 ++++---- tests/CMakeLists.txt | 23 +++++++++--- tests/cuda/CMakeLists.txt | 23 ------------ tests/hip/CMakeLists.txt | 23 ------------ 6 files changed, 67 insertions(+), 99 deletions(-) create mode 100644 .github/actions/build-install.yml delete mode 100644 tests/cuda/CMakeLists.txt delete mode 100644 tests/hip/CMakeLists.txt diff --git a/.github/actions/build-install.yml b/.github/actions/build-install.yml new file mode 100644 index 0000000..e3c6082 --- /dev/null +++ b/.github/actions/build-install.yml @@ -0,0 +1,23 @@ +name: "Build and install" +inputs: + platform: + description: "Platform for building tests [nvidia, amd]" + required: true + default: "" +runs: + using: "composite" + steps: + - name: Install build dependencies + run: | + sudo apt-get install --yes cmake + - name: Checkout code + uses: actions/checkout@v6 + - name: Configure + run: | + cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DHIPPER_TEST_PLATFORM=${{ inputs.platform }} + - name: Build + run: | + cmake --build build + - name: Install + run: | + cmake --install build diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2b715fd..4dfbd01 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,31 +14,20 @@ concurrency: cancel-in-progress: true jobs: - # build-cuda: - # name: CUDA ${{ matrix.cuda }} - # runs-on: ubuntu-24.04 - # container: - # image: nvidia/cuda:${{ matrix.cuda }}-devel-ubuntu24.04 - # strategy: - # fail-fast: false - # matrix: - # cuda: ["12.6.3", "12.8.1", "12.9.1", "13.0.2", "13.1.1"] - # steps: - # - name: Install build dependencies - # run: | - # apt-get update - # apt-get install --yes cmake - # - name: Checkout code - # uses: actions/checkout@v6 - # - name: Configure - # run: | - # cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/opt/rocm - # - name: Build - # run: | - # cmake --build build - # - name: Install - # run: | - # cmake --install build + build-cuda: + name: CUDA ${{ matrix.cuda }} + runs-on: ubuntu-24.04 + container: + image: nvidia/cuda:${{ matrix.cuda }}-devel-ubuntu24.04 + strategy: + fail-fast: false + matrix: + cuda: ["12.8.1"] + steps: + - name: Build and install + uses: ./.github/actions/build-install + with: + platform: "nvidia" build-hip: name: ROCm 7.2 @@ -56,20 +45,7 @@ jobs: /opt/rocm/lib64 EOF sudo ldconfig - - export PATH=$PATH:/opt/rocm-7.2.0/bin - export LD_LIBRARY_PATH=/opt/rocm-7.2.0/lib - - name: Install build dependencies - run: | - sudo apt-get install --yes cmake - # - name: Checkout code - # uses: actions/checkout@v6 - # - name: Configure - # run: | - # cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/opt/rocm - # - name: Build - # run: | - # cmake --build build - # - name: Install - # run: | - # cmake --install build + - name: Build and install + uses: ./.github/actions/build-install + with: + platform: "amd" diff --git a/CMakeLists.txt b/CMakeLists.txt index d349b6a..c5aa776 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,7 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) set(HIPPER_MASTER_PROJECT ON) endif() option(HIPPER_INSTALL "Install hipper files?" ${HIPPER_MASTER_PROJECT}) -option(HIPPER_TEST "Build hipper tests?" ${HIPPER_MASTER_PROJECT}) +set(HIPPER_TEST_PLATFORM "" CACHE STRING "Platform for hipper tests [nvidia, amd]") # header-only targets include(GNUInstallDirs) @@ -25,12 +25,6 @@ add_library(hipper::hipper ALIAS hipper) target_include_directories(hipper INTERFACE $ $) -# add tests -if(HIPPER_TEST) - enable_testing() - add_subdirectory(tests) -endif() - # install headers if(HIPPER_INSTALL) include(CMakePackageConfigHelpers) @@ -54,3 +48,9 @@ if(HIPPER_INSTALL) NAMESPACE hipper:: DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/cmake/hipper) endif() + +# add tests +if(HIPPER_TEST_PLATFORM) + enable_testing() + add_subdirectory(tests) +endif() diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index b4ca37c..6cb8ed3 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -2,6 +2,15 @@ # Copyright (c) 2021, Auburn University # This file is released under the Modified BSD License. +# enable the language used for testing +if(HIPPER_TEST_PLATFORM STREQUAL "nvidia") + enable_language(CUDA) +elseif(HIPPER_TEST_PLATFORM STREQUAL "amd") + enable_language(HIP) +else() + message(FATAL_ERROR "HIPPER_TEST_PLATFORM value ${HIPPER_TEST_PLATFORM} not recognized, must be nvidia or amd") +endif() + # the list of all source files set(HIPPER_TEST_FILES test_hipper.cc @@ -28,8 +37,14 @@ if(NOT Catch2_FOUND) find_package(Catch2 REQUIRED) endif() -# set full path to files for use in subdirectories -list(TRANSFORM HIPPER_TEST_FILES PREPEND "${CMAKE_CURRENT_LIST_DIR}/") +add_executable(test_hipper ${HIPPER_TEST_FILES}) +target_link_libraries(test_hipper PRIVATE hipper::hipper Catch2::Catch2) +if(HIPPER_TEST_PLATFORM STREQUAL "nvidia") + target_compile_definitions(test_hipper PRIVATE HIPPER_CUDA) +elseif(HIPPER_TEST_PLATFORM STREQUAL "amd") + target_compile_definitions(test_hipper PRIVATE HIPPER_HIP) +endif() -add_subdirectory(cuda) -add_subdirectory(hip) +foreach(label ${HIPPER_TEST_LABELS}) + add_test(NAME hipper-${label} COMMAND test_hipper "[${label}]") +endforeach() diff --git a/tests/cuda/CMakeLists.txt b/tests/cuda/CMakeLists.txt deleted file mode 100644 index f75ddf1..0000000 --- a/tests/cuda/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (c) 2020, Michael P. Howard -# Copyright (c) 2021, Auburn University -# This file is released under the Modified BSD License. - -include(CheckLanguage) -check_language(CUDA) -if(NOT CMAKE_CUDA_COMPILER) - message(STATUS "No CUDA compiler, skipping CUDA tests.") - return() -else() - enable_language(CUDA) -endif() - -add_executable(test_hipper_cuda ${HIPPER_TEST_FILES}) -target_link_libraries(test_hipper_cuda PRIVATE hipper::hipper Catch2::Catch2) -target_compile_definitions(test_hipper_cuda PRIVATE HIPPER_CUDA) - -# set cuda architectures for build -set_property(TARGET test_hipper_cuda PROPERTY CUDA_ARCHITECTURES 75) - -foreach(label ${HIPPER_TEST_LABELS}) - add_test(NAME hipper-cuda-${label} COMMAND test_hipper_cuda "[${label}]") -endforeach() diff --git a/tests/hip/CMakeLists.txt b/tests/hip/CMakeLists.txt deleted file mode 100644 index f749566..0000000 --- a/tests/hip/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (c) 2020, Michael P. Howard -# Copyright (c) 2021, Auburn University -# This file is released under the Modified BSD License. - -include(CheckLanguage) -check_language(HIP) -if(NOT CMAKE_HIP_COMPILER) - message(STATUS "No HIP compiler, skipping HIP tests.") - return() -else() - enable_language(HIP) -endif() - -add_executable(test_hipper_hip ${HIPPER_TEST_FILES} LANGUAGES HIP) -target_link_libraries(test_hipper_hip PRIVATE hipper::hipper Catch2::Catch2) -target_compile_definitions(test_hipper_hip PRIVATE HIPPER_HIP) - -# set cuda architectures for build -set_property(TARGET test_hipper_hip PROPERTY HIP_PLATFORM nvidia HIP_ARCHITECTURES 75) - -foreach(label ${HIPPER_TEST_LABELS}) - add_test(NAME hipper-hip-${label} COMMAND test_hipper_hip "[${label}]") -endforeach() From f75f917e8fb6664f252a0ddbd9c267fb93006165 Mon Sep 17 00:00:00 2001 From: Michael Howard Date: Thu, 12 Mar 2026 21:28:19 -0500 Subject: [PATCH 19/34] Put action in right spot --- .github/actions/{build-install.yml => build-install/action.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/actions/{build-install.yml => build-install/action.yml} (100%) diff --git a/.github/actions/build-install.yml b/.github/actions/build-install/action.yml similarity index 100% rename from .github/actions/build-install.yml rename to .github/actions/build-install/action.yml From 23af090861db0dcb489e4bc10c95ad89aa4f2104 Mon Sep 17 00:00:00 2001 From: Michael Howard Date: Thu, 12 Mar 2026 21:41:08 -0500 Subject: [PATCH 20/34] Continue to try to improve actions --- .github/actions/build-install/action.yml | 7 +++++-- .github/workflows/test.yml | 21 ++++++++++++++++++--- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/.github/actions/build-install/action.yml b/.github/actions/build-install/action.yml index e3c6082..2ceca59 100644 --- a/.github/actions/build-install/action.yml +++ b/.github/actions/build-install/action.yml @@ -1,4 +1,5 @@ name: "Build and install" +description: "Build and install hipper" inputs: platform: description: "Platform for building tests [nvidia, amd]" @@ -10,14 +11,16 @@ runs: - name: Install build dependencies run: | sudo apt-get install --yes cmake - - name: Checkout code - uses: actions/checkout@v6 + shell: bash - name: Configure run: | cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DHIPPER_TEST_PLATFORM=${{ inputs.platform }} + shell: bash - name: Build run: | cmake --build build + shell: bash - name: Install run: | cmake --install build + shell: bash diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4dfbd01..6d6b399 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,19 +24,33 @@ jobs: matrix: cuda: ["12.8.1"] steps: + - uses: actions/checkout@v6 - name: Build and install uses: ./.github/actions/build-install with: platform: "nvidia" build-hip: - name: ROCm 7.2 + name: ROCm ${{ matrix.rocm }} runs-on: ubuntu-24.04 + strategy: + fail-fast: false + matrix: + rocm: ["7.2"] steps: + - name: Determine ROCm repository + id: set-rocm-repo + run: | + case "${{ matrix.rocm }}" + 7.2) + echo "rocmdeb=https://repo.radeon.com/amdgpu-install/7.2/ubuntu/noble/amdgpu-install_7.2.70200-1_all.deb" >> $GITHUB_OUTPUT;; + *) + echo "Unknown ROCm version" && exit 1;; + esac - name: Install ROCm run: | - wget https://repo.radeon.com/amdgpu-install/7.2/ubuntu/noble/amdgpu-install_7.2.70200-1_all.deb - sudo apt-get install --yes ./amdgpu-install_7.2.70200-1_all.deb + wget ${{ steps.set-rocm-repo.outputs.rocmdeb }} -O amdgpu-install.deb + sudo apt-get install --yes ./amdgpu-install.deb sudo apt-get update sudo apt-get install --yes rocm-hip-sdk @@ -45,6 +59,7 @@ jobs: /opt/rocm/lib64 EOF sudo ldconfig + - uses: actions/checkout@v6 - name: Build and install uses: ./.github/actions/build-install with: From f503a92cc686bc5212719a42015952e47542ebcb Mon Sep 17 00:00:00 2001 From: Michael Howard Date: Thu, 12 Mar 2026 22:02:23 -0500 Subject: [PATCH 21/34] Get repo from file --- .github/actions/build-install/action.yml | 4 ---- .github/workflows/radeon-repo.txt | 1 + .github/workflows/test.yml | 21 ++++++++++++++------- 3 files changed, 15 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/radeon-repo.txt diff --git a/.github/actions/build-install/action.yml b/.github/actions/build-install/action.yml index 2ceca59..07f6d8c 100644 --- a/.github/actions/build-install/action.yml +++ b/.github/actions/build-install/action.yml @@ -8,10 +8,6 @@ inputs: runs: using: "composite" steps: - - name: Install build dependencies - run: | - sudo apt-get install --yes cmake - shell: bash - name: Configure run: | cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DHIPPER_TEST_PLATFORM=${{ inputs.platform }} diff --git a/.github/workflows/radeon-repo.txt b/.github/workflows/radeon-repo.txt new file mode 100644 index 0000000..f76e505 --- /dev/null +++ b/.github/workflows/radeon-repo.txt @@ -0,0 +1 @@ +7.2 https://repo.radeon.com/amdgpu-install/7.2/ubuntu/noble/amdgpu-install_7.2.70200-1_all.deb diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6d6b399..c1c5831 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,6 +24,9 @@ jobs: matrix: cuda: ["12.8.1"] steps: + - name: Install build dependencies + run: | + sudo apt-get install --yes cmake - uses: actions/checkout@v6 - name: Build and install uses: ./.github/actions/build-install @@ -38,17 +41,18 @@ jobs: matrix: rocm: ["7.2"] steps: - - name: Determine ROCm repository + - name: Find ROCm repository id: set-rocm-repo run: | - case "${{ matrix.rocm }}" - 7.2) - echo "rocmdeb=https://repo.radeon.com/amdgpu-install/7.2/ubuntu/noble/amdgpu-install_7.2.70200-1_all.deb" >> $GITHUB_OUTPUT;; - *) - echo "Unknown ROCm version" && exit 1;; - esac + rocmdeb=$(grep "^${{ matrix.rocm }} " radeon-repo.txt | awk '{print $2}') + if [[ -n $rocmdeb ]]; then + echo "rocmdeb=$rocmdeb" >> $GITHUB_OUTPUT + else + echo "Unknown ROCm version" && exit 1 + fi - name: Install ROCm run: | + wget ${{ steps.set-rocm-repo.outputs.rocmdeb }} -O amdgpu-install.deb sudo apt-get install --yes ./amdgpu-install.deb sudo apt-get update @@ -59,6 +63,9 @@ jobs: /opt/rocm/lib64 EOF sudo ldconfig + - name: Install build dependencies + run: | + sudo apt-get install --yes cmake - uses: actions/checkout@v6 - name: Build and install uses: ./.github/actions/build-install From 2ff867ddb1333207ac5502ab710e3056c97bb8e3 Mon Sep 17 00:00:00 2001 From: Michael Howard Date: Thu, 12 Mar 2026 22:04:47 -0500 Subject: [PATCH 22/34] Fix yml errors --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c1c5831..371adee 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,7 +26,7 @@ jobs: steps: - name: Install build dependencies run: | - sudo apt-get install --yes cmake + apt-get install --yes cmake - uses: actions/checkout@v6 - name: Build and install uses: ./.github/actions/build-install @@ -44,7 +44,7 @@ jobs: - name: Find ROCm repository id: set-rocm-repo run: | - rocmdeb=$(grep "^${{ matrix.rocm }} " radeon-repo.txt | awk '{print $2}') + rocmdeb=$(grep "^${{ matrix.rocm }} " ./.github/workflows/radeon-repo.txt | awk '{print $2}') if [[ -n $rocmdeb ]]; then echo "rocmdeb=$rocmdeb" >> $GITHUB_OUTPUT else From ad446ec3389c7280114dc9345ca2e190690d5689 Mon Sep 17 00:00:00 2001 From: Michael Howard Date: Thu, 12 Mar 2026 22:06:30 -0500 Subject: [PATCH 23/34] Checkout first --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 371adee..1ea0f6d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,10 +24,10 @@ jobs: matrix: cuda: ["12.8.1"] steps: + - uses: actions/checkout@v6 - name: Install build dependencies run: | apt-get install --yes cmake - - uses: actions/checkout@v6 - name: Build and install uses: ./.github/actions/build-install with: @@ -41,6 +41,7 @@ jobs: matrix: rocm: ["7.2"] steps: + - uses: actions/checkout@v6 - name: Find ROCm repository id: set-rocm-repo run: | @@ -66,7 +67,6 @@ jobs: - name: Install build dependencies run: | sudo apt-get install --yes cmake - - uses: actions/checkout@v6 - name: Build and install uses: ./.github/actions/build-install with: From 6ac7d265e8d6ab5a612fd8082e3080b9dc494213 Mon Sep 17 00:00:00 2001 From: Michael Howard Date: Thu, 12 Mar 2026 22:08:31 -0500 Subject: [PATCH 24/34] Update apt --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1ea0f6d..6fc2f7e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,6 +27,7 @@ jobs: - uses: actions/checkout@v6 - name: Install build dependencies run: | + apt-get update apt-get install --yes cmake - name: Build and install uses: ./.github/actions/build-install From 4eb59e2c332aa69e5153bdec095272d4a22d13f7 Mon Sep 17 00:00:00 2001 From: Michael Howard Date: Thu, 12 Mar 2026 22:15:06 -0500 Subject: [PATCH 25/34] More improvements --- .github/actions/build-install/action.yml | 5 ++++- .github/workflows/test.yml | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/actions/build-install/action.yml b/.github/actions/build-install/action.yml index 07f6d8c..9c67088 100644 --- a/.github/actions/build-install/action.yml +++ b/.github/actions/build-install/action.yml @@ -10,7 +10,10 @@ runs: steps: - name: Configure run: | - cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DHIPPER_TEST_PLATFORM=${{ inputs.platform }} + cmake -S . -B build \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install \ + -DHIPPER_TEST_PLATFORM=${{ inputs.platform }} shell: bash - name: Build run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6fc2f7e..06b3765 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,7 +24,8 @@ jobs: matrix: cuda: ["12.8.1"] steps: - - uses: actions/checkout@v6 + - name: Checkout code + uses: actions/checkout@v6 - name: Install build dependencies run: | apt-get update @@ -42,7 +43,8 @@ jobs: matrix: rocm: ["7.2"] steps: - - uses: actions/checkout@v6 + - name: Checkout code + uses: actions/checkout@v6 - name: Find ROCm repository id: set-rocm-repo run: | From 00d5d97d32725389ade3e161a83e7c7e98d7ab69 Mon Sep 17 00:00:00 2001 From: Michael Howard Date: Thu, 12 Mar 2026 22:18:42 -0500 Subject: [PATCH 26/34] Don't use separate action --- .github/actions/build-install/action.yml | 25 ------------------ .github/workflows/test.yml | 33 ++++++++++++++++++------ 2 files changed, 25 insertions(+), 33 deletions(-) delete mode 100644 .github/actions/build-install/action.yml diff --git a/.github/actions/build-install/action.yml b/.github/actions/build-install/action.yml deleted file mode 100644 index 9c67088..0000000 --- a/.github/actions/build-install/action.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: "Build and install" -description: "Build and install hipper" -inputs: - platform: - description: "Platform for building tests [nvidia, amd]" - required: true - default: "" -runs: - using: "composite" - steps: - - name: Configure - run: | - cmake -S . -B build \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install \ - -DHIPPER_TEST_PLATFORM=${{ inputs.platform }} - shell: bash - - name: Build - run: | - cmake --build build - shell: bash - - name: Install - run: | - cmake --install build - shell: bash diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 06b3765..915b01e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,10 +30,19 @@ jobs: run: | apt-get update apt-get install --yes cmake - - name: Build and install - uses: ./.github/actions/build-install - with: - platform: "nvidia" + - name: Configure + run: | + cmake -S . -B build \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install \ + -DHIPPER_TEST_PLATFORM=nvidia + -DCMAKE_CUDA_ARCHITECTURES=80 + - name: Build + run: | + cmake --build build + - name: Install + run: | + cmake --install build build-hip: name: ROCm ${{ matrix.rocm }} @@ -70,7 +79,15 @@ jobs: - name: Install build dependencies run: | sudo apt-get install --yes cmake - - name: Build and install - uses: ./.github/actions/build-install - with: - platform: "amd" + - name: Configure + run: | + cmake -S . -B build \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install \ + -DHIPPER_TEST_PLATFORM=amd + - name: Build + run: | + cmake --build build + - name: Install + run: | + cmake --install build From 38b8b58feb8a90811c48c5d648b16edae36fcd82 Mon Sep 17 00:00:00 2001 From: Michael Howard Date: Thu, 12 Mar 2026 22:21:30 -0500 Subject: [PATCH 27/34] Add missing backslash --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 915b01e..854b686 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,7 +35,7 @@ jobs: cmake -S . -B build \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install \ - -DHIPPER_TEST_PLATFORM=nvidia + -DHIPPER_TEST_PLATFORM=nvidia \ -DCMAKE_CUDA_ARCHITECTURES=80 - name: Build run: | From 9c709b4709ebcac476cd51d3d002c9157eaf16ea Mon Sep 17 00:00:00 2001 From: Michael Howard Date: Tue, 17 Mar 2026 20:12:10 -0500 Subject: [PATCH 28/34] Test multiple versions --- .github/rocm/6.0.3.txt | 1 + .github/rocm/6.1.4.txt | 1 + .github/rocm/6.2.4.txt | 1 + .github/rocm/6.3.4.txt | 1 + .github/rocm/6.4.4.txt | 1 + .github/rocm/7.0.3.txt | 1 + .github/rocm/7.1.1.txt | 1 + .github/rocm/7.2.0.txt | 1 + .github/workflows/radeon-repo.txt | 1 - .github/workflows/test.yml | 32 ++++++++++++++++++++++++------- CMakeLists.txt | 2 +- tests/CMakeLists.txt | 12 ++++-------- 12 files changed, 38 insertions(+), 17 deletions(-) create mode 100644 .github/rocm/6.0.3.txt create mode 100644 .github/rocm/6.1.4.txt create mode 100644 .github/rocm/6.2.4.txt create mode 100644 .github/rocm/6.3.4.txt create mode 100644 .github/rocm/6.4.4.txt create mode 100644 .github/rocm/7.0.3.txt create mode 100644 .github/rocm/7.1.1.txt create mode 100644 .github/rocm/7.2.0.txt delete mode 100644 .github/workflows/radeon-repo.txt diff --git a/.github/rocm/6.0.3.txt b/.github/rocm/6.0.3.txt new file mode 100644 index 0000000..60e4e0c --- /dev/null +++ b/.github/rocm/6.0.3.txt @@ -0,0 +1 @@ +https://repo.radeon.com/amdgpu-install/6.0.3/ubuntu/jammy/amdgpu-install_6.0.60003-1_all.deb diff --git a/.github/rocm/6.1.4.txt b/.github/rocm/6.1.4.txt new file mode 100644 index 0000000..120ba9f --- /dev/null +++ b/.github/rocm/6.1.4.txt @@ -0,0 +1 @@ +https://repo.radeon.com/amdgpu-install/6.1.4/ubuntu/jammy/amdgpu-install_6.1.60104-1_all.deb diff --git a/.github/rocm/6.2.4.txt b/.github/rocm/6.2.4.txt new file mode 100644 index 0000000..6de4820 --- /dev/null +++ b/.github/rocm/6.2.4.txt @@ -0,0 +1 @@ +https://repo.radeon.com/amdgpu-install/6.2.4/ubuntu/noble/amdgpu-install_6.2.60204-1_all.deb diff --git a/.github/rocm/6.3.4.txt b/.github/rocm/6.3.4.txt new file mode 100644 index 0000000..a2343a8 --- /dev/null +++ b/.github/rocm/6.3.4.txt @@ -0,0 +1 @@ +https://repo.radeon.com/amdgpu-install/6.3.4/ubuntu/noble/amdgpu-install_6.3.60304-1_all.deb diff --git a/.github/rocm/6.4.4.txt b/.github/rocm/6.4.4.txt new file mode 100644 index 0000000..0b54ea8 --- /dev/null +++ b/.github/rocm/6.4.4.txt @@ -0,0 +1 @@ +https://repo.radeon.com/amdgpu-install/6.4.4/ubuntu/noble/amdgpu-install_6.4.60404-1_all.deb diff --git a/.github/rocm/7.0.3.txt b/.github/rocm/7.0.3.txt new file mode 100644 index 0000000..b6137bd --- /dev/null +++ b/.github/rocm/7.0.3.txt @@ -0,0 +1 @@ +https://repo.radeon.com/amdgpu-install/7.0.3/ubuntu/noble/amdgpu-install_7.0.3.70003-1_all.deb diff --git a/.github/rocm/7.1.1.txt b/.github/rocm/7.1.1.txt new file mode 100644 index 0000000..b885a14 --- /dev/null +++ b/.github/rocm/7.1.1.txt @@ -0,0 +1 @@ +https://repo.radeon.com/amdgpu-install/7.1.1/ubuntu/noble/amdgpu-install_7.1.1.70101-1_all.deb diff --git a/.github/rocm/7.2.0.txt b/.github/rocm/7.2.0.txt new file mode 100644 index 0000000..5a124c1 --- /dev/null +++ b/.github/rocm/7.2.0.txt @@ -0,0 +1 @@ +https://repo.radeon.com/amdgpu-install/7.2/ubuntu/noble/amdgpu-install_7.2.70200-1_all.deb diff --git a/.github/workflows/radeon-repo.txt b/.github/workflows/radeon-repo.txt deleted file mode 100644 index f76e505..0000000 --- a/.github/workflows/radeon-repo.txt +++ /dev/null @@ -1 +0,0 @@ -7.2 https://repo.radeon.com/amdgpu-install/7.2/ubuntu/noble/amdgpu-install_7.2.70200-1_all.deb diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 854b686..b90f623 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,7 +22,8 @@ jobs: strategy: fail-fast: false matrix: - cuda: ["12.8.1"] + cuda: + ["12.4.1", "12.5.1", "12.6.3", "12.8.1", "12.9.1", "13.0.2", "13.1.1"] steps: - name: Checkout code uses: actions/checkout@v6 @@ -35,7 +36,7 @@ jobs: cmake -S . -B build \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install \ - -DHIPPER_TEST_PLATFORM=nvidia \ + -DHIPPER_TEST_PLATFORM=CUDA \ -DCMAKE_CUDA_ARCHITECTURES=80 - name: Build run: | @@ -46,19 +47,36 @@ jobs: build-hip: name: ROCm ${{ matrix.rocm }} - runs-on: ubuntu-24.04 + runs-on: ubuntu-${{ matrix.ubuntu }} strategy: fail-fast: false matrix: - rocm: ["7.2"] + include: + - rocm: "6.0.3" + ubuntu: "22.04" + - rocm: "6.1.4" + ubuntu: "22.04" + - rocm: "6.2.4" + ubuntu: "24.04" + - rocm: "6.3.4" + ubuntu: "24.04" + - rocm: "6.4.4" + ubuntu: "24.04" + - rocm: "7.0.3" + ubuntu: "24.04" + - rocm: "7.1.1" + ubuntu: "24.04" + - rocm: "7.2.0" + ubuntu: "24.04" steps: - name: Checkout code uses: actions/checkout@v6 - name: Find ROCm repository id: set-rocm-repo run: | - rocmdeb=$(grep "^${{ matrix.rocm }} " ./.github/workflows/radeon-repo.txt | awk '{print $2}') - if [[ -n $rocmdeb ]]; then + rocmfile=./.github/rocm/${{ matrix.rocm }}.txt + if [[ -f $rocmfile ]]; then + rocmdeb=$(cat $rocmfile) echo "rocmdeb=$rocmdeb" >> $GITHUB_OUTPUT else echo "Unknown ROCm version" && exit 1 @@ -84,7 +102,7 @@ jobs: cmake -S . -B build \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install \ - -DHIPPER_TEST_PLATFORM=amd + -DHIPPER_TEST_PLATFORM=HIP - name: Build run: | cmake --build build diff --git a/CMakeLists.txt b/CMakeLists.txt index c5aa776..1093506 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,7 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) set(HIPPER_MASTER_PROJECT ON) endif() option(HIPPER_INSTALL "Install hipper files?" ${HIPPER_MASTER_PROJECT}) -set(HIPPER_TEST_PLATFORM "" CACHE STRING "Platform for hipper tests [nvidia, amd]") +set(HIPPER_TEST_PLATFORM "" CACHE STRING "Platform for hipper tests [CUDA, HIP]") # header-only targets include(GNUInstallDirs) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 6cb8ed3..7452457 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -3,12 +3,12 @@ # This file is released under the Modified BSD License. # enable the language used for testing -if(HIPPER_TEST_PLATFORM STREQUAL "nvidia") +if(HIPPER_TEST_PLATFORM STREQUAL "CUDA") enable_language(CUDA) -elseif(HIPPER_TEST_PLATFORM STREQUAL "amd") +elseif(HIPPER_TEST_PLATFORM STREQUAL "HIP") enable_language(HIP) else() - message(FATAL_ERROR "HIPPER_TEST_PLATFORM value ${HIPPER_TEST_PLATFORM} not recognized, must be nvidia or amd") + message(FATAL_ERROR "HIPPER_TEST_PLATFORM value ${HIPPER_TEST_PLATFORM} not recognized, must be CUDA or HIP") endif() # the list of all source files @@ -39,11 +39,7 @@ endif() add_executable(test_hipper ${HIPPER_TEST_FILES}) target_link_libraries(test_hipper PRIVATE hipper::hipper Catch2::Catch2) -if(HIPPER_TEST_PLATFORM STREQUAL "nvidia") - target_compile_definitions(test_hipper PRIVATE HIPPER_CUDA) -elseif(HIPPER_TEST_PLATFORM STREQUAL "amd") - target_compile_definitions(test_hipper PRIVATE HIPPER_HIP) -endif() +target_compile_definitions(test_hipper PRIVATE HIPPER_${HIPPER_TEST_PLATFORM}) foreach(label ${HIPPER_TEST_LABELS}) add_test(NAME hipper-${label} COMMAND test_hipper "[${label}]") From 6380ab4b0ec56f0dd3ac5b4de7fb5281faa4d1cf Mon Sep 17 00:00:00 2001 From: Michael Howard Date: Tue, 17 Mar 2026 20:25:11 -0500 Subject: [PATCH 29/34] Try to fix sparse errors --- .github/workflows/test.yml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b90f623..84f5977 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,12 +18,25 @@ jobs: name: CUDA ${{ matrix.cuda }} runs-on: ubuntu-24.04 container: - image: nvidia/cuda:${{ matrix.cuda }}-devel-ubuntu24.04 + image: nvidia/cuda:${{ matrix.cuda }}-devel-ubuntu${{ matrix.ubuntu }} strategy: fail-fast: false matrix: - cuda: - ["12.4.1", "12.5.1", "12.6.3", "12.8.1", "12.9.1", "13.0.2", "13.1.1"] + include: + - cuda: "12.4.1" + ubuntu: "22.04" + - cuda: "12.5.1" + ubuntu: "24.04" + - cuda: "12.6.3" + ubuntu: "24.04" + - cuda: "12.8.1" + ubuntu: "24.04" + - cuda: "12.9.1" + ubuntu: "24.04" + - cuda: "13.0.2" + ubuntu: "24.04" + - cuda: "13.1.1" + ubuntu: "24.04" steps: - name: Checkout code uses: actions/checkout@v6 @@ -94,6 +107,11 @@ jobs: /opt/rocm/lib64 EOF sudo ldconfig + + # inject rocm 7.1.1 onto path + if [[ "${{ matrix.rocm }}" == "7.1.1" ]]; then + echo "/opt/rocm-7.1.1/bin" >> $GITHUB_PATH + fi - name: Install build dependencies run: | sudo apt-get install --yes cmake From 4e0e3d50050640377b4b162df8b6cf711ec69bff Mon Sep 17 00:00:00 2001 From: Michael Howard Date: Tue, 17 Mar 2026 20:43:26 -0500 Subject: [PATCH 30/34] Try removing or fixing failing actions --- .github/rocm/6.0.3.txt | 1 - .github/rocm/6.1.4.txt | 1 - .github/workflows/test.yml | 42 ++++++-------------------------------- 3 files changed, 6 insertions(+), 38 deletions(-) delete mode 100644 .github/rocm/6.0.3.txt delete mode 100644 .github/rocm/6.1.4.txt diff --git a/.github/rocm/6.0.3.txt b/.github/rocm/6.0.3.txt deleted file mode 100644 index 60e4e0c..0000000 --- a/.github/rocm/6.0.3.txt +++ /dev/null @@ -1 +0,0 @@ -https://repo.radeon.com/amdgpu-install/6.0.3/ubuntu/jammy/amdgpu-install_6.0.60003-1_all.deb diff --git a/.github/rocm/6.1.4.txt b/.github/rocm/6.1.4.txt deleted file mode 100644 index 120ba9f..0000000 --- a/.github/rocm/6.1.4.txt +++ /dev/null @@ -1 +0,0 @@ -https://repo.radeon.com/amdgpu-install/6.1.4/ubuntu/jammy/amdgpu-install_6.1.60104-1_all.deb diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 84f5977..b783d8d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,25 +18,11 @@ jobs: name: CUDA ${{ matrix.cuda }} runs-on: ubuntu-24.04 container: - image: nvidia/cuda:${{ matrix.cuda }}-devel-ubuntu${{ matrix.ubuntu }} + image: nvidia/cuda:${{ matrix.cuda }}-devel-ubuntu24.04 strategy: fail-fast: false matrix: - include: - - cuda: "12.4.1" - ubuntu: "22.04" - - cuda: "12.5.1" - ubuntu: "24.04" - - cuda: "12.6.3" - ubuntu: "24.04" - - cuda: "12.8.1" - ubuntu: "24.04" - - cuda: "12.9.1" - ubuntu: "24.04" - - cuda: "13.0.2" - ubuntu: "24.04" - - cuda: "13.1.1" - ubuntu: "24.04" + cuda: ["12.6.3", "12.8.1", "12.9.1", "13.0.2", "13.1.1"] steps: - name: Checkout code uses: actions/checkout@v6 @@ -60,27 +46,11 @@ jobs: build-hip: name: ROCm ${{ matrix.rocm }} - runs-on: ubuntu-${{ matrix.ubuntu }} + runs-on: ubuntu-24.04 strategy: fail-fast: false matrix: - include: - - rocm: "6.0.3" - ubuntu: "22.04" - - rocm: "6.1.4" - ubuntu: "22.04" - - rocm: "6.2.4" - ubuntu: "24.04" - - rocm: "6.3.4" - ubuntu: "24.04" - - rocm: "6.4.4" - ubuntu: "24.04" - - rocm: "7.0.3" - ubuntu: "24.04" - - rocm: "7.1.1" - ubuntu: "24.04" - - rocm: "7.2.0" - ubuntu: "24.04" + rocm: ["6.2.4", "6.3.4", "6.4.4", "7.0.3", "7.1.1", "7.2.0"] steps: - name: Checkout code uses: actions/checkout@v6 @@ -108,9 +78,9 @@ jobs: EOF sudo ldconfig - # inject rocm 7.1.1 onto path + # try to force root for this defective installation if [[ "${{ matrix.rocm }}" == "7.1.1" ]]; then - echo "/opt/rocm-7.1.1/bin" >> $GITHUB_PATH + echo "CMAKE_HIP_COMPILER_ROCM_ROOT=/opt/rocm-${{ matrix.rocm }}" >> $GITHUB_ENV fi - name: Install build dependencies run: | From 7a825de3cd8a133f811b938e72e000e9f86ac5b4 Mon Sep 17 00:00:00 2001 From: Michael Howard Date: Tue, 17 Mar 2026 20:49:46 -0500 Subject: [PATCH 31/34] Remove ROCm 7.1.1 --- .github/rocm/7.1.1.txt | 1 - .github/workflows/test.yml | 8 ++------ 2 files changed, 2 insertions(+), 7 deletions(-) delete mode 100644 .github/rocm/7.1.1.txt diff --git a/.github/rocm/7.1.1.txt b/.github/rocm/7.1.1.txt deleted file mode 100644 index b885a14..0000000 --- a/.github/rocm/7.1.1.txt +++ /dev/null @@ -1 +0,0 @@ -https://repo.radeon.com/amdgpu-install/7.1.1/ubuntu/noble/amdgpu-install_7.1.1.70101-1_all.deb diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b783d8d..40f6474 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -50,7 +50,8 @@ jobs: strategy: fail-fast: false matrix: - rocm: ["6.2.4", "6.3.4", "6.4.4", "7.0.3", "7.1.1", "7.2.0"] + # 7.1.1 skipped because the repository did not work + rocm: ["6.2.4", "6.3.4", "6.4.4", "7.0.3", "7.2.0"] steps: - name: Checkout code uses: actions/checkout@v6 @@ -77,11 +78,6 @@ jobs: /opt/rocm/lib64 EOF sudo ldconfig - - # try to force root for this defective installation - if [[ "${{ matrix.rocm }}" == "7.1.1" ]]; then - echo "CMAKE_HIP_COMPILER_ROCM_ROOT=/opt/rocm-${{ matrix.rocm }}" >> $GITHUB_ENV - fi - name: Install build dependencies run: | sudo apt-get install --yes cmake From 172cd26cb33a34963d212f9d4536facbe6704a61 Mon Sep 17 00:00:00 2001 From: Michael Howard Date: Tue, 17 Mar 2026 20:54:34 -0500 Subject: [PATCH 32/34] Try to force HIP compilation --- .github/workflows/test.yml | 1 - tests/CMakeLists.txt | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 40f6474..d988479 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -67,7 +67,6 @@ jobs: fi - name: Install ROCm run: | - wget ${{ steps.set-rocm-repo.outputs.rocmdeb }} -O amdgpu-install.deb sudo apt-get install --yes ./amdgpu-install.deb sudo apt-get update diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 7452457..6a9b31c 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -40,6 +40,9 @@ endif() add_executable(test_hipper ${HIPPER_TEST_FILES}) target_link_libraries(test_hipper PRIVATE hipper::hipper Catch2::Catch2) target_compile_definitions(test_hipper PRIVATE HIPPER_${HIPPER_TEST_PLATFORM}) +if (HIPPER_TEST_PLATFORM STREQUAL "HIP") + set_source_files_properties(${HIPPER_TEST_FILES} PROPERTIES LANGUAGE HIP) +endif() foreach(label ${HIPPER_TEST_LABELS}) add_test(NAME hipper-${label} COMMAND test_hipper "[${label}]") From ae0f343496160a8471f8a0eb54f0597e6c275ec2 Mon Sep 17 00:00:00 2001 From: Michael Howard Date: Tue, 17 Mar 2026 21:00:46 -0500 Subject: [PATCH 33/34] Warnings as errors --- .github/workflows/test.yml | 2 ++ tests/CMakeLists.txt | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d988479..d66f2d3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,6 +34,7 @@ jobs: run: | cmake -S . -B build \ -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_COMPILE_WARNING_AS_ERROR=ON \ -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install \ -DHIPPER_TEST_PLATFORM=CUDA \ -DCMAKE_CUDA_ARCHITECTURES=80 @@ -84,6 +85,7 @@ jobs: run: | cmake -S . -B build \ -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_COMPILE_WARNING_AS_ERROR=ON \ -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install \ -DHIPPER_TEST_PLATFORM=HIP - name: Build diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 6a9b31c..ce5931c 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -38,11 +38,11 @@ if(NOT Catch2_FOUND) endif() add_executable(test_hipper ${HIPPER_TEST_FILES}) -target_link_libraries(test_hipper PRIVATE hipper::hipper Catch2::Catch2) -target_compile_definitions(test_hipper PRIVATE HIPPER_${HIPPER_TEST_PLATFORM}) if (HIPPER_TEST_PLATFORM STREQUAL "HIP") set_source_files_properties(${HIPPER_TEST_FILES} PROPERTIES LANGUAGE HIP) endif() +target_link_libraries(test_hipper PRIVATE hipper::hipper Catch2::Catch2) +target_compile_definitions(test_hipper PRIVATE HIPPER_${HIPPER_TEST_PLATFORM}) foreach(label ${HIPPER_TEST_LABELS}) add_test(NAME hipper-${label} COMMAND test_hipper "[${label}]") From 59a7088252589890eda4ce2decc21f732632b6e7 Mon Sep 17 00:00:00 2001 From: Michael Howard Date: Tue, 17 Mar 2026 21:07:40 -0500 Subject: [PATCH 34/34] Discard results of CUB calls --- tests/test_cub.cu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_cub.cu b/tests/test_cub.cu index 3dafe4f..2c4465b 100644 --- a/tests/test_cub.cu +++ b/tests/test_cub.cu @@ -23,11 +23,11 @@ TEST_CASE("CUB operations", "[CUB]") // size temporary memory void *tmp = NULL; size_t tmp_bytes = 0; - hipper::cub::DeviceReduce::Sum(tmp,tmp_bytes,a,total,N); + static_cast(hipper::cub::DeviceReduce::Sum(tmp,tmp_bytes,a,total,N)); REQUIRE_SUCCESS(hipper::mallocManaged(reinterpret_cast(&tmp), tmp_bytes)); // take sum - hipper::cub::DeviceReduce::Sum(tmp,tmp_bytes,a,total,N); + static_cast(hipper::cub::DeviceReduce::Sum(tmp,tmp_bytes,a,total,N)); REQUIRE_SUCCESS(hipper::deviceSynchronize()); // check output