Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3a07714

Browse filesBrowse files
authored
llama : allow using mmap without PrefetchVirtualMemory, apply GGML_WIN_VER to llama.cpp sources (#14013)
1 parent d01d112 commit 3a07714
Copy full SHA for 3a07714

File tree

Expand file treeCollapse file tree

4 files changed

+7
-3
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+7
-3
lines changed

‎CMakeLists.txt

Copy file name to clipboardExpand all lines: CMakeLists.txt
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@ if (NOT TARGET ggml AND NOT LLAMA_USE_SYSTEM_GGML)
159159
# ... otherwise assume ggml is added by a parent CMakeLists.txt
160160
endif()
161161

162+
if (MINGW)
163+
# Target Windows 8 for PrefetchVirtualMemory
164+
add_compile_definitions(_WIN32_WINNT=${GGML_WIN_VER})
165+
endif()
166+
162167
#
163168
# build the library
164169
#

‎ggml/CMakeLists.txt

Copy file name to clipboardExpand all lines: ggml/CMakeLists.txt
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ set(GGML_CPU_ARM_ARCH "" CACHE STRING "ggml: CPU architecture for ARM")
137137
set(GGML_CPU_POWERPC_CPUTYPE "" CACHE STRING "ggml: CPU type for PowerPC")
138138

139139

140-
if (WIN32)
140+
if (MINGW)
141141
set(GGML_WIN_VER "0x602" CACHE STRING "ggml: Windows version")
142142
endif()
143143

‎ggml/src/CMakeLists.txt

Copy file name to clipboardExpand all lines: ggml/src/CMakeLists.txt
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ if (NOT MSVC)
125125
endif()
126126

127127
if (MINGW)
128-
# Target Windows 8 for PrefetchVirtualMemory
129128
add_compile_definitions(_WIN32_WINNT=${GGML_WIN_VER})
130129
endif()
131130

‎src/llama-mmap.cpp

Copy file name to clipboardExpand all lines: src/llama-mmap.cpp
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ struct llama_mmap::impl {
401401
}
402402
}
403403
#else
404-
throw std::runtime_error("PrefetchVirtualMemory unavailable");
404+
LLAMA_LOG_DEBUG("skipping PrefetchVirtualMemory because _WIN32_WINNT < 0x602\n");
405405
#endif
406406
}
407407
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.