Unverified Commit dbd01140 by samwyi Committed by GitHub

fix [RUNTIME][VULKAN] vkBuffer released before memory copy command send to GPU (#5388) (#5418)

parent 708fd9a9
......@@ -189,6 +189,10 @@ class VulkanDeviceAPI final : public DeviceAPI {
}
void FreeDataSpace(TVMContext ctx, void* ptr) final {
// Before releasing the vkBuffer, call sync to
// finish all the vulkan commands that reference the buffer.
StreamSync(ctx, nullptr);
const auto& vctx = context(ctx.device_id);
auto* pbuf = static_cast<VulkanBuffer*>(ptr);
vkDestroyBuffer(vctx.device, pbuf->buffer, nullptr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment