[Mlir-commits] [mlir] [mlir][Target] Support Fatbin target for static nvptxcompiler (PR #118044)
Zichen Lu
llvmlistbot at llvm.org
Fri Nov 29 01:29:19 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)
----------------
MikaOvO wrote:
There is `RETURN_ON_NVPTXCOMPILER_ERROR` just above this code...
Since `#expr` gives the user more information, is it acceptable to move this macro into the function?
https://github.com/llvm/llvm-project/pull/118044
More information about the Mlir-commits
mailing list