mirror of
https://github.com/ROCm/ROCm.git
synced 2026-04-27 03:01:52 -04:00
This PR rebases Triton from LLVM-14 to LLVM-15. Most changes are mechanical, except for the analysis framework changes.
37 lines
868 B
TableGen
37 lines
868 B
TableGen
#ifndef TRITONGPU_DIALECT
|
|
#define TRITONGPU_DIALECT
|
|
|
|
include "mlir/IR/OpBase.td"
|
|
|
|
def TritonGPU_Dialect : Dialect {
|
|
let name = "triton_gpu";
|
|
|
|
let cppNamespace = "::mlir::triton::gpu";
|
|
|
|
let hasOperationAttrVerify = 1;
|
|
|
|
let description = [{
|
|
Triton GPU Dialect.
|
|
}];
|
|
|
|
let dependentDialects = [
|
|
"triton::TritonDialect",
|
|
"mlir::gpu::GPUDialect",
|
|
"tensor::TensorDialect",
|
|
];
|
|
|
|
let extraClassDeclaration = [{
|
|
static std::string getNumWarpsAttrName() { return "triton_gpu.num-warps"; }
|
|
static int getNumWarps(ModuleOp mod) {
|
|
if(!mod->hasAttr("triton_gpu.num-warps"))
|
|
llvm::report_fatal_error(
|
|
"TritonGPU module should contain a triton_gpu.num-warps attribute");
|
|
return mod->getAttr("triton_gpu.num-warps").cast<IntegerAttr>().getInt();
|
|
}
|
|
}];
|
|
|
|
let useDefaultAttributePrinterParser = 1;
|
|
}
|
|
|
|
#endif
|