Browse Source

vulkan: Call ggml_vk_buffer_write_2d from ggml_vk_buffer_copy (#16793)

This lets the copy to the destination device use the host-visible
vidmem optimization.
Jeff Bolz 2 tháng trước cách đây
mục cha
commit
f549b0007d
1 tập tin đã thay đổi với 1 bổ sung4 xóa
  1. 1 4
      ggml/src/ggml-vulkan/ggml-vulkan.cpp

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

@@ -5652,14 +5652,11 @@ static void ggml_vk_buffer_copy(vk_buffer& dst, size_t dst_offset, vk_buffer& sr
         VK_LOG_DEBUG("ggml_vk_buffer_copy(MULTI_DEVICE, " << size << ")");
         // Copy device to device
         ggml_vk_ensure_sync_staging_buffer(src->device, size);
-        ggml_vk_ensure_sync_staging_buffer(dst->device, size);
 
         // Copy to src staging buffer
         ggml_vk_buffer_copy(src->device->sync_staging, 0, src, src_offset, size);
-        // memcpy to dst staging buffer
-        memcpy(dst->device->sync_staging->ptr, src->device->sync_staging->ptr, size);
         // Copy to dst buffer
-        ggml_vk_buffer_copy(dst, dst_offset, dst->device->sync_staging, 0, size);
+        ggml_vk_buffer_write_2d(dst, dst_offset, src->device->sync_staging->ptr, 0, size, 1);
     }
 }