Skip to content

Commit 71e6090

Browse files
authored
robust match compiler dump version in cpp extension (#5030)(#5031)
SYCL compiler 2024.2 returns dump version 18.0.0 SYCL compiler 2025.0 returns dump version 19.0.0git So 0git could not convert into int. We have to use a robust method regular match to get 19.0.0 from 19.0.0git in 2025.0.
1 parent a6e1c2d commit 71e6090

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

intel_extension_for_pytorch/xpu/cpp_extension.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -758,15 +758,13 @@ def check_compiler_abi_compatibility(compiler) -> bool:
758758
versionstr = subprocess.check_output(
759759
[compiler, "-dumpfullversion", "-dumpversion"]
760760
)
761-
version = versionstr.decode(*SUBPROCESS_DECODE_ARGS).strip().split(".")
762761
else:
763762
minimum_required_version = MINIMUM_MSVC_VERSION
764-
compiler_info = subprocess.check_output(compiler, stderr=subprocess.STDOUT)
765-
match = re.search(
766-
r"(\d+)\.(\d+)\.(\d+)",
767-
compiler_info.decode(*SUBPROCESS_DECODE_ARGS).strip(),
768-
)
769-
version = ["0", "0", "0"] if match is None else list(match.groups())
763+
versionstr = subprocess.check_output(compiler, stderr=subprocess.STDOUT)
764+
match = re.search(
765+
r"(\d+)\.(\d+)\.(\d+)", versionstr.decode(*SUBPROCESS_DECODE_ARGS).strip()
766+
)
767+
version = ["0", "0", "0"] if match is None else list(match.groups())
770768
except Exception:
771769
_, error, _ = sys.exc_info()
772770
logger.warning(

0 commit comments

Comments
 (0)