From b2f036c0f138414dedc987446f1d9d802f920275 Mon Sep 17 00:00:00 2001 From: miyan <1138989048@qq.com> Date: Mon, 12 Oct 2026 12:51:24 +0800 Subject: [PATCH] vulkan: fix buffer logging on 32-bit platforms after source split (#30326) Move the vk::Buffer stream operator to the shared header so it is visible to ggml-vulkan-debug.cpp. --- ggml/src/ggml-vulkan/ggml-vulkan-common.h | 4 ++++ ggml/src/ggml-vulkan/ggml-vulkan.cpp | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ggml/src/ggml-vulkan/ggml-vulkan-common.h b/ggml/src/ggml-vulkan/ggml-vulkan-common.h index a642c5516..134078bd2 100644 --- a/ggml/src/ggml-vulkan/ggml-vulkan-common.h +++ b/ggml/src/ggml-vulkan/ggml-vulkan-common.h @@ -1,6 +1,10 @@ #pragma once #include "ggml-vulkan-push-constants.h" +inline std::ostream & operator<<(std::ostream & os, vk::Buffer buffer) { + return os << static_cast(buffer); +} + // shared globals extern ggml_backend_buffer_type_i ggml_backend_vk_buffer_type_interface; extern bool vk_memory_logger_enabled; diff --git a/ggml/src/ggml-vulkan/ggml-vulkan.cpp b/ggml/src/ggml-vulkan/ggml-vulkan.cpp index 80f4d3acf..05c63b64e 100644 --- a/ggml/src/ggml-vulkan/ggml-vulkan.cpp +++ b/ggml/src/ggml-vulkan/ggml-vulkan.cpp @@ -1,10 +1,5 @@ #include "ggml-vulkan-common.h" -namespace { -inline std::ostream & operator<<(std::ostream & os, vk::Buffer buffer) { - return os << static_cast(buffer); -} -} static vk_device_architecture get_device_architecture(const vk::PhysicalDevice& device) { vk::PhysicalDeviceProperties props = device.getProperties();