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
@@ -114,6 +115,15 @@ struct ConvertTritonAMDGPUToLLVM
114115 mod.emitError (" unsupported target: '" ) << this ->arch .getValue () << " '" ;
115116 return signalPassFailure ();
116117 }
118+ llvm::StringRef chipset =
119+ llvm::AMDGPU::getArchNameAMDGCN (targetInfo.getGPUKind ());
120+ llvm::FailureOr<mlir::amdgpu::Chipset> maybeChipset =
121+ mlir::amdgpu::Chipset::parse (chipset);
122+ if (failed (maybeChipset)) {
123+ mlir::emitError (mlir::UnknownLoc::get (&getContext ()),
124+ " Invalid chipset name: " + chipset);
125+ return signalPassFailure ();
126+ }
117127
118128 mlir::LowerToLLVMOptions option (context);
119129 option.overrideIndexBitwidth (32 );
You can’t perform that action at this time.
0 commit comments