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
@@ -106,6 +107,15 @@ struct ConvertTritonAMDGPUToLLVM
106107 mod.emitError (" unsupported target: '" ) << this ->arch .getValue () << " '" ;
107108 return signalPassFailure ();
108109 }
110+ llvm::StringRef chipset =
111+ llvm::AMDGPU::getArchNameAMDGCN (targetInfo.getGPUKind ());
112+ llvm::FailureOr<mlir::amdgpu::Chipset> maybeChipset =
113+ mlir::amdgpu::Chipset::parse (chipset);
114+ if (failed (maybeChipset)) {
115+ mlir::emitError (mlir::UnknownLoc::get (&getContext ()),
116+ " Invalid chipset name: " + chipset);
117+ return signalPassFailure ();
118+ }
109119
110120 mlir::LowerToLLVMOptions option (context);
111121 option.overrideIndexBitwidth (32 );
You can’t perform that action at this time.
0 commit comments