未验证 提交 a9348883 编写于 作者: L Leo Chen 提交者: GitHub

fix compile problem (#31850)

上级 0279486b
...@@ -65,9 +65,10 @@ aclFormat ConvertToNpuFormat(DataLayout layout) { ...@@ -65,9 +65,10 @@ aclFormat ConvertToNpuFormat(DataLayout layout) {
} }
aclrtStream GetCurrentNPUStream() { aclrtStream GetCurrentNPUStream() {
int device_id = GetCurrentNPUDeviceId(); int device_id = platform::GetCurrentNPUDeviceId();
platform::DeviceContextPool &pool = platform::DeviceContextPool::Instance(); platform::DeviceContextPool &pool = platform::DeviceContextPool::Instance();
auto &dev_ctx = *pool.Get(platform::NPUPlace(device_id)); auto *dev_ctx = static_cast<platform::NPUDeviceContext *>(
pool.Get(platform::NPUPlace(device_id)));
return dev_ctx->stream(); return dev_ctx->stream();
} }
......
...@@ -69,7 +69,7 @@ class NpuOpRunner { ...@@ -69,7 +69,7 @@ class NpuOpRunner {
std::vector<aclDataBuffer *> &GetOutputBuffers(); std::vector<aclDataBuffer *> &GetOutputBuffers();
void Run(aclrtStream stream == nullptrr); void Run(aclrtStream stream = nullptr);
private: private:
aclTensorDesc *CreateTensorDesc(Tensor tensor); aclTensorDesc *CreateTensorDesc(Tensor tensor);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册