From 0283b4ca9a77e036dd4c8f542aff022651abc6cf Mon Sep 17 00:00:00 2001 From: Vivek Trivedi <5340687+trivedivivek@users.noreply.github.com> Date: Fri, 9 May 2025 09:40:43 -0700 Subject: [PATCH] [ET-VK] Return fence after waiting is done. This change returns a fence to fence pool after it has been waited on. Differential Revision: [D74484825](https://our.internmc.facebook.com/intern/diff/D74484825/) [ghstack-poisoned] --- backends/vulkan/runtime/graph/ComputeGraph.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backends/vulkan/runtime/graph/ComputeGraph.cpp b/backends/vulkan/runtime/graph/ComputeGraph.cpp index 31e03b9c7d2..66eb97981fa 100644 --- a/backends/vulkan/runtime/graph/ComputeGraph.cpp +++ b/backends/vulkan/runtime/graph/ComputeGraph.cpp @@ -625,6 +625,7 @@ void ComputeGraph::prepack() const { vkapi::VulkanFence fence = context_->fences().get_fence(); context_->submit_cmd_to_gpu(fence.get_submit_handle(), /*final_use = */ true); fence.wait(); + context_->fences().return_fence(fence); context_->flush(); } @@ -649,6 +650,7 @@ void ComputeGraph::execute() const { vkapi::VulkanFence fence = context_->fences().get_fence(); context_->submit_cmd_to_gpu(fence.get_submit_handle()); fence.wait(); + context_->fences().return_fence(fence); } void ComputeGraph::resize_input(