Skip to content

Commit

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

* change aclrtSynchronizeDevice to aclrtSynchronizeStream for better performace

* refine code
  • Loading branch information
zhiqiu committed Apr 15, 2021
1 parent 1ef2b93 commit 62d42f0
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 @@ -255,9 +255,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

0 comments on commit 62d42f0

Please sign in to comment.