File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
backends/vulkan/runtime/graph Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -773,8 +773,6 @@ void ComputeGraph::submit_current_cmd_and_wait(const bool final_use) {
773773 context_->submit_cmd_to_gpu (fence.get_submit_handle (), final_use);
774774 fence.wait ();
775775 context_->fences ().return_fence (fence);
776-
777- context_->flush ();
778776}
779777
780778void ComputeGraph::prepack () {
@@ -795,7 +793,12 @@ void ComputeGraph::prepack() {
795793 // Otherwise, just submit the current command buffer for execution and
796794 // proceed. This results in lower load latency at the cost of higher peak
797795 // memory usage.
798- reduce_peak_memory ? submit_current_cmd_and_wait () : submit_current_cmd ();
796+ if (reduce_peak_memory) {
797+ submit_current_cmd_and_wait ();
798+ context_->flush ();
799+ } else {
800+ submit_current_cmd ();
801+ }
799802 staging_nbytes_in_cmd_ = 0 ;
800803 context_->set_cmd ();
801804 submitted = true ;
@@ -805,6 +808,7 @@ void ComputeGraph::prepack() {
805808 i++;
806809 }
807810 submit_current_cmd_and_wait (/* final_use=*/ true );
811+ context_->flush ();
808812 staging_nbytes_in_cmd_ = 0 ;
809813}
810814
Original file line number Diff line number Diff line change @@ -847,8 +847,7 @@ class ComputeGraph final {
847847
848848 /*
849849 * Submits the current command buffer in the Context to the GPU for execution,
850- * and wait for it to complete before returning. This function will also flush
851- * the Context after execution.
850+ * and wait for it to complete before returning.
852851 */
853852 void submit_current_cmd_and_wait (const bool final_use = false );
854853
You can’t perform that action at this time.
0 commit comments