mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
Keep XPU compatible with toolchain 2025.2 (#154359)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/154359 Approved by: https://github.com/EikanWang, https://github.com/cyyever
This commit is contained in:
committed by
PyTorch MergeBot
parent
cd9ff41282
commit
3c74a72ea0
@ -133,8 +133,13 @@ inline void initGlobalDevicePoolState() {
|
||||
#else
|
||||
// The default context is utilized for each Intel GPU device, allowing the
|
||||
// retrieval of the context from any GPU device.
|
||||
const auto& platform = gDevicePool.devices[0]->get_platform();
|
||||
gDevicePool.context = std::make_unique<sycl::context>(
|
||||
gDevicePool.devices[0]->get_platform().ext_oneapi_get_default_context());
|
||||
#if SYCL_COMPILER_VERSION >= 20250200
|
||||
platform.khr_get_default_context());
|
||||
#else
|
||||
platform.ext_oneapi_get_default_context());
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user