-
Notifications
You must be signed in to change notification settings - Fork 162
105 lines (102 loc) · 4.02 KB
/
pr.yml
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
name: "PR Tests"
permissions: read-all
# Trigger for PR an merge to develop branch
on:
push:
branches: develop
pull_request:
workflow_dispatch:
env:
CTEST_OUTPUT_ON_FAILURE: 1
LAPACK_VERSION: 3.12.0
PARALLEL: -j 2
jobs:
unit-tests:
runs-on: ubuntu-latest
# One runner for each domain
strategy:
matrix:
include:
- config: portBLAS
domain: blas
exclude: lapack|dft|rng
build_options: -DREF_BLAS_ROOT=${PWD}/lapack/install -DENABLE_PORTBLAS_BACKEND=ON -DENABLE_MKLCPU_BACKEND=OFF -DPORTBLAS_TUNING_TARGET=INTEL_CPU
- config: portFFT
domain: dft
exclude: blas|lapack|rng
build_options: -DENABLE_PORTFFT_BACKEND=ON -DENABLE_MKLCPU_BACKEND=OFF -DCMAKE_CXX_FLAGS="-fsycl -fsycl-targets=spir64"
test_options: -R 'DFT/CT/.*ComputeTests_in_place_COMPLEX.COMPLEX_SINGLE_in_place_buffer.sizes_8_batches_1*'
- config: MKL BLAS
domain: blas
exclude: lapack|dft|rng
build_options: -DREF_BLAS_ROOT=${PWD}/lapack/install
- config: MKL DFT
domain: dft
exclude: blas|lapack|rng
- config: MKL LAPACK
domain: lapack
exclude: blas|dft|rng
build_options: -DREF_LAPACK_ROOT=${PWD}/lapack/install
- config: MKL RNG
domain: rng
exclude: blas|dft|lapack
name: unit tests ${{ matrix.config }} CPU
steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- name: Restore netlib from cache
id: cache-lapack
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: lapack/install
key: lapack-${{ env.LAPACK_VERSION }}
- name: Install netlib
if: steps.cache-lapack.outputs.cache-hit != 'true'
run: |
curl -sL https://github.com/Reference-LAPACK/lapack/archive/refs/tags/v${LAPACK_VERSION}.tar.gz | tar zx
SHARED_OPT="lapack-${LAPACK_VERSION} -DBUILD_SHARED_LIBS=on -DCBLAS=on -DLAPACKE=on -DCMAKE_INSTALL_PREFIX=${PWD}/lapack/install"
# 32 bit int
cmake ${SHARED_OPT} -B lapack/build32
cmake --build lapack/build32 ${PARALLEL} --target install
# 64 bit int
cmake ${SHARED_OPT} -DBUILD_INDEX64=on -B lapack/build64
cmake --build lapack/build64 ${PARALLEL} --target install
- name: Test if the changes affect this domain
id: test_domain
uses: actions/github-script@v4
with:
script: |
function matchesPattern(filePaths) {
console.log('files:', filePaths)
const dirs = '(examples|src|include/oneapi/mkl)'
const domains = '(blas|lapack|rng|dft)'
const domain = '${{ matrix.domain }}'
// matches the domain we want or no domain at all
const re = new RegExp(`^(${dirs}/${domain}|(?!${dirs}/${domains}))`);
return filePaths.some(filePath => re.test(filePath));
}
const pr = context.payload.pull_request
const compare = await github.rest.repos.compareCommits({
owner: context.repo.owner,
repo: context.repo.repo,
base: pr.base.sha,
head: pr.head.sha
});
return matchesPattern(compare.data.files.map((f) => f.filename));
- name: Install oneapi
if: steps.test_domain.outputs.result == 'true'
uses: rscohn2/setup-oneapi@2ad0cf6b74bc2426bdcee825cf88f9db719dd727 # v0.1.0
with:
components: |
- name: Configure/Build for a domain
if: steps.test_domain.outputs.result == 'true'
run: |
source /opt/intel/oneapi/setvars.sh
cmake -DTARGET_DOMAINS=${{ matrix.domain }} -DENABLE_MKLGPU_BACKEND=off -DCMAKE_VERBOSE_MAKEFILE=on ${{ matrix.build_options }} -B build
cmake --build build ${PARALLEL}
- name: Run tests
if: steps.test_domain.outputs.result == 'true'
run: |
source /opt/intel/oneapi/setvars.sh
ctest --test-dir build ${{ matrix.test_options }}