[Offload] Optimistically accept SM architectures (#142399)

Summary:
We try to clamp these to ones known to work, but we should probably just
optimistically accept these. I'd prefer to update the flag check, but
since NVIDIA refuses to publish their ELF format it's too much effort to
reverse engineer.

Fixes: https://github.com/llvm/llvm-project/issues/138532
This commit is contained in:
Joseph Huber
2025-06-02 14:32:05 -05:00
committed by GitHub
parent c005df3c7e
commit eb9ed93fce

View File

@@ -75,8 +75,7 @@ checkMachineImpl(const object::ELFObjectFile<ELFT> &ELFObj, uint16_t EMachine) {
} else if (Header.e_machine == EM_CUDA) {
if (~Header.e_flags & EF_CUDA_64BIT_ADDRESS)
return createError("Invalid CUDA addressing mode");
if ((Header.e_flags & EF_CUDA_SM) < EF_CUDA_SM35 ||
(Header.e_flags & EF_CUDA_SM) > EF_CUDA_SM90)
if ((Header.e_flags & EF_CUDA_SM) < EF_CUDA_SM35)
return createError("Unsupported NVPTX architecture");
}