From 1133103e7d95d6e2107fe791afd7c5b07683a9c7 Mon Sep 17 00:00:00 2001 From: Whitney Tsang Date: Thu, 26 Dec 2024 16:20:21 +0000 Subject: [PATCH] [Intel] Add getThreadsPerWarpForOperand to DpasEncodingAttr Signed-off-by: Whitney Tsang --- .../Dialect/TritonIntelGPU/IR/TritonIntelGPUAttrDefs.td | 1 + .../intel/lib/Dialect/TritonIntelGPU/IR/Dialect.cpp | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/third_party/intel/include/Dialect/TritonIntelGPU/IR/TritonIntelGPUAttrDefs.td b/third_party/intel/include/Dialect/TritonIntelGPU/IR/TritonIntelGPUAttrDefs.td index 01f628ac5f..0290106b0a 100644 --- a/third_party/intel/include/Dialect/TritonIntelGPU/IR/TritonIntelGPUAttrDefs.td +++ b/third_party/intel/include/Dialect/TritonIntelGPU/IR/TritonIntelGPUAttrDefs.td @@ -91,6 +91,7 @@ along the row (resp. col) dimension. SmallVector getSizePerThreadForOperand(int kWidth, OpIdx opIdx) const; SmallVector getElemsPerThreadForOperands(ArrayRef shape, Type eltTy, OpIdx opIdx) const; SmallVector getRepOrderForOperand(OpIdx opIdx) const; + SmallVector getThreadsPerWarpForOperand(int opIdx) const; unsigned getTotalElemsPerThreadForOperand(ArrayRef shape, Type eltTy, int kWidth, OpIdx opIdx) const; // Forwarder functions for casting unsigned to OpIdx. diff --git a/third_party/intel/lib/Dialect/TritonIntelGPU/IR/Dialect.cpp b/third_party/intel/lib/Dialect/TritonIntelGPU/IR/Dialect.cpp index 85eca365f1..26591d8dab 100644 --- a/third_party/intel/lib/Dialect/TritonIntelGPU/IR/Dialect.cpp +++ b/third_party/intel/lib/Dialect/TritonIntelGPU/IR/Dialect.cpp @@ -157,6 +157,13 @@ DpasEncodingAttr::getRepOrderForOperand(OpIdx opIdx) const { return getOrderForDotOperand(unsigned(opIdx), rank, /*kMajor*/ true); } +SmallVector +DpasEncodingAttr::getThreadsPerWarpForOperand(int opIdx) const { + llvm::report_fatal_error( + "getThreadsPerWarpForOperand not implemented for DpasEncodingAttr"); + return {}; +} + SmallVector DpasEncodingAttr::getElemsPerThread(ArrayRef shape, Type eltTy) const { size_t rank = shape.size();