@@ -3,165 +3,96 @@ name: CMake
33on : [push, pull_request]
44
55env :
6- # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
7- BUILD_TYPE : RelWithDebInfo
6+ # Note: need gcc 10 (or newer) to avoid TBB errors
7+ # Note: g++-11 fails with "sorry, unimplemented: unexpected AST of kind nontype_argument_pack"
8+ CXX : g++-10
9+ CC : gcc-10
10+ CXX_STANDARD : 17
11+ KOKKOS_VERSION : 3.6.00 # develop
12+ KK_VERSION : 3.6.00 # develop
13+ SHARED_LIBS : ON
814
915jobs :
10- build-mdspan :
16+ stdblas :
17+ name : Test stdBLAS
1118 runs-on : ubuntu-latest
12- container :
13- image : amklinv/stdblas:latest
1419 defaults :
1520 run :
1621 shell : bash
1722
18- steps :
23+ strategy :
24+ matrix :
25+ implementation : [Native, Kokkos]
26+ cmake_build_type : [Release, Debug] # RelWithDebInfo
27+
28+ env :
29+ BUILD_TYPE : ${{ matrix.cmake_build_type }}
30+ INSTALL_PATH : ${{ github.workspace }}/install
31+ UTILS_PATH : ${{ github.workspace }}/src/stdblas/.github/workflows/utils
32+ KOKKOS_BACKEND : Serial # TODO: ${{ matrix.kokkos_backend }} ?
33+ # FIXME OpenMP fails tests with: "Kokkos::OpenMP parallel_reduce ERROR: in parallel or not initialized"
34+ # FIXME Threads fails tests with: "ThreadsExec::start FAILED : Threads not initialized."
1935
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
26- 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'
36- uses : actions/checkout@v2
37- with :
38- 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
61-
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
79- uses : actions/checkout@v2
80- 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-
15236 steps :
153-
154- - name : Download workspace
155- uses : actions/download-artifact@v2
156- 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
37+
38+ - name : Check out stdBLAS
39+ uses : actions/checkout@v2
40+ with :
41+ path : src/stdblas
42+
43+ - name : Check out mdspan
44+ uses : actions/checkout@v2
45+ with :
46+ repository : kokkos/mdspan
47+ path : src/mdspan
48+
49+ - name : Build and install mdspan
50+ run : $UTILS_PATH/build_mdspan.sh
51+
52+ - name : Check out Kokkos
53+ if : matrix.implementation == 'Kokkos'
54+ uses : actions/checkout@v2
55+ with :
56+ repository : kokkos/kokkos
57+ path : src/kokkos
58+ ref : ${{ env.KOKKOS_VERSION }}
59+
60+ - name : Build and install Kokkos
61+ if : matrix.implementation == 'Kokkos'
62+ run : $UTILS_PATH/build_kokkos.sh
63+
64+ - name : Check out Kokkos-Kernels
65+ if : matrix.implementation == 'Kokkos'
66+ uses : actions/checkout@v2
67+ with :
68+ repository : kokkos/kokkos-kernels
69+ path : src/kokkos-kernels
70+ ref : ${{ env.KK_VERSION }}
71+
72+ - name : Build and install Kokkos-Kernels
73+ if : matrix.implementation == 'Kokkos'
74+ run : $UTILS_PATH/build_kokkos-kernels.sh
75+
76+ - name : Configure stdBLAS
77+ run : |
78+ [[ ${{ matrix.implementation }} == "Kokkos" ]] && ENABLE_KOKKOS=ON
79+ cmake \
80+ -S $GITHUB_WORKSPACE/src/stdblas \
81+ -B $GITHUB_WORKSPACE/build/stdblas \
82+ -DCMAKE_BUILD_TYPE:STRING=${{ matrix.cmake_build_type }} \
83+ -DCMAKE_INSTALL_PREFIX:FILEPATH=$GITHUB_WORKSPACE/install \
84+ -DBUILD_SHARED_LIBS=$SHARED_LIBS \
85+ -DCMAKE_CXX_STANDARD:STRING=$CXX_STANDARD \
86+ -DLINALG_ENABLE_TESTS:BOOL=ON \
87+ -DLINALG_ENABLE_EXAMPLES:BOOL=On \
88+ -DLINALG_ENABLE_CONCEPTS:BOOL=ON \
89+ -DLINALG_ENABLE_KOKKOS:BOOL=$ENABLE_KOKKOS \
90+ -DLINALG_ENABLE_KOKKOS_DEFAULT:BOOL=$ENABLE_KOKKOS
91+
92+ - name : Build stdBLAS
93+ run : |
94+ cmake --build $GITHUB_WORKSPACE/build/stdblas -j $(nproc)
95+
96+ # - name: Test stdBLAS
97+ # working-directory: build/stdblas
98+ # run: ctest -j $(nproc) --timeout 60 --output-on-failure
0 commit comments