Skip to content

Commit 51a0ade

Browse files
committed
Enable the triton-tensor-layout utils for TritonIntelGPU dialect.
1 parent a8ca9e5 commit 51a0ade

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

bin/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ add_llvm_executable(triton-tensor-layout triton-tensor-layout.cpp PARTIAL_SOURCE
102102
target_link_libraries(triton-tensor-layout PRIVATE
103103
TritonGPUIR
104104
TritonNvidiaGPUIR
105+
TritonIntelGPUIR
105106
${triton_libs}
106107
${conversion_libs}
107108
${dialect_libs}

bin/triton-tensor-layout.cpp

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

8282
LogicalResult layoutPrint(RankedTensorType tensorType, raw_ostream &os) {
83-
StringRef dialectName = tensorType.getEncoding().getDialect().getNamespace();
84-
8583
// Dispatch to the corresponding dialect helper function to print the layout.
86-
if (dialectName == "triton_gpu") {
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();
84+
os << triton::gpu::getLayoutStr(tensorType, UseHWPointOfView);
85+
return success();
9486
}
9587

9688
LogicalResult printLayoutFromFile(MLIRContext *context, StringRef filename,

0 commit comments

Comments
 (0)