summaryrefslogtreecommitdiff
path: root/llama.cpp
diff options
context:
space:
mode:
authorKarthik Kumar Viswanathan <195178+guilt@users.noreply.github.com>2024-01-14 00:41:44 -0800
committerGitHub <noreply@github.com>2024-01-14 10:41:44 +0200
commitac32902a87147f78d63c931aa8a23dee762660e7 (patch)
tree3a918f7940254aa43bb5dcab54630f6b54c9e6d7 /llama.cpp
parent147b17ac94a24d524e367cda26a9ff6245689f34 (diff)
llama : support WinXP build with MinGW 8.1.0 (#3419)
Diffstat (limited to 'llama.cpp')
-rw-r--r--llama.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llama.cpp b/llama.cpp
index 107b0511..51e9bdae 100644
--- a/llama.cpp
+++ b/llama.cpp
@@ -987,6 +987,7 @@ struct llama_mmap {
}
if (prefetch > 0) {
+#if _WIN32_WINNT >= 0x602
// PrefetchVirtualMemory is only present on Windows 8 and above, so we dynamically load it
BOOL (WINAPI *pPrefetchVirtualMemory) (HANDLE, ULONG_PTR, PWIN32_MEMORY_RANGE_ENTRY, ULONG);
HMODULE hKernel32 = GetModuleHandleW(L"kernel32.dll");
@@ -1004,6 +1005,9 @@ struct llama_mmap {
llama_format_win_err(GetLastError()).c_str());
}
}
+#else
+ throw std::runtime_error("PrefetchVirtualMemory unavailable");
+#endif
}
}