forked from mixxxdj/mixxx
-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (71 loc) · 2.35 KB
/
vectorization.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
name: Check Vectorization by Compiler
on: [push, pull_request]
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
build:
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- {
os: ubuntu-latest,
compiler: gcc,
flags: "-O3 -ftree-vectorize -fopt-info-vec-optimized",
}
- {
os: macOS-latest,
compiler: clang,
flags: "-O3 -Rpass=loop-vectorize",
}
- { os: windows-latest, compiler: cl, flags: "/O2 /Qvec-report:2" }
files:
- ["src/util/sample.cpp", "src/util/sample.h"]
steps:
- name: "Check out repository"
uses: actions/[email protected]
with:
# This is necessary for making `git describe` work.
fetch-depth: 0
- name: "Ensure that all tags are fetched"
# Works around an issue where not the latest tag is not fetched when the
# workflow is triggered by a tag push event.
# Possibly related: actions/checkout#290
run: git fetch origin --force --tags
- name: Set up compiler
run: |
if [ "${{ matrix.config.compiler }}" = "gcc" ]; then
sudo apt-get install -y ${{ matrix.config.compiler }}
fi
- name: Compile and check vectorization
id: check
shell: bash
run: |
for FILE in "${{ matrix.files }}"; do
if [[ "${{ runner.os }}" == "Windows" ]]; then
OUTPUT=$(pwsh -c "& '${{ matrix.compiler }}' ${{matrix.flags}} '$FILE'")
echo "result=$OUTPUT" >> $GITHUB_ENV
else
OUTPUT=$("${{ matrix.compiler }}" ${{matrix.flags}} "$FILE")
echo "result=$OUTPUT" >> $GITHUB_ENV
fi
done
- name: Print vectorization results
id: evaluate
shell: bash
run: |
if [[ "${{ runner.os }}" == "Windows" ]]; then
echo "result=$OUTPUT" >> $GITHUB_ENV
else
echo "result=$OUTPUT" >> $GITHUB_ENV
fi
- name: Print result
run: echo "${{ env.result }}"
report:
needs: build
runs-on: ubuntu-latest
steps:
- name: Create report
run: |
echo "OS, Compiler, Function, Vectorized"
echo "${{ needs.build.outputs.result }}"