-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (106 loc) · 4.13 KB
/
Copy pathsimd-backends.yml
File metadata and controls
112 lines (106 loc) · 4.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# SPDX-FileCopyrightText: 2026 CExA-project
# SPDX-License-Identifier: MIT or Apache-2.0 with LLVM-exception
name: SIMD Backends Tests
on:
pull_request:
paths:
- '.github/workflows/simd-backends.yml'
- 'simd-backends/**'
- '!simd-backends/README.md'
push:
branches:
- main
concurrency:
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
simd-backends-ci:
continue-on-error: true
runs-on: ubuntu-latest
env:
CMAKE_GENERATOR: Ninja
Kokkos_ROOT: ${{ github.workspace }}/opt/kokkos
sleef_ROOT: ${{ github.workspace }}/opt/sleef
CexaSimdBackends_ROOT: ${{ github.workspace }}/simd-backends/install
steps:
- uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
id: cache-sleef
with:
path: opt/sleef
key: simd-backends-sleef-ubuntu-latest
- name: Checkout Code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Checkout Sleef
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
if: steps.cache-sleef.outputs.cache-hit != 'true'
with:
repository: shibatch/sleef
ref: 3.9.0
path: sleef
- name: Install Sleef
if: steps.cache-sleef.outputs.cache-hit != 'true'
run: |
cmake -S sleef -B sleef/build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_INSTALL_PREFIX="$sleef_ROOT" \
-DSLEEF_BUILD_GNUABI_LIBS=OFF \
-DSLEEF_BUILD_TESTS=OFF \
-DSLEEF_ENABLE_TLFLOAT=OFF \
-DSLEEF_ENABLE_FFTW=OFF \
-DSLEEF_ENABLE_MPFR=OFF
cmake --build sleef/build -j --target install
- name: Checkout Kokkos
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: kokkos/kokkos
ref: 5.0.2
path: kokkos
- name: Install kokkos
run: |
cmake -S kokkos -B kokkos/build \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX="$Kokkos_ROOT" \
-DKokkos_ARCH_NATIVE=ON
cmake --build kokkos/build -j --target install
- name: Configure
working-directory: ${{ github.workspace }}/simd-backends
run:
cmake -S . -B build
-DCMAKE_CXX_COMPILER=g++
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DCMAKE_INSTALL_PREFIX="$CexaSimdBackends_ROOT"
-DCEXA_SIMD_ENABLE_SLEEF=ON
-DCEXA_SIMD_ENABLE_TESTS=ON
- name: Build
working-directory: ${{ github.workspace }}/simd-backends
run: cmake --build build -j
- name: Install
working-directory: ${{ github.workspace }}/simd-backends
run: cmake --install build
- name: Test install
working-directory: ${{ github.workspace }}/simd-backends/test/install_test
run: |
cmake -S . -B build \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build -j
./build/main
- name: Patch Kokkos
working-directory: ${{ github.workspace }}/kokkos/simd/unit_tests
run: |
cp "$CexaSimdBackends_ROOT/include/CEXA_SIMD_SLEEF.hpp" include
sed -i '/kokkos_add_executable_and_test/a find_package(sleef REQUIRED)\ntarget_link_libraries(Kokkos_UnitTest_SIMD PRIVATE sleef::sleef)' CMakeLists.txt
sed -i '/include <Kokkos_SIMD.hpp>/a #include <CEXA_SIMD_SLEEF.hpp>' include/TestSIMD_MathOps.hpp
- name: Build and run Kokkos SIMD unit test
working-directory: ${{ github.workspace }}/kokkos
run: |
cmake -S . -B build \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DKokkos_ARCH_NATIVE=ON \
-DKokkos_ENABLE_TESTS=ON
cmake --build build -j --target Kokkos_UnitTest_SIMD
ctest --test-dir build --output-on-failure -R SIMD