Skip to content

Commit 367e703

Browse files
Adriankhlteleprint-me
authored andcommitted
vulkan: add workaround for iterator boundary check to fix clang-cl debug build (ggml-org#7426)
1 parent 930c506 commit 367e703

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,12 @@ if (LLAMA_VULKAN)
505505

506506
add_compile_definitions(GGML_USE_VULKAN)
507507

508+
# Workaround to the "can't dereference invalidated vector iterator" bug in clang-cl debug build
509+
# Posssibly relevant: https://stackoverflow.com/questions/74748276/visual-studio-no-displays-the-correct-length-of-stdvector
510+
if (MSVC AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
511+
add_compile_definitions(_ITERATOR_DEBUG_LEVEL=0)
512+
endif()
513+
508514
if (LLAMA_VULKAN_CHECK_RESULTS)
509515
add_compile_definitions(GGML_VULKAN_CHECK_RESULTS)
510516
endif()

0 commit comments

Comments
 (0)