File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
third_party/amd/lib/TritonAMDGPUToLLVM Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 2626#include " triton/Dialect/Triton/IR/Dialect.h"
2727#include " triton/Dialect/TritonGPU/IR/Dialect.h"
2828#include " triton/Dialect/TritonNvidiaGPU/IR/Dialect.h"
29+ #include " llvm/TargetParser/TargetParser.h"
2930
3031namespace mlir ::triton {
3132#define GEN_PASS_DEF_CONVERTTRITONAMDGPUTOLLVM
@@ -86,6 +87,15 @@ struct ConvertTritonAMDGPUToLLVM
8687 mod.emitError (" unsupported target: '" ) << this ->arch .getValue () << " '" ;
8788 return signalPassFailure ();
8889 }
90+ llvm::StringRef chipset =
91+ llvm::AMDGPU::getArchNameAMDGCN (targetInfo.getGPUKind ());
92+ llvm::FailureOr<mlir::amdgpu::Chipset> maybeChipset =
93+ mlir::amdgpu::Chipset::parse (chipset);
94+ if (failed (maybeChipset)) {
95+ mlir::emitError (mlir::UnknownLoc::get (&getContext ()),
96+ " Invalid chipset name: " + chipset);
97+ return signalPassFailure ();
98+ }
8999
90100 mlir::LowerToLLVMOptions option (context);
91101 option.overrideIndexBitwidth (32 );
You can’t perform that action at this time.
0 commit comments