From d953f8a943a6bfa56c7c21056be09b6d7979d9b5 Mon Sep 17 00:00:00 2001 From: chentianyu03 Date: Wed, 21 Jul 2021 15:26:23 +0800 Subject: [PATCH] fix cuda Stream record_event bug (#34285) --- paddle/fluid/pybind/cuda_streams_py.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/paddle/fluid/pybind/cuda_streams_py.cc b/paddle/fluid/pybind/cuda_streams_py.cc index df63239cad..21c6e0a4f2 100644 --- a/paddle/fluid/pybind/cuda_streams_py.cc +++ b/paddle/fluid/pybind/cuda_streams_py.cc @@ -164,8 +164,7 @@ void BindCudaStream(py::module *m_ptr) { [](paddle::platform::stream::CUDAStream &self, paddle::platform::CudaEvent *event) { if (event == nullptr) { - auto event_tmp = paddle::platform::CudaEvent(); - event = &event_tmp; + event = new paddle::platform::CudaEvent(); } event->Record(self); return event; -- GitLab