Skip to content

Commit 0001a32

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

File tree

3 files changed

+67
-13
lines changed

3 files changed

+67
-13
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+
rocm-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: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,26 @@ env:
1010
BUILD_TYPE: Debug
1111

1212
jobs:
13-
build-cuda:
14-
uses: ./.github/workflows/cmake-action.yml
15-
with:
16-
cuda-version: "12.8.0"
13+
#build-cuda:
14+
# uses: ./.github/workflows/cmake-run-cuda.yml
15+
# with:
16+
# cuda-version: "12.8.0"
1717

18-
build-cuda-12-6:
19-
needs: build-cuda
20-
uses: ./.github/workflows/cmake-action.yml
21-
with:
22-
cuda-version: "12.6.0"
18+
#build-cuda-12-6:
19+
# needs: build-cuda
20+
# uses: ./.github/workflows/cmake-run-cuda.yml
21+
# with:
22+
# cuda-version: "12.6.0"
23+
24+
#build-cuda-12-5:
25+
# needs: build-cuda
26+
# uses: ./.github/workflows/cmake-run-cuda.yml
27+
# with:
28+
# cuda-version: "12.5.0"
2329

24-
build-cuda-12-5:
25-
needs: build-cuda
26-
uses: ./.github/workflows/cmake-action.yml
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
2733
with:
28-
cuda-version: "12.5.0"
34+
rocm-version: "6.3.0"
35+
gpu-arch: "gfx942"

0 commit comments

Comments
 (0)