diff --git a/paddle/fluid/operators/npu_op_runner.cc b/paddle/fluid/operators/npu_op_runner.cc index ce2359db402f5bae2fad5a7e551e2e9946427679..aa0c4d2dfd274e2d834655429a600326f3af9fe2 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 81d58269513a9f71ca67d7a2269fe3cbb133a319..e178f7fc6e96d8c7cae94ac907ae383c9582303c 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);