Skip to content

Commit 6cc363e

Browse files
authored
[CUDA, NVPTX] accept/ignore any -mcmodel arguments. (#70740)
Code model has no impact on NVPTX as we do not produce any object files, but we need to avoid erroring out on the -mcmodel argument passed to the top-level compilation and propagated to all sub-compilations.
1 parent 8116b6d commit 6cc363e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -5743,6 +5743,10 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
57435743
} else if (Triple.getArch() == llvm::Triple::x86_64) {
57445744
Ok = llvm::is_contained({"small", "kernel", "medium", "large", "tiny"},
57455745
CM);
5746+
} else if (Triple.isNVPTX()) {
5747+
// NVPTX does not care about the code model and will accept whatever works
5748+
// for the host.
5749+
Ok = true;
57465750
}
57475751
if (Ok) {
57485752
CmdArgs.push_back(Args.MakeArgString("-mcmodel=" + CM));

0 commit comments

Comments
 (0)