File tree Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,9 @@ option(LLAMA_MTMD "llama: multimodal support" ${LLAMA_BUILD_TOOLS})
9090option (LLAMA_CURL "llama: use libcurl to download model from an URL" ON )
9191option (LLAMA_LLGUIDANCE "llama-common: include LLGuidance library for structured output in common utils" OFF )
9292
93+ # profiling
94+ option (FORCE_GGML_VK_PERF_LOGGER "Force vk performance logging in ggml" OFF )
95+
9396# Required for relocatable CMake package
9497include (${CMAKE_CURRENT_SOURCE_DIR} /cmake/build -info.cmake)
9598include (${CMAKE_CURRENT_SOURCE_DIR} /cmake/common.cmake)
Original file line number Diff line number Diff line change @@ -92,6 +92,9 @@ if (Vulkan_FOUND)
9292 target_include_directories (ggml-vulkan PRIVATE ${CMAKE_CURRENT_BINARY_DIR} )
9393 target_include_directories (ggml-vulkan PRIVATE "${CMAKE_CURRENT_SOURCE_DIR} /vulkan_cpp_wrapper/include" )
9494
95+ if (FORCE_GGML_VK_PERF_LOGGER)
96+ add_compile_definitions (FORCE_GGML_VK_PERF_LOGGER)
97+ endif ()
9598 # Workaround to the "can't dereference invalidated vector iterator" bug in clang-cl debug build
9699 # Posssibly relevant: https://stackoverflow.com/questions/74748276/visual-studio-no-displays-the-correct-length-of-stdvector
97100 if (MSVC AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
Original file line number Diff line number Diff line change @@ -4486,7 +4486,11 @@ static void ggml_vk_instance_init() {
44864486 vk_instance.pfn_vkCmdInsertDebugUtilsLabelEXT = (PFN_vkCmdInsertDebugUtilsLabelEXT) vkGetInstanceProcAddr(vk_instance.instance, "vkCmdInsertDebugUtilsLabelEXT");
44874487 }
44884488
4489+ #ifndef FORCE_GGML_VK_PERF_LOGGER
44894490 vk_perf_logger_enabled = getenv("GGML_VK_PERF_LOGGER") != nullptr;
4491+ #else
4492+ vk_perf_logger_enabled = true;
4493+ #endif
44904494
44914495 std::vector<vk::PhysicalDevice> devices = vk_instance.instance.enumeratePhysicalDevices();
44924496
You can’t perform that action at this time.
0 commit comments