From 10482f55b78382947037142d10e1aff8ea4d7fa1 Mon Sep 17 00:00:00 2001 From: Aaron Teo Date: Thu, 19 Mar 2026 16:08:03 +0800 Subject: [PATCH] tools: fix case where specifying --mmap 0 fails Signed-off-by: Aaron Teo --- tools/llama-bench/llama-bench.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/llama-bench/llama-bench.cpp b/tools/llama-bench/llama-bench.cpp index 4e3ee3a0b8..0b034d0349 100644 --- a/tools/llama-bench/llama-bench.cpp +++ b/tools/llama-bench/llama-bench.cpp @@ -1072,6 +1072,8 @@ static cmd_params parse_cmd_params(int argc, char ** argv) { // if so, we disable mmap to avoid the situation where they see no difference if (params.use_mmap.empty() && !params.use_direct_io.empty()) { params.use_mmap.push_back(false); + } else if (params.use_mmap.size() > 0 && params.use_direct_io.empty()) { + params.use_direct_io.push_back(false); } else if (params.use_mmap.size() != params.use_direct_io.size()) { // if both are specified, they must have the same number of values fprintf(stderr, "error: --mmap and --direct-io must have the same number of values\n");