未验证 提交 a043d361 编写于 作者: C csy0225 提交者: GitHub

[XPU] GetExecStream supports XPU (#52466)

上级 35a7ae21
......@@ -502,14 +502,18 @@ void *AnalysisPredictor::GetExecStream() const {
return reinterpret_cast<const phi::GPUContext *>(pool.Get(place_))
->stream();
}
} else {
return nullptr;
}
return nullptr;
#else
#endif
#if defined(PADDLE_WITH_XPU)
if (place_.GetType() == phi::AllocationType::XPU) {
paddle::platform::DeviceContextPool &pool =
paddle::platform::DeviceContextPool::Instance();
return reinterpret_cast<const phi::XPUContext *>(pool.Get(place_))
->stream();
}
#endif
// TODO(inference): Support other backends.
return nullptr;
#endif
}
const void *AnalysisPredictor::GetDeviceContexts() const {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册