From a93488839de8442aa8dc07ff2ea96e5963f6fe2e Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Wed, 24 Mar 2021 19:19:53 +0800 Subject: [PATCH] fix compile problem (#31850) --- paddle/fluid/operators/npu_op_runner.cc | 5 +++-- paddle/fluid/operators/npu_op_runner.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/paddle/fluid/operators/npu_op_runner.cc b/paddle/fluid/operators/npu_op_runner.cc index ce2359db40..aa0c4d2dfd 100644 --- a/paddle/fluid/operators/npu_op_runner.cc +++ b/paddle/fluid/operators/npu_op_runner.cc @@ -65,9 +65,10 @@ aclFormat ConvertToNpuFormat(DataLayout layout) { } aclrtStream GetCurrentNPUStream() { - int device_id = GetCurrentNPUDeviceId(); + int device_id = platform::GetCurrentNPUDeviceId(); platform::DeviceContextPool &pool = platform::DeviceContextPool::Instance(); - auto &dev_ctx = *pool.Get(platform::NPUPlace(device_id)); + auto *dev_ctx = static_cast( + pool.Get(platform::NPUPlace(device_id))); return dev_ctx->stream(); } diff --git a/paddle/fluid/operators/npu_op_runner.h b/paddle/fluid/operators/npu_op_runner.h index 81d5826951..e178f7fc6e 100644 --- a/paddle/fluid/operators/npu_op_runner.h +++ b/paddle/fluid/operators/npu_op_runner.h @@ -69,7 +69,7 @@ class NpuOpRunner { std::vector &GetOutputBuffers(); - void Run(aclrtStream stream == nullptrr); + void Run(aclrtStream stream = nullptr); private: aclTensorDesc *CreateTensorDesc(Tensor tensor); -- GitLab