Skip to content

Commit 1386358

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

File tree

3 files changed

+54
-3
lines changed

3 files changed

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

.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+
version: "6.3.0"
35+
gpu_arch: "gfx942"

0 commit comments

Comments
 (0)