Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f9fb64a
Fix compile issues, enable GitHub Actions
mphoward Mar 12, 2026
dcac8c5
Add cmake dependency
mphoward Mar 12, 2026
89b8d56
Set C++17 as minimum
mphoward Mar 12, 2026
afe24fa
Add additional CUDA versions
mphoward Mar 12, 2026
788ecb4
Try testing only HIP
mphoward Mar 12, 2026
5abfbbd
Try running apt differently
mphoward Mar 12, 2026
b9ff253
Try running different order
mphoward Mar 12, 2026
c79e73a
Try simpler
mphoward Mar 12, 2026
4683e19
Use sudo
mphoward Mar 12, 2026
4aab018
Try rocm again
mphoward Mar 12, 2026
e259a3c
Try building HIP from source
mphoward Mar 12, 2026
8fece4b
Try changing CMake setup
mphoward Mar 12, 2026
89437c7
Try package manager again
mphoward Mar 12, 2026
69c1cac
Try package manager again
mphoward Mar 12, 2026
5db09f0
Back to separate tests
mphoward Mar 12, 2026
0286f4b
Try stripping down to just HIP SDK
mphoward Mar 12, 2026
73033ab
Get even leaner
mphoward Mar 12, 2026
cef5160
Refactor tests
mphoward Mar 13, 2026
f75f917
Put action in right spot
mphoward Mar 13, 2026
23af090
Continue to try to improve actions
mphoward Mar 13, 2026
f503a92
Get repo from file
mphoward Mar 13, 2026
2ff867d
Fix yml errors
mphoward Mar 13, 2026
ad446ec
Checkout first
mphoward Mar 13, 2026
6ac7d26
Update apt
mphoward Mar 13, 2026
4eb59e2
More improvements
mphoward Mar 13, 2026
00d5d97
Don't use separate action
mphoward Mar 13, 2026
38b8b58
Add missing backslash
mphoward Mar 13, 2026
9c709b4
Test multiple versions
mphoward Mar 18, 2026
6380ab4
Try to fix sparse errors
mphoward Mar 18, 2026
4e0e3d5
Try removing or fixing failing actions
mphoward Mar 18, 2026
7a825de
Remove ROCm 7.1.1
mphoward Mar 18, 2026
172cd26
Try to force HIP compilation
mphoward Mar 18, 2026
ae0f343
Warnings as errors
mphoward Mar 18, 2026
59a7088
Discard results of CUB calls
mphoward Mar 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/rocm/6.2.4.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://repo.radeon.com/amdgpu-install/6.2.4/ubuntu/noble/amdgpu-install_6.2.60204-1_all.deb
1 change: 1 addition & 0 deletions .github/rocm/6.3.4.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://repo.radeon.com/amdgpu-install/6.3.4/ubuntu/noble/amdgpu-install_6.3.60304-1_all.deb
1 change: 1 addition & 0 deletions .github/rocm/6.4.4.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://repo.radeon.com/amdgpu-install/6.4.4/ubuntu/noble/amdgpu-install_6.4.60404-1_all.deb
1 change: 1 addition & 0 deletions .github/rocm/7.0.3.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://repo.radeon.com/amdgpu-install/7.0.3/ubuntu/noble/amdgpu-install_7.0.3.70003-1_all.deb
1 change: 1 addition & 0 deletions .github/rocm/7.2.0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://repo.radeon.com/amdgpu-install/7.2/ubuntu/noble/amdgpu-install_7.2.70200-1_all.deb
96 changes: 96 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: test

on:
pull_request:

push:
branches:
- main

workflow_call:

concurrency:
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.6.3", "12.8.1", "12.9.1", "13.0.2", "13.1.1"]
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install build dependencies
run: |
apt-get update
apt-get install --yes cmake
- name: Configure
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
- name: Build
run: |
cmake --build build
- name: Install
run: |
cmake --install build

build-hip:
name: ROCm ${{ matrix.rocm }}
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
# 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
- name: Find ROCm repository
id: set-rocm-repo
run: |
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
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
sudo apt-get install --yes rocm-hip-sdk

sudo tee --append /etc/ld.so.conf.d/rocm.conf <<EOF
/opt/rocm/lib
/opt/rocm/lib64
EOF
sudo ldconfig
- name: Install build dependencies
run: |
sudo apt-get install --yes cmake
- name: Configure
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
run: |
cmake --build build
- name: Install
run: |
cmake --install build
15 changes: 15 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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
18 changes: 9 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

# Maintainer: mphoward

cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.28)

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
Expand All @@ -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 [CUDA, HIP]")

# header-only targets
include(GNUInstallDirs)
Expand All @@ -25,12 +25,6 @@ add_library(hipper::hipper ALIAS hipper)
target_include_directories(hipper INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)

# add tests
if(HIPPER_TEST)
enable_testing()
add_subdirectory(tests)
endif()

# install headers
if(HIPPER_INSTALL)
include(CMakePackageConfigHelpers)
Expand All @@ -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()
1 change: 0 additions & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

1 change: 0 additions & 1 deletion doc/runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,4 +376,3 @@
| `cudaProfilerStop` | `hipProfilerStop` | `hipper::profilerStop`\* |

\*: feature only available with `HIPPER_USE_DEPRECATED`.

31 changes: 21 additions & 10 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 "CUDA")
enable_language(CUDA)
elseif(HIPPER_TEST_PLATFORM STREQUAL "HIP")
enable_language(HIP)
else()
message(FATAL_ERROR "HIPPER_TEST_PLATFORM value ${HIPPER_TEST_PLATFORM} not recognized, must be CUDA or HIP")
endif()

# the list of all source files
set(HIPPER_TEST_FILES
test_hipper.cc
Expand All @@ -14,14 +23,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)
Expand All @@ -31,8 +37,13 @@ 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})
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})

add_subdirectory(cuda)
add_subdirectory(hip)
foreach(label ${HIPPER_TEST_LABELS})
add_test(NAME hipper-${label} COMMAND test_hipper "[${label}]")
endforeach()
37 changes: 0 additions & 37 deletions tests/cuda/CMakeLists.txt

This file was deleted.

26 changes: 0 additions & 26 deletions tests/hip/CMakeLists.txt

This file was deleted.

4 changes: 2 additions & 2 deletions tests/test_cub.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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<void>(hipper::cub::DeviceReduce::Sum(tmp,tmp_bytes,a,total,N));
REQUIRE_SUCCESS(hipper::mallocManaged(reinterpret_cast<void**>(&tmp), tmp_bytes));

// take sum
hipper::cub::DeviceReduce::Sum(tmp,tmp_bytes,a,total,N);
static_cast<void>(hipper::cub::DeviceReduce::Sum(tmp,tmp_bytes,a,total,N));
REQUIRE_SUCCESS(hipper::deviceSynchronize());

// check output
Expand Down