[Mlir-commits] [mlir] [mlir][Target] Support Fatbin target for static nvptxcompiler (PR #118044)

Christian Ulmann llvmlistbot at llvm.org
Fri Nov 29 01:24:13 PST 2024


================
@@ -538,6 +555,30 @@ NVPTXSerializer::compileToBinaryNVPTX(const std::string &ptxCode) {
   });
 #undef DEBUG_TYPE
   RETURN_ON_NVPTXCOMPILER_ERROR(nvPTXCompilerDestroy(&compiler));
+
+  if (targetOptions.getCompilationTarget() == gpu::CompilationTarget::Fatbin) {
+    const char *cubinOpts[1] = {"-64"};
+    if (useFatbin32) {
+      cubinOpts[0] = {"-32"};
+    }
----------------
Dinistro wrote:

Can this not be done with a ternary operator somehow? Also, is it really necessary to use `const char *` here? Using `const char *` in C++ often hints at some design flaw. 

https://github.com/llvm/llvm-project/pull/118044


More information about the Mlir-commits mailing list