Jelajahi Sumber

Vulkan: Fix device info output format specifiers (#10366)

* Vulkan: Fix device info output format specifiers

* Vulkan: Use zu printf specifier for size_t instead of ld
0cc4m 1 tahun lalu
induk
melakukan
9b75f03cd2
1 mengubah file dengan 4 tambahan dan 5 penghapusan
  1. 4 5
      ggml/src/ggml-vulkan/ggml-vulkan.cpp

+ 4 - 5
ggml/src/ggml-vulkan/ggml-vulkan.cpp

@@ -1764,11 +1764,11 @@ static void ggml_vk_print_gpu_info(size_t idx) {
     fp16 = fp16 && vk12_features.shaderFloat16;
     fp16 = fp16 && vk12_features.shaderFloat16;
 
 
     std::string device_name = props2.properties.deviceName.data();
     std::string device_name = props2.properties.deviceName.data();
-    GGML_LOG_DEBUG("ggml_vulkan: %d = %s (%s) | uma: %d | fp16: %d | warp size: %d\n",
-              idx, device_name.c_str(), driver_props.driverName, uma, fp16, subgroup_size);
+    GGML_LOG_DEBUG("ggml_vulkan: %zu = %s (%s) | uma: %d | fp16: %d | warp size: %zu\n",
+              idx, device_name.c_str(), driver_props.driverName.data(), uma, fp16, subgroup_size);
 
 
     if (props2.properties.deviceType == vk::PhysicalDeviceType::eCpu) {
     if (props2.properties.deviceType == vk::PhysicalDeviceType::eCpu) {
-        std::cerr << "ggml_vulkan: Warning: Device type is CPU. This is probably not the device you want." << std::endl;
+        GGML_LOG_DEBUG("ggml_vulkan: Warning: Device type is CPU. This is probably not the device you want.\n");
     }
     }
 }
 }
 
 
@@ -1937,8 +1937,7 @@ void ggml_vk_instance_init() {
             vk_instance.device_indices.push_back(0);
             vk_instance.device_indices.push_back(0);
         }
         }
     }
     }
-    GGML_LOG_DEBUG("ggml_vulkan: Found %d Vulkan devices:\n", vk_instance.device_indices.size());
-
+    GGML_LOG_DEBUG("ggml_vulkan: Found %zu Vulkan devices:\n", vk_instance.device_indices.size());
 
 
     for (size_t i = 0; i < vk_instance.device_indices.size(); i++) {
     for (size_t i = 0; i < vk_instance.device_indices.size(); i++) {
         ggml_vk_print_gpu_info(i);
         ggml_vk_print_gpu_info(i);