From b503d71be428613040410b76f3cdbc3fa7471c0a Mon Sep 17 00:00:00 2001 From: Chris McClanahan Date: Fri, 6 Oct 2023 12:57:26 -0700 Subject: [PATCH] No public description PiperOrigin-RevId: 571412955 --- mediapipe/calculators/tensor/inference_calculator_metal.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mediapipe/calculators/tensor/inference_calculator_metal.cc b/mediapipe/calculators/tensor/inference_calculator_metal.cc index e3451b423..591f0a750 100644 --- a/mediapipe/calculators/tensor/inference_calculator_metal.cc +++ b/mediapipe/calculators/tensor/inference_calculator_metal.cc @@ -191,6 +191,11 @@ absl::Status InferenceCalculatorMetalImpl::Process(CalculatorContext* cc) { [output_encoder endEncoding]; } [command_buffer commit]; + // The below call is found (manual testing) to resolve flickering issues for + // some use cases where multiple Metal calculators are involved. + // TODO: investigate and ensure proper synchronization + // (e.g. fences/barriers/events). + [command_buffer waitUntilScheduled]; kOutTensors(cc).Send(std::move(output_tensors)); return absl::OkStatus();