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) {
773
773
context_->submit_cmd_to_gpu (fence.get_submit_handle (), final_use);
774
774
fence.wait ();
775
775
context_->fences ().return_fence (fence);
776
-
777
- context_->flush ();
778
776
}
779
777
780
778
void ComputeGraph::prepack () {
@@ -795,7 +793,12 @@ void ComputeGraph::prepack() {
795
793
// Otherwise, just submit the current command buffer for execution and
796
794
// proceed. This results in lower load latency at the cost of higher peak
797
795
// 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
+ }
799
802
staging_nbytes_in_cmd_ = 0 ;
800
803
context_->set_cmd ();
801
804
submitted = true ;
@@ -805,6 +808,7 @@ void ComputeGraph::prepack() {
805
808
i++;
806
809
}
807
810
submit_current_cmd_and_wait (/* final_use=*/ true );
811
+ context_->flush ();
808
812
staging_nbytes_in_cmd_ = 0 ;
809
813
}
810
814
Original file line number Diff line number Diff line change @@ -847,8 +847,7 @@ class ComputeGraph final {
847
847
848
848
/*
849
849
* 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.
852
851
*/
853
852
void submit_current_cmd_and_wait (const bool final_use = false );
854
853
You can’t perform that action at this time.
0 commit comments