10000 Update torch/utils/cpp_extension.py · pytorch/pytorch@c43bf06 · GitHub
[go: up one dir, main page]

Skip to content

Commit c43bf06

Browse files
authored
Update torch/utils/cpp_extension.py
1 parent ea23429 commit c43bf06

File t C7E7 ree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

torch/utils/cpp_extension.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,8 @@ def _join_sycl_home(*paths) -> str:
290290
def _get_sycl_arch_list():
291291
if 'TORCH_XPU_ARCH_LIST' in os.environ:
292292
return os.environ.get('TORCH_XPU_ARCH_LIST')
293+
if not torch.xpu.is_available():
294+
return ""
293295
arch_list = torch.xpu.get_arch_list()
294296
# Dropping dg2-* archs since they lack hardware support for fp64 and require
295297
# special consideration from the user. If needed these platforms can

0 commit comments

Comments
 (0)
0