Skip to content

Commit e056de6

Browse files
committed
scripts : add option to compare commits in Debug
1 parent f13847c commit e056de6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

scripts/compare-commits.sh

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

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

18+
unset cmake_opts
19+
1820
# to test a backend, call the script with the corresponding environment variable (e.g. GGML_CUDA=1 ./scripts/compare-commits.sh ...)
1921
if [ -n "$GGML_CUDA" ]; then
20-
cmake_opts="-DGGML_CUDA=ON"
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}"
2127
fi
2228

2329
dir="build-bench"
2430

2531
function run {
2632
rm -fr ${dir} > /dev/null
27-
cmake -B ${dir} -S . $cmake_opts > /dev/null
33+
cmake -B ${dir} -S . ${cmake_opts} > /dev/null
2834
cmake --build ${dir} -t llama-bench > /dev/null
2935
${dir}/bin/llama-bench -o sql -oe md $bench_args | sqlite3 llama-bench.sqlite
3036
}

0 commit comments

Comments
 (0)