[llvm] [Offload] Optimistically accept SM architectures (PR #142399)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 2 07:10:59 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-offload
Author: Joseph Huber (jhuber6)
<details>
<summary>Changes</summary>
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
---
Full diff: https://github.com/llvm/llvm-project/pull/142399.diff
1 Files Affected:
- (modified) offload/plugins-nextgen/common/src/Utils/ELF.cpp (+1-2)
``````````diff
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");
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/142399
More information about the llvm-commits
mailing list