@@ -3,165 +3,99 @@ 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++-10 # Note: need g++ 10 for TBB (under std parallel execution)
7+ CC : gcc-10
8+ CXX_STANDARD : 17
9+ KOKKOS_VERSION : develop # 3.6.00
10+ KK_VERSION : develop
11+ SHARED_LIBS : ON
812
913jobs :
10- build-mdspan :
14+ stdblas :
15+ name : Test stdBLAS
1116 runs-on : ubuntu-latest
12- container :
13- image : amklinv/stdblas:latest
1417 defaults :
1518 run :
1619 shell : bash
1720
18- steps :
21+ strategy :
22+ matrix :
23+ implementation : [Native, Kokkos]
24+ cmake_build_type : [Release, Debug] # RelWithDebInfo
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+ KOKKOS_BACKEND : Serial # TODO: ${{ matrix.kokkos_backend }} ?
31+ # FIXME OpenMP fails tests with: "Kokkos::OpenMP parallel_reduce ERROR: in parallel or not initialized"
32+ # FIXME Threads fails tests with: "ThreadsExec::start FAILED : Threads not initialized."
1933
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-
15234 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
35+
36+ # Note: g++ 11 fails with "sorry, unimplemented: unexpected AST of kind nontype_argument_pack"
37+ # - name: Install prerequisites
38+ # run: |
39+ # sudo apt update
40+ # sudo apt install -y g++-11 gcc-11
41+
42+ - name : Check out stdBLAS
43+ uses : actions/checkout@v2
44+ with :
45+ path : src/stdblas
46+
47+ - name : Check out mdspan
48+ uses : actions/checkout@v2
49+ with :
50+ repository : kokkos/mdspan
51+ path : src/mdspan
52+
53+ - name : Build and install mdspan
54+ run : $UTILS_PATH/build_mdspan.sh
55+
56+ - name : Check out Kokkos
57+ if : matrix.implementation == 'Kokkos'
58+ uses : actions/checkout@v2
59+ with :
60+ repository : kokkos/kokkos
61+ path : src/kokkos
62+ ref : ${{ env.KOKKOS_VERSION }}
63+
64+ - name : Build and install Kokkos
65+ if : matrix.implementation == 'Kokkos'
66+ run : $UTILS_PATH/build_kokkos.sh
67+
68+ - name : Check out Kokkos-Kernels
69+ if : matrix.implementation == 'Kokkos'
70+ uses : actions/checkout@v2
71+ with :
72+ repository : kokkos/kokkos-kernels
73+ path : src/kokkos-kernels
74+ ref : ${{ env.KK_VERSION }}
75+
76+ - name : Build and install Kokkos-Kernels
77+ if : matrix.implementation == 'Kokkos'
78+ run : $UTILS_PATH/build_kokkos-kernels.sh
79+
80+ - name : Configure stdBLAS
81+ run : |
82+ [[ ${{ matrix.implementation }} == "Kokkos" ]] && ENABLE_KOKKOS=ON
83+ cmake \
84+ -S $GITHUB_WORKSPACE/src/stdblas \
85+ -B $GITHUB_WORKSPACE/build/stdblas \
86+ -DCMAKE_BUILD_TYPE:STRING=${{ matrix.cmake_build_type }} \
87+ -DCMAKE_INSTALL_PREFIX:FILEPATH=$GITHUB_WORKSPACE/install \
88+ -DBUILD_SHARED_LIBS=$SHARED_LIBS \
89+ -DCMAKE_CXX_STANDARD:STRING=$CXX_STANDARD \
90+ -DLINALG_ENABLE_TESTS:BOOL=ON \
91+ -DLINALG_ENABLE_EXAMPLES:BOOL=On \
92+ -DLINALG_ENABLE_CONCEPTS:BOOL=ON \
93+ -DLINALG_ENABLE_KOKKOS:BOOL=$ENABLE_KOKKOS \
94+ -DLINALG_ENABLE_KOKKOS_DEFAULT:BOOL=$ENABLE_KOKKOS
95+
96+ - name : Build stdBLAS
97+ run : cmake --build $GITHUB_WORKSPACE/build/stdblas -j $(nproc)
98+
99+ - name : Test stdBLAS
100+ working-directory : build/stdblas
101+ run : ctest -j $(nproc) --timeout 60 --output-on-failure
0 commit comments