summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authork.h.lai <adrian.k.h.lai@outlook.com>2024-05-22 20:53:21 +0800
committerGitHub <noreply@github.com>2024-05-22 14:53:21 +0200
commitfcda1128bc5f8eb7e1811708fe9d9867b9aec815 (patch)
tree9269c5b3e64374d694226913f61a19638fba04e9
parent03d8900ebe062355e26a562379daee5f17ea099f (diff)
vulkan: add workaround for iterator boundary check to fix clang-cl debug build (#7426)
-rw-r--r--CMakeLists.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9cc60039..c09d834f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -505,6 +505,12 @@ if (LLAMA_VULKAN)
add_compile_definitions(GGML_USE_VULKAN)
+ # Workaround to the "can't dereference invalidated vector iterator" bug in clang-cl debug build
+ # Posssibly relevant: https://stackoverflow.com/questions/74748276/visual-studio-no-displays-the-correct-length-of-stdvector
+ if (MSVC AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+ add_compile_definitions(_ITERATOR_DEBUG_LEVEL=0)
+ endif()
+
if (LLAMA_VULKAN_CHECK_RESULTS)
add_compile_definitions(GGML_VULKAN_CHECK_RESULTS)
endif()