From 7fb54278137915ed9d02cdac7f75b770579aac6e Mon Sep 17 00:00:00 2001 From: root Date: Wed, 14 Feb 2024 17:14:26 +0000 Subject: [PATCH] Fix up some boolean vs enum comparisons --- llama.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/llama.cpp b/llama.cpp index 23817e09f..9c3640767 100644 --- a/llama.cpp +++ b/llama.cpp @@ -1034,7 +1034,7 @@ struct llama_mmap { int fd = fileno(file->fp); int flags = MAP_SHARED; // prefetch/readahead impairs performance on NUMA systems - if (numa > 0) { prefetch = 0; } + if (numa) { prefetch = 0; } #ifdef __linux__ // advise the kernel to read the file sequentially (increases readahead) if (posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL)) { @@ -1055,7 +1055,7 @@ struct llama_mmap { strerror(errno)); } } - if (numa > 0) { + if (numa) { // advise the kernel not to use readahead // (because the next page might not belong on the same node) if (posix_madvise(addr, file->size, POSIX_MADV_RANDOM)) { @@ -11172,7 +11172,7 @@ void llama_backend_init(void) { } void llama_numa_init(enum ggml_numa_strategies numa) { - if (numa > 0) { + if (numa != GGML_NUMA_STRATEGY_DISABLED) { ggml_numa_init(numa); } }