Skip to content

Commit

Permalink
Revert "add CuddEvent destructor function (#34610)"
Browse files Browse the repository at this point in the history
This reverts commit 090c863.
  • Loading branch information
MingMingShangTian authored Aug 9, 2021
1 parent 8009257 commit 107eb2c
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions paddle/fluid/platform/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ class MemEvent {

class CudaEvent {
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)

public:
CudaEvent() {
#ifdef PADDLE_WITH_HIP
Expand All @@ -130,23 +129,15 @@ class CudaEvent {
#endif
}

explicit CudaEvent(unsigned int flags) : flags_(flags) {
CudaEvent(unsigned int flags) : flags_(flags) {
#ifdef PADDLE_WITH_HIP
hipEventCreateWithFlags(&event_, flags_);
#else
cudaEventCreateWithFlags(&event_, flags_);
#endif
}

~CudaEvent() {
#ifdef PADDLE_WITH_HIP
PADDLE_ENFORCE_CUDA_SUCCESS(hipEventDestroy(event_));
#else
PADDLE_ENFORCE_CUDA_SUCCESS(cudaEventDestroy(event_));
#endif
}

void Record(const paddle::platform::stream::CUDAStream& stream) {
void Record(paddle::platform::stream::CUDAStream& stream) {
#ifdef PADDLE_WITH_HIP
PADDLE_ENFORCE_CUDA_SUCCESS(hipEventRecord(event_, stream.raw_stream()));
#else
Expand Down

1 comment on commit 107eb2c

@paddle-bot-old
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulation! Your pull request passed all required CI. You could ask reviewer(s) to approve and merge. 🎉

Please sign in to comment.