Skip to content

Commit 57c3dc6

Browse files
committed
Reduce diff with upstream code
Signed-off-by: Tiotto, Ettore <[email protected]>
1 parent 9c6817d commit 57c3dc6

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

bin/triton-tensor-layout.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,17 @@ static cl::opt<std::string> TensorStr(
8080
//===--------------------------------------------------------------------===//
8181

8282
LogicalResult layoutPrint(RankedTensorType tensorType, raw_ostream &os) {
83+
StringRef dialectName = tensorType.getEncoding().getDialect().getNamespace();
84+
8385
// Dispatch to the corresponding dialect helper function to print the layout.
84-
os << triton::gpu::getLayoutStr(tensorType, UseHWPointOfView);
85-
return success();
86+
if (dialectName == "ttg") {
87+
os << triton::gpu::getLayoutStr(tensorType, UseHWPointOfView);
88+
return success();
89+
}
90+
91+
llvm::errs() << "Unsupported tensor layout attribute: "
92+
<< tensorType.getEncoding() << "\n";
93+
return failure();
8694
}
8795

8896
LogicalResult printLayoutFromFile(MLIRContext *context, StringRef filename,

0 commit comments

Comments
 (0)