[AOTI] skip ld and objcopy on Windows. (#158545)

Skip `ld` and `objcopy` on Windows. They are not support on Windows.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/158545
Approved by: https://github.com/desertfire
This commit is contained in:
Xu Han 2025-07-17 15:43:20 +00:00 committed by PyTorch MergeBot
parent 2ecf083b72
commit 16b21fa8b2

View File

@ -2171,13 +2171,17 @@ ATTRIBUTE_NO_SANITIZE_ADDRESS\t\n"""
cubins_o = []
asm_files = []
if not _IS_WINDOWS:
ld, objcopy = get_ld_and_objcopy(use_relative_path)
for kernel_name, value in CudaKernelParamCache.cache.items():
if asm_file := value["asm"]:
asm_files.append(asm_file)
cubin_file = value[get_cpp_wrapper_cubin_path_name()]
if config.aot_inductor.emit_multi_arch_kernel and device_type == "cuda":
if (
config.aot_inductor.emit_multi_arch_kernel
and device_type == "cuda"
):
current_arch = _nvcc_arch_as_compile_option()
cmd = (
f"{_cuda_compiler()} -fatbin {asm_file} -o {cubin_file} "