also enable mmap on Windows

This commit is contained in:
Cebtenzzre 2023-09-23 23:39:28 -04:00
parent 32bc3f4fcf
commit b3a6b28622

View file

@ -5658,9 +5658,9 @@ static void llama_model_quantize_internal(const std::string & fname_inp, const s
nthread = std::thread::hardware_concurrency(); nthread = std::thread::hardware_concurrency();
} }
// mmap consistently increases speed Linux, is inconsistent on macOS // mmap consistently increases speed Linux, and also increases speed on Windows with
// (possibly related to free memory), and has not been tested on Windows. // hot cache. It may cause a slowdown on macOS, possibly related to free memory.
#ifdef __linux__ #if defined(__linux__) || defined(_WIN32)
constexpr bool use_mmap = true; constexpr bool use_mmap = true;
#else #else
constexpr bool use_mmap = false; constexpr bool use_mmap = false;