Skip to content

Commit bf54534

Browse files
Revert "add CuddEvent destructor function (#34610)" (#34720)
This reverts commit 090c863.
1 parent e285258 commit bf54534

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

paddle/fluid/platform/event.h

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ class MemEvent {
120120

121121
class CudaEvent {
122122
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
123-
124123
public:
125124
CudaEvent() {
126125
#ifdef PADDLE_WITH_HIP
@@ -130,23 +129,15 @@ class CudaEvent {
130129
#endif
131130
}
132131

133-
explicit CudaEvent(unsigned int flags) : flags_(flags) {
132+
CudaEvent(unsigned int flags) : flags_(flags) {
134133
#ifdef PADDLE_WITH_HIP
135134
hipEventCreateWithFlags(&event_, flags_);
136135
#else
137136
cudaEventCreateWithFlags(&event_, flags_);
138137
#endif
139138
}
140139

141-
~CudaEvent() {
142-
#ifdef PADDLE_WITH_HIP
143-
PADDLE_ENFORCE_CUDA_SUCCESS(hipEventDestroy(event_));
144-
#else
145-
PADDLE_ENFORCE_CUDA_SUCCESS(cudaEventDestroy(event_));
146-
#endif
147-
}
148-
149-
void Record(const paddle::platform::stream::CUDAStream& stream) {
140+
void Record(paddle::platform::stream::CUDAStream& stream) {
150141
#ifdef PADDLE_WITH_HIP
151142
PADDLE_ENFORCE_CUDA_SUCCESS(hipEventRecord(event_, stream.raw_stream()));
152143
#else

0 commit comments

Comments
 (0)