Skip to content

Commit ed2e6d4

Browse files
committed
cont : reuse existing CMAKE_OPTS
1 parent e056de6 commit ed2e6d4

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

scripts/compare-commits.sh

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,16 @@ bench_args="${@:3}"
1515

1616
rm -f llama-bench.sqlite > /dev/null
1717

18-
unset cmake_opts
19-
2018
# to test a backend, call the script with the corresponding environment variable (e.g. GGML_CUDA=1 ./scripts/compare-commits.sh ...)
2119
if [ -n "$GGML_CUDA" ]; then
22-
cmake_opts="${cmake_opts} -DGGML_CUDA=ON"
23-
fi
24-
25-
if [ -n "$CMAKE_BUILD_TYPE" ]; then
26-
cmake_opts="${cmake_opts} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
20+
CMAKE_OPTS="${CMAKE_OPTS} -DGGML_CUDA=ON"
2721
fi
2822

2923
dir="build-bench"
3024

3125
function run {
3226
rm -fr ${dir} > /dev/null
33-
cmake -B ${dir} -S . ${cmake_opts} > /dev/null
27+
cmake -B ${dir} -S . ${CMAKE_OPTS} > /dev/null
3428
cmake --build ${dir} -t llama-bench > /dev/null
3529
${dir}/bin/llama-bench -o sql -oe md $bench_args | sqlite3 llama-bench.sqlite
3630
}

0 commit comments

Comments
 (0)