masahi commented on a change in pull request #7833:
URL: https://github.com/apache/tvm/pull/7833#discussion_r613741111



##########
File path: src/runtime/vulkan/vulkan.cc
##########
@@ -990,57 +1058,59 @@ Module 
VulkanModuleCreate(std::unordered_map<std::string, VulkanShader> smap,
 
 VulkanThreadEntry* VulkanThreadEntry::ThreadLocal() { return 
VulkanThreadStore::Get(); }
 
-VulkanStagingBuffer* VulkanThreadEntry::StagingBuffer(int device_id, size_t 
size) {
-  if (!staging_buffers_[device_id]) {
-    staging_buffers_[device_id] = std::unique_ptr<VulkanStagingBuffer>(new 
VulkanStagingBuffer());
+VulkanHostVisibleBuffer* GetOrAllocate(

Review comment:
       ok I wrote something but as I wrote, I realized that I didn't really 
understand this issue deeply. I'm not confident what I wrote is accurate, 
please have a look!
   
    My main confusion point is: if we want to make sure that old tasks get 
finished before we delete the buffer they use, shouldn't we sync before we call 
`DeleteHostVisibleBuffer`? Or `DeleteHostVisibleBuffer` itself, that calls 
`vkFreeMemory` etc, is async and it only records the delete/free commands to 
the queue (so sync after `DeleteHostVisibleBuffer` as in this PR makes sense, 
before/after doesn't matter)?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to