Skip to content

Commit 62d3317

Browse files
committed
Fix benchmarks code
1 parent d17a6a8 commit 62d3317

File tree

4 files changed

+21
-0
lines changed

4 files changed

+21
-0
lines changed

examples/aobench/benchmark.sh

+9
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ if echo "$FEATURES" | grep -q "ispc"; then
1717
ALGS+=("ispc" "ispc_tasks")
1818
fi
1919

20+
pushd "aobench"
21+
2022
echo "Benchmark 256-bit wide vectors"
2123
RUSTFLAGS="-C target-cpu=native ${RUSTFLAGS}" \
2224
cargo build --release --no-default-features \
@@ -28,6 +30,8 @@ if [[ "${VERIFY}" == "1" ]]; then
2830
--features="${FEATURES},256bit"
2931
fi
3032

33+
popd
34+
3135
if [[ "${NORUN}" == "1" ]]; then
3236
exit 0
3337
fi
@@ -37,10 +41,15 @@ do
3741
hyperfine "target/release/aobench ${WIDTH} ${HEIGHT} --algo ${alg}"
3842
done
3943

44+
pushd "aobench"
45+
4046
echo "Benchmark 128-bit wide vectors"
4147
RUSTFLAGS="-C target-cpu=native ${RUSTFLAGS}" \
4248
cargo build --release --no-default-features \
4349
--features="${FEATURES}"
50+
51+
popd
52+
4453
for alg in "${ALGS[@]}"
4554
do
4655
hyperfine "target/release/aobench ${WIDTH} ${HEIGHT} --algo ${alg}"

examples/mandelbrot/benchmark.sh

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ if echo "$FEATURES" | grep -q "ispc"; then
1515
hash ispc 2>/dev/null || { echo >&2 "ispc is not in PATH."; exit 1; }
1616
fi
1717

18+
pushd "mandelbrot"
19+
1820
RUSTFLAGS="-C target-cpu=native ${RUSTFLAGS}" \
1921
cargo build --release --features="${FEATURES}"
2022

@@ -23,6 +25,8 @@ if [[ "${VERIFY}" == "1" ]]; then
2325
cargo test --release --features="${FEATURES}"
2426
fi
2527

28+
popd
29+
2630
if [[ "${NORUN}" == "1" ]]; then
2731
exit 0
2832
fi

examples/options_pricing/benchmark.sh

+4
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,13 @@ if echo "$FEATURES" | grep -q "ispc"; then
1818
fi
1919

2020

21+
pushd "options_pricing"
22+
2123
RUSTFLAGS="-C target-cpu=native ${RUSTFLAGS}" \
2224
cargo build --release --features="${FEATURES}"
2325

26+
popd
27+
2428
if [[ "${NORUN}" == "1" ]]; then
2529
exit 0
2630
fi

examples/stencil/benchmark.sh

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ if echo "$FEATURES" | grep -q "ispc"; then
1414
algs+=( "3" "4" )
1515
fi
1616

17+
pushd "stencil"
18+
1719
RUSTFLAGS="-C target-cpu=native ${RUSTFLAGS}" \
1820
cargo build --release --no-default-features \
1921
--features="${FEATURES}"
@@ -24,6 +26,8 @@ if [[ "${VERIFY}" == "1" ]]; then
2426
--features="${FEATURES}"
2527
fi
2628

29+
popd
30+
2731
if [[ "${NORUN}" == "1" ]]; then
2832
exit 0
2933
fi

0 commit comments

Comments
 (0)