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

Christian Ulmann llvmlistbot at llvm.org
Fri Nov 29 03:54:09 PST 2024


================
@@ -473,6 +473,18 @@ NVPTXSerializer::compileToBinary(const std::string &ptxCode) {
     }                                                                          \
   } while (false)
 
+#include <nvFatbin.h>
+
+#define RETURN_ON_NVFATBIN_ERROR(expr)                                         \
+  do {                                                                         \
+    auto result = (expr);                                                      \
+    if (result != nvFatbinResult::NVFATBIN_SUCCESS) {                          \
+      emitError(loc) << llvm::Twine(#expr).concat(" failed with error: ")      \
+                     << nvFatbinGetErrorString(result);                        \
+      return std::nullopt;                                                     \
+    }                                                                          \
+  } while (false)
----------------
Dinistro wrote:

I didn't see that, my bad. I'll delegate this to @grypp as my comments were just side remarks.

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


More information about the Mlir-commits mailing list