[Mlir-commits] [mlir] [mlir][Target] Support Fatbin target for static nvptxcompiler (PR #118044)
Zichen Lu
llvmlistbot at llvm.org
Fri Nov 29 01:34:39 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"};
+ }
----------------
MikaOvO wrote:
A better way is to pass options, but to be consistent with another flow, we only consider the `-32` option for now, so I write it this way for now.
> Using const char * in C++ often hints at some design flaw.
I agree with you, but I referred to the [official documentation](https://docs.nvidia.com/cuda/nvfatbin/index.html) here.
https://github.com/llvm/llvm-project/pull/118044
More information about the Mlir-commits
mailing list