-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·73 lines (68 loc) · 1.12 KB
/
build.sh
File metadata and controls
executable file
·73 lines (68 loc) · 1.12 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
#!/bin/bash
set -euo pipefail
MODE="${1:-release}"
CXX="${CXX:-g++}"
SRC=(main.cpp Mandelbrot.cpp bitmap.cpp)
OUT_DIR="./builds"
mkdir -p "$OUT_DIR"
case "$MODE" in
baseline)
OUT="$OUT_DIR/mandelbrot-baseline"
ARCH="none (scalar, no vectorization)"
CXXFLAGS=(
--std=c++11
-O2
-fno-tree-vectorize
-DNDEBUG
)
;;
sve2)
OUT="$OUT_DIR/mandelbrot-sve2"
ARCH="armv9-a+sve2"
CXXFLAGS=(
--std=c++11
-O3
-march=armv9-a+sve2
-DMANDELBROT_USE_SVE
-DMANDELBROT_USE_SVE2
-ffast-math
-funroll-loops
-flto
-DNDEBUG
)
;;
sve)
OUT="$OUT_DIR/mandelbrot-sve"
ARCH="armv8.4-a+sve"
CXXFLAGS=(
--std=c++11
-O3
-march=armv8.4-a+sve
-DMANDELBROT_USE_SVE
-ffast-math
-funroll-loops
-flto
-DNDEBUG
)
;;
neon)
OUT="$OUT_DIR/mandelbrot-neon"
ARCH="armv8.2-a+crypto"
CXXFLAGS=(
--std=c++11
-O3
-march=armv8.2-a+crypto
-DMANDELBROT_USE_NEON
-ffast-math
-funroll-loops
-flto
-DNDEBUG
)
;;
*)
echo "Usage: $0 [baseline|neon|sve|sve2]"
exit 1
;;
esac
echo "Building $MODE -> $OUT (-march=$ARCH)"
"$CXX" "${CXXFLAGS[@]}" "${SRC[@]}" -o "$OUT"