Skip to content

Commit 054f8e7

Browse files
authored
change aclrtSynchronizeDevice to aclrtSynchronizeStream for better performance (#32196)
* change aclrtSynchronizeDevice to aclrtSynchronizeStream for better performace * refine code
1 parent 7039c06 commit 054f8e7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

paddle/fluid/platform/device_context.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,8 @@ NPUDeviceContext::~NPUDeviceContext() {
254254

255255
void NPUDeviceContext::Wait() const {
256256
platform::RecordEvent record_event("NPUDeviceContext/wait");
257-
NPUDeviceGuard guard(place_.device);
258257
VLOG(4) << "NPU context Wait";
259-
PADDLE_ENFORCE_NPU_SUCCESS(aclrtSynchronizeDevice());
258+
stream_->Wait();
260259
}
261260

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

0 commit comments

Comments
 (0)