Skip to content

Commit

Permalink
change aclrtSynchronizeDevice to aclrtSynchronizeStream for better pe…
Browse files Browse the repository at this point in the history
…rformance (#32196)

* change aclrtSynchronizeDevice to aclrtSynchronizeStream for better performace

* refine code
  • Loading branch information
zhiqiu authored Apr 12, 2021
1 parent 7039c06 commit 054f8e7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions paddle/fluid/platform/device_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,8 @@ NPUDeviceContext::~NPUDeviceContext() {

void NPUDeviceContext::Wait() const {
platform::RecordEvent record_event("NPUDeviceContext/wait");
NPUDeviceGuard guard(place_.device);
VLOG(4) << "NPU context Wait";
PADDLE_ENFORCE_NPU_SUCCESS(aclrtSynchronizeDevice());
stream_->Wait();
}

aclrtStream NPUDeviceContext::stream() const { return stream_->raw_stream(); }
Expand Down

1 comment on commit 054f8e7

@paddle-bot-old
Copy link

@paddle-bot-old paddle-bot-old bot commented on 054f8e7 Apr 12, 2021

Choose a reason for hiding this comment

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

🕵️ CI failures summary

🔍PR: #32196 Commit ID: 054f8e7 contains failed CI.

Please sign in to comment.