-
Notifications
You must be signed in to change notification settings - Fork 0
/
simd.sh
145 lines (123 loc) · 3.4 KB
/
simd.sh
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# Check if two arguments are provided
if [ $# -ne 2 ]; then
echo "Usage: $0 <instance_name> <s3-name>"
exit 1
fi
# Assign arguments to variables
instance_name=$1
s3name="$2"
# Create directory and change into it
cd ~ || exit 2
mkdir "$instance_name"
cd "$instance_name" || exit 3
# Store logging
exec > stdout.log 2> stderr.log
# setup
mkfs.ext4 /dev/nvme1n1
mkdir -p /mnt/nvme1n1
mount /dev/nvme1n1 /mnt/nvme1n1
cd /mnt/nvme1n1
dnf install -yq cmake make g++ gtest-devel git meson ninja-build python3-pip
# Googel Bechmarke
wget https://github.com/google/benchmark/archive/refs/tags/v1.8.3.tar.gz
tar -xvf v1.8.3.tar.gz
rm -f v1.8.3.tar.gz
mv benchmark-1.8.3 benchmark
cd benchmark
cmake -E make_directory "build"
# Generate build system files with cmake, and download any dependencies.
cmake -E chdir "build" cmake -DBENCHMARK_DOWNLOAD_DEPENDENCIES=on -DCMAKE_BUILD_TYPE=Release ../
# or, starting with CMake 3.13, use a simpler form:
# cmake -DCMAKE_BUILD_TYPE=Release -S . -B "build"
# Build the library.
cmake --build "build" --config Release
cd build
make install
# Google Highway
cd /mnt/nvme1n1/
wget https://github.com/google/highway/archive/refs/tags/1.1.0.tar.gz
tar -xvf 1.1.0.tar.gz
rm -f 1.1.0.tar.gz
mv highway-1.1.0 highway
cd highway
mkdir -p build && cd build
cmake ..
make -j install
# Libsimdpp
cd /mnt/nvme1n1/
git clone https://github.com/p12tic/libsimdpp.git
cd libsimdpp
mkdir -p build && cd build
cmake ..
make install
# PureSimd sktip for ARM
cd /mnt/nvme1n1/
git clone https://github.com/eatingtomatoes/pure_simd.git
cd pure_simd
mkdir -p build && cd build
# setup virtual env
pip install virtualenv
python3 -m venv env
# activate virtual env
source env/bin/activate
pip install conan==1.64.0
echo '[requires]
benchmark/1.5.5
gtest/1.10.0
[generators]
cmake' > ../conanfile.txt
conan install .. --build=benchmark --build=gtest
cmake ..
make install
deactivate
# VC
cd /mnt/nvme1n1/
wget https://github.com/VcDevel/Vc/archive/refs/tags/1.4.4.tar.gz
tar -xvf 1.4.4.tar.gz
rm -f 1.4.4.tar.gz
mv Vc-1.4.4 Vc
cd Vc
make install
# NSIMD
cd /mnt/nvme1n1/
wget https://github.com/agenium-scale/nsimd/archive/refs/tags/v3.0.1.tar.gz
tar -xvf v3.0.1.tar.gz
rm -f v3.0.1.tar.gz
mv nsimd-3.0.1 nsimd
cd nsimd
mkdir -p build && cd build
cmake ..
make install
# SIMD Everywhere skip ARM
cd /mnt/nvme1n1/
wget https://github.com/simd-everywhere/simde/archive/refs/tags/v0.8.0.tar.gz
tar -xvf v0.8.0.tar.gz
rm -f v0.8.0.tar.gz
mv simde-0.8.0 simde
cd simde
meson build
cd build
ninja install
# main porjecked
cd /mnt/nvme1n1/
git clone https://github.com/felix-ro/SIMD-Library-Evaluation.git
cd SIMD-Library-Evaluation
sed -i '15s/.*/#define BENCHMARK_REPETITIONS 100/' mandelbrot/mandelbrotBenchmark.cpp
make
./mandelBench --benchmark_filter=Scalar > ~/$instance_name/scalar_100.log
./mandelBench --benchmark_filter=Highway > ~/$instance_name/highway_100.log
make clean
make AVX2
mkdir ~/$instance_name/AVX-2
./mandelBench --benchmark_filter=Scalar > ~/$instance_name/AVX-2/scalar_100.log
./mandelBench --benchmark_filter=Highway > ~/$instance_name/AVX-2/highway_100.log
make clean
make AVX512
mkdir ~/$instance_name/AVX-512
./mandelBench --benchmark_filter=Scalar > ~/$instance_name/AVX-512/scalar_100.log
./mandelBench --benchmark_filter=Highway > ~/$instance_name/AVX-512/highway_100.log
# save results to S3
cd ~ || exit 6
aws s3 sync "$instance_name" "s3://$s3name/results/9-simd/$instance_name"
# shutdown
shutdown -h now || shutdown