Skip to content

Commit 8172424

Browse files
committed
Add workflow to compile for HIP
1 parent 65939a6 commit 8172424

File tree

3 files changed

+57
-3
lines changed

3 files changed

+57
-3
lines changed
File renamed without changes.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: CMake
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
hip-version:
7+
required: true
8+
type: string
9+
gpu-arch:
10+
required: true
11+
type: string
12+
13+
env:
14+
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
15+
BUILD_TYPE: Debug
16+
17+
jobs:
18+
build:
19+
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
20+
# You can convert this to a matrix build if you need cross-platform coverage.
21+
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- uses: loostrum/[email protected]
26+
with:
27+
version: ${{ inputs.rocm-version }}
28+
29+
- uses: actions/checkout@v3
30+
with:
31+
submodules: 'true'
32+
33+
- name: Configure CMake
34+
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
35+
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
36+
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DKERNEL_FLOAT_BUILD_TEST=1 -DKERNEL_FLOAT_BUILD_EXAMPLE=1 -DCMAKE_HIP_ARCHITECTURES=${{ inputs.gpu-arch }}
37+
38+
- name: Build
39+
# Build your program with the given configuration
40+
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
41+
42+
- name: Test
43+
working-directory: ${{github.workspace}}/build
44+
# Execute tests defined by the CMake configuration.
45+
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
46+
run: ./tests/kernel_float_tests --durations=yes --success --verbosity=high ~[GPU]
47+

.github/workflows/cmake.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,25 @@ env:
1111

1212
jobs:
1313
build-cuda:
14-
uses: ./.github/workflows/cmake-action.yml
14+
uses: ./.github/workflows/cmake-run-cuda.yml
1515
with:
1616
cuda-version: "12.8.0"
1717

1818
build-cuda-12-6:
1919
needs: build-cuda
20-
uses: ./.github/workflows/cmake-action.yml
20+
uses: ./.github/workflows/cmake-run-cuda.yml
2121
with:
2222
cuda-version: "12.6.0"
2323

2424
build-cuda-12-5:
2525
needs: build-cuda
26-
uses: ./.github/workflows/cmake-action.yml
26+
uses: ./.github/workflows/cmake-run-cuda.yml
2727
with:
2828
cuda-version: "12.5.0"
29+
30+
build-hip-6-3-0:
31+
needs: build-cuda # Only attempt HIP after CUDA was succesfull
32+
uses: ./.github/workflows/cmake-run-hip.yml
33+
with:
34+
hip-version: "6.3.0"
35+
gpu-arch: "gfx942"

0 commit comments

Comments
 (0)