diff --git a/dnn/test/common/opr_proxy.h b/dnn/test/common/opr_proxy.h index 09202a123c58b4a72b63f500274c00ff75f2f92c..f70807fa85d86b6d52170de6fb874adc70704acf 100644 --- a/dnn/test/common/opr_proxy.h +++ b/dnn/test/common/opr_proxy.h @@ -579,6 +579,10 @@ struct OprWeightPreprocessProxyImpl : public OprProxyProfilingBase { } AlgoProxy::exec( opr, tensors, &preprocessed_filter, Base::W.workspace()); + //! as preprocess_tensors will call destructor at end of this function, + //! sync to wait worker consume preprocess_tensors, to prevent use after free + //! case happen + megcoreSynchronize(opr->handle()->megcore_computing_handle()); } //! handle weight preprocess