From b44fb149069b44bb043f4b3374d08676c3f40635 Mon Sep 17 00:00:00 2001 From: "Yu, Guangye" Date: Fri, 17 Oct 2025 10:01:01 +0000 Subject: [PATCH] Remove unused parameter when query extension attribute (#165623) # Motivation This code is no longer needed since SYCL compiler 2025.0. We are now using compiler 2025.2 (two tool uplifts later), so it can be safely removed. Pull Request resolved: https://github.com/pytorch/pytorch/pull/165623 Approved by: https://github.com/EikanWang ghstack dependencies: #165622 --- c10/xpu/XPUFunctions.cpp | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/c10/xpu/XPUFunctions.cpp b/c10/xpu/XPUFunctions.cpp index f8e7305ab63c..26edf295d1fc 100644 --- a/c10/xpu/XPUFunctions.cpp +++ b/c10/xpu/XPUFunctions.cpp @@ -137,16 +137,6 @@ inline void initGlobalDevicePoolState() { } } -#if defined(_WIN32) && SYCL_COMPILER_VERSION < 20250000 - // The default context feature is disabled by default on Windows for SYCL - // compiler versions earlier than 2025.0.0. - std::vector deviceList; - for (auto it = gDevicePool.devices.begin(); it != gDevicePool.devices.end(); - ++it) { - deviceList.push_back(*(*it)); - } - gDevicePool.context = std::make_unique(deviceList); -#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(); @@ -156,7 +146,6 @@ inline void initGlobalDevicePoolState() { #else platform.ext_oneapi_get_default_context()); #endif -#endif } inline void initDevicePoolCallOnce() { @@ -181,9 +170,9 @@ void initDeviceProperties(DeviceProp* device_prop, DeviceIndex device) { #define ASSIGN_DEVICE_ASPECT(member) \ device_prop->has_##member = raw_device.has(sycl::aspect::member); -#define ASSIGN_EXP_CL_ASPECT(member) \ - device_prop->has_##member = raw_device.ext_oneapi_supports_cl_extension( \ - "cl_intel_" #member, &cl_version); +#define ASSIGN_EXP_CL_ASPECT(member) \ + device_prop->has_##member = \ + raw_device.ext_oneapi_supports_cl_extension("cl_intel_" #member); #define ASSIGN_EXP_DEVICE_PROP(property) \ device_prop->property = \ @@ -198,8 +187,6 @@ void initDeviceProperties(DeviceProp* device_prop, DeviceIndex device) { AT_FORALL_XPU_DEVICE_ASPECT(ASSIGN_DEVICE_ASPECT); - // TODO: Remove cl_version since it is unnecessary. - sycl::ext::oneapi::experimental::cl_version cl_version; AT_FORALL_XPU_EXP_CL_ASPECT(ASSIGN_EXP_CL_ASPECT); #if SYCL_COMPILER_VERSION >= 20250000