File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -15,16 +15,22 @@ bench_args="${@:3}"
1515
1616rm -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 ...)
1921if [ -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} "
2127fi
2228
2329dir=" build-bench"
2430
2531function 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}
You can’t perform that action at this time.
0 commit comments