Skip to content

Commit d953f8a

Browse files
fix cuda Stream record_event bug (#34285)
1 parent 32cb0f5 commit d953f8a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

paddle/fluid/pybind/cuda_streams_py.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,7 @@ void BindCudaStream(py::module *m_ptr) {
164164
[](paddle::platform::stream::CUDAStream &self,
165165
paddle::platform::CudaEvent *event) {
166166
if (event == nullptr) {
167-
auto event_tmp = paddle::platform::CudaEvent();
168-
event = &event_tmp;
167+
event = new paddle::platform::CudaEvent();
169168
}
170169
event->Record(self);
171170
return event;

0 commit comments

Comments
 (0)