@@ -3,165 +3,95 @@ name: CMake
33on : [push, pull_request]
44
55env :
6- # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
7- BUILD_TYPE : RelWithDebInfo
6+ CXX : g++-11
7+ KOKKOS_VERSION : 3.6.00
8+ KK_VERSION : develop
89
910jobs :
10- build-mdspan :
11+ stdblas :
12+ name : Test stdBLAS
1113 runs-on : ubuntu-latest
12- container :
13- image : amklinv/stdblas:latest
14+ # container: # TODO: build new image - needs newer cmake
15+ # image: amklinv/stdblas:latest
1416 defaults :
1517 run :
1618 shell : bash
1719
20+ strategy :
21+ matrix :
22+ cmake_build_type : [RelWithDebInfo] # , Release, Debug
23+ # TODO: use include to replace "on/off" with "Kokkos/Serial"
24+ enable_kokkos : [OFF] # , ON
25+
26+ env :
27+ BUILD_TYPE : $${{ matrix.cmake_build_type }}
28+ INSTALL_PATH : $GITHUB_WORKSPACE/install
29+ # UTILS_PATH: $GITHUB_WORKSPACE/src/stdblas/.github/workflows/utils
30+
1831 steps :
1932
20- - id : get-sha
21- run : echo ::set-output name=sha::$( curl https://api.github.com/repos/kokkos/mdspan/git/ref/heads/stable | jq .object.sha | tr -d '"' )
22-
23- - name : Determine whether mdspan needs to be rebuilt
24- id : cache-mdspan
25- uses : actions/cache@v2
33+ - name : Install prerequisites
34+ run : |
35+ sudo apt update
36+ sudo apt install -y cmake g++-11 libtbb-dev
37+
38+ - name : Check out stdBLAS
39+ uses : actions/checkout@v2
2640 with :
27- path : mdspan-install
28- key : mdspan-${{ steps.get-sha.outputs.sha }}
29-
30- - name : Create Build Environment
31- if : steps.cache-mdspan.outputs.cache-hit != 'true'
32- run : cmake -E make_directory mdspan-build
33-
34- - name : Check Out
35- if : steps.cache-mdspan.outputs.cache-hit != 'true'
41+ path : src/stdblas
42+
43+ - name : Check out mdspan
3644 uses : actions/checkout@v2
3745 with :
3846 repository : kokkos/mdspan
39- path : mdspan-src
40-
41- - name : Configure CMake
42- if : steps.cache-mdspan.outputs.cache-hit != 'true'
43- working-directory : mdspan-build
44- run : cmake $GITHUB_WORKSPACE/mdspan-src -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/mdspan-install
45-
46- - name : Build
47- if : steps.cache-mdspan.outputs.cache-hit != 'true'
48- working-directory : mdspan-build
49- run : make
50-
51- - name : Install
52- if : steps.cache-mdspan.outputs.cache-hit != 'true'
53- working-directory : mdspan-build
54- run : make install
55-
56- - name : Upload
57- uses : actions/upload-artifact@v2
58- with :
59- name : mdspan
60- path : mdspan-install
47+ path : src/mdspan
6148
62- configure-stdblas :
63- runs-on : ubuntu-latest
64- container :
65- image : amklinv/mdspan-dependencies:latest
66- needs : build-mdspan
67-
68- steps :
69- - name : Download mdspan
70- uses : actions/download-artifact@v2
71- with :
72- name : mdspan
73- path : mdspan-install
74-
75- - name : Create Build Environment
76- run : cmake -E make_directory stdblas-build
77-
78- - name : Check Out
49+ - name : Checkout Kokkos
50+ if : matrix.enable_kokkos == 'ON'
7951 uses : actions/checkout@v2
8052 with :
81- path : stdblas-src
82-
83- - name : Configure CMake
84- shell : bash
85- working-directory : stdblas-build
86- run : cmake $GITHUB_WORKSPACE/stdblas-src -Dmdspan_DIR=$GITHUB_WORKSPACE/mdspan-install/lib/cmake/mdspan -DLINALG_ENABLE_TESTS=On -DLINALG_ENABLE_EXAMPLES=On -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/stdblas-install
87-
88- - name : Upload workspace
89- uses : actions/upload-artifact@v2
90- with :
91- name : workspace
92- path : .
93-
94- build-stdblas :
95- runs-on : ubuntu-latest
96- container :
97- image : amklinv/mdspan-dependencies:latest
98- needs : configure-stdblas
99-
100- steps :
101-
102- - name : Download workspace
103- uses : actions/download-artifact@v2
104- with :
105- name : workspace
106- path : .
107-
108- - name : Build
109- working-directory : stdblas-build
110- shell : bash
111- run : make
112-
113- - name : Tar files
114- shell : bash
115- run : tar -cvf stdblas.tar *
116-
117- - name : Upload workspace
118- uses : actions/upload-artifact@v2
119- with :
120- name : stdblas
121- path : stdblas.tar
122-
123- test-stdBLAS :
124- runs-on : ubuntu-latest
125- container :
126- image : amklinv/mdspan-dependencies:latest
127- needs : build-stdblas
128-
129- steps :
130-
131- - name : Download workspace
132- uses : actions/download-artifact@v2
133- with :
134- name : stdblas
135- path : .
136-
137- - name : Untar files
138- shell : bash
139- run : tar -xvf stdblas.tar
140-
141- - name : Test
142- working-directory : stdblas-build
143- shell : bash
144- run : ctest --output-on-failure
145-
146- install-stdBLAS :
147- runs-on : ubuntu-latest
148- container :
149- image : amklinv/mdspan-dependencies:latest
150- needs : build-stdblas
151-
152- steps :
153-
154- - name : Download workspace
155- uses : actions/download-artifact@v2
53+ repository : kokkos/kokkos
54+ path : src/kokkos
55+ ref : $KOKKOS_VERSION
56+
57+ - name : Checkout Kokkos-Kernels
58+ if : matrix.enable_kokkos == 'ON'
59+ uses : actions/checkout@v2
15660 with :
157- name : stdblas
158- path : .
159-
160- - name : Untar files
161- shell : bash
162- run : tar -xvf stdblas.tar
163-
164- - name : Install
165- working-directory : stdblas-build
166- shell : bash
167- run : make install
61+ repository : kokkos/kokkos-kernels
62+ path : src/kokkos-kernels
63+ ref : $KK_VERSION
64+
65+ - name : Build and install mdspan
66+ run : $GITHUB_WORKSPACE/src/stdblas/.github/workflows/utils/build_mdspan.sh
67+
68+ # Note: enabling parallel backend, like OpenMP
69+ # gives a chance to detect threading issues, e.g. races
70+ - name : Build and install Kokkos
71+ if : matrix.enable_kokkos == 'ON'
72+ run : $GITHUB_WORKSPACE/src/stdblas/.github/workflows/utils/build_kokkos.sh
73+
74+ - name : Build and install Kokkos-Kernels
75+ if : matrix.enable_kokkos == 'ON'
76+ run : $GITHUB_WORKSPACE/src/stdblas/.github/workflows/utils/build_kokkos-kernels.sh
77+
78+ - name : Configure stdBLAS
79+ run : |
80+ cmake \
81+ -S $GITHUB_WORKSPACE/src/stdblas \
82+ -B $GITHUB_WORKSPACE/build/stdblas \
83+ -DCMAKE_BUILD_TYPE:STRING=$${{ matrix.cmake_build_type }} \
84+ -DCMAKE_INSTALL_PREFIX:FILEPATH=$GITHUB_WORKSPACE/install \
85+ -DCMAKE_CXX_STANDARD:STRING=17 \
86+ -DLINALG_ENABLE_TESTS:BOOL=ON \
87+ -DLINALG_ENABLE_EXAMPLES:BOOL=On \
88+ -DLINALG_ENABLE_CONCEPTS:BOOL=ON \
89+ -DLINALG_ENABLE_KOKKOS:BOOL=$${{ matrix.enable_kokkos }} \
90+ -DLINALG_ENABLE_KOKKOS_DEFAULT:BOOL=$${{ matrix.enable_kokkos }}
91+
92+ - name : Build stdBLAS
93+ run : cmake --build $GITHUB_WORKSPACE/build/stdblas -j $(nproc)
94+
95+ - name : Test stdBLAS
96+ working-directory : build/stdblas
97+ run : ctest -j $(nproc) --output-on-failure
0 commit comments