[llvm] [Offload] Optimistically accept SM architectures (PR #142399)
Joseph Huber via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 2 07:10:23 PDT 2025
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/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
>From 33b04cd946772a3c298d8a7846063a5e3a0b0ffd Mon Sep 17 00:00:00 2001
From: Joseph Huber <huberjn at outlook.com>
Date: Mon, 2 Jun 2025 09:08:12 -0500
Subject: [PATCH] [Offload] Optimistically accept SM architectures
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
---
offload/plugins-nextgen/common/src/Utils/ELF.cpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/offload/plugins-nextgen/common/src/Utils/ELF.cpp b/offload/plugins-nextgen/common/src/Utils/ELF.cpp
index b33101b99aa10..dfec55432f202 100644
--- a/offload/plugins-nextgen/common/src/Utils/ELF.cpp
+++ b/offload/plugins-nextgen/common/src/Utils/ELF.cpp
@@ -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");
}
More information about the llvm-commits
mailing list