Skip to content

Commit

Permalink
Make OpaqueMMALayout local to IREEGPUAttrs.cpp (iree-org#19342)
Browse files Browse the repository at this point in the history
This implements a TODO from iree-org#19161, which is now unblocked by iree-org#19233.

Signed-off-by: Benoit Jacob <[email protected]>
  • Loading branch information
bjacob authored Dec 3, 2024
1 parent 006c5d8 commit a30a419
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 21 deletions.
15 changes: 10 additions & 5 deletions compiler/src/iree/compiler/Codegen/Dialect/GPU/IR/IREEGPUAttrs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,16 @@ MMASingleSubgroupLayout getSingleSubgroupLayout(MMAIntrinsic intrinsic,
return {};
}

// Struct describing the shape of a MMA operation, but not the detailed layout.
struct OpaqueMmaLayout {
int64_t mSize = 0;
int64_t nSize = 0;
int64_t kSize = 0;
Type aType;
Type bType;
Type cType;
};

template <typename MMAIntrinsicType>
static OpaqueMmaLayout getOpaqueMMALayout(MLIRContext *context,
MMAIntrinsicType intrinsic) {
Expand All @@ -289,11 +299,6 @@ static OpaqueMmaLayout getOpaqueMMALayout(MLIRContext *context,
return o;
}

OpaqueMmaLayout getOpaqueMMALayout(MLIRContext *context,
IREE::GPU::MMAIntrinsic intrinsic) {
return getOpaqueMMALayout<IREE::GPU::MMAIntrinsic>(context, intrinsic);
}

MMASingleSubgroupLayout getSingleSubgroupLayout(MmaInterfaceAttr mmaKind,
MMAFragment fragment) {
if (auto mmaAttr = dyn_cast<MMAAttr>(mmaKind)) {
Expand Down
16 changes: 0 additions & 16 deletions compiler/src/iree/compiler/Codegen/Dialect/GPU/IR/IREEGPUAttrs.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,6 @@ MMASingleSubgroupLayout getSingleSubgroupLayout(VirtualMMAIntrinsic intrinsic,
MMASingleSubgroupLayout getSingleSubgroupLayout(MmaInterfaceAttr mmaKind,
MMAFragment fragment);

// Struct describing the shape of a MMA operation, but not the detailed layout.
// TODO(bjacob): the only user outside of IREEGPUAttrs.cpp is
// LLVMGPU/TransformExtensions, so maybe make that internal again if/when that
// goes away.
struct OpaqueMmaLayout {
int64_t mSize = 0;
int64_t nSize = 0;
int64_t kSize = 0;
Type aType;
Type bType;
Type cType;
};

OpaqueMmaLayout getOpaqueMMALayout(MLIRContext *context,
IREE::GPU::MMAIntrinsic intrinsic);

} // namespace mlir::iree_compiler::IREE::GPU

// clang-format off
Expand Down

0 comments on commit a30a419

Please sign in to comment.