Skip to content

Commit

Permalink
Add XeTile Dialect.
Browse files Browse the repository at this point in the history
    add tile mma op
    add coop prefetch op
    add store tile op
    add load tile op
    add init_coop_tile op
    add xetile_init test case
    add xetile init_tile op
    add verifier for load tile op
    add verifier for init tile op

Co-authored-by: Charitha Saumya <[email protected]>
  • Loading branch information
silee2 and charithaintc committed Aug 11, 2023
1 parent e003103 commit 1a94a6a
Show file tree
Hide file tree
Showing 17 changed files with 1,059 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/imex/Dialect/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
add_subdirectory(PTensor)
add_subdirectory(Dist)
add_subdirectory(GPUX)
add_subdirectory(XeTile)
add_subdirectory(XeGPU)
2 changes: 2 additions & 0 deletions include/imex/Dialect/XeTile/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
add_subdirectory(IR)
add_subdirectory(Transforms)
2 changes: 2 additions & 0 deletions include/imex/Dialect/XeTile/IR/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
add_mlir_dialect(XeTileOps xetile)
add_mlir_doc(XeTileOps XeTileDialect Dialects/ -gen-dialect-doc -dialect=xetile)
69 changes: 69 additions & 0 deletions include/imex/Dialect/XeTile/IR/XeTileOps.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
//===- XeTileOps.h - XeTile dialect -------*- C++ -*-===//
//
// Copyright 2022 Intel Corporation
// Part of the IMEX Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
///
/// \file
/// This file declares the XeTile dialect.
///
//===----------------------------------------------------------------------===//

#ifndef _XeTile_OPS_H_INCLUDED_
#define _XeTile_OPS_H_INCLUDED_

#include <mlir/IR/BuiltinTypeInterfaces.h>
#include <mlir/IR/BuiltinTypes.h>
#include <mlir/IR/Dialect.h>
#include <mlir/IR/OpDefinition.h>
#include <mlir/IR/Types.h>
#include <mlir/Interfaces/ShapedOpInterfaces.h>
#include <mlir/Interfaces/SideEffectInterfaces.h>
#include <mlir/Interfaces/ViewLikeInterface.h>
#include <numeric>

namespace imex {
namespace xetile {

class TileType;

} // namespace xetile
} // namespace imex

namespace imex {
namespace xetile {

// TODO : TileBase is similar to that of XeGPU dialect, can we use a common
// TileBase and derive from that?
class TileBase : public mlir::Type, public mlir::ShapedType::Trait<TileBase> {
public:
using Type::Type;

/// Returns the element type of this tensor type.
mlir::Type getElementType() const;

/// Returns if this type is ranked, i.e. it has a known number of dimensions.
bool hasRank() const;

/// Returns the shape of this tensor type.
llvm::ArrayRef<int64_t> getShape() const;

/// Clone this type with the given shape and element type. If the
/// provided shape is `None`, the current shape of the type is used.
TileBase cloneWith(std::optional<llvm::ArrayRef<int64_t>> shape,
mlir::Type elementType) const;
};

} // namespace xetile
} // namespace imex

#include <imex/Dialect/XeTile/IR/XeTileOpsDialect.h.inc>
#define GET_TYPEDEF_CLASSES
#include <imex/Dialect/XeTile/IR/XeTileOpsTypes.h.inc>
#define GET_OP_CLASSES
#include <imex/Dialect/XeTile/IR/XeTileOps.h.inc>

#endif // _XeTile_OPS_H_INCLUDED_
Loading

0 comments on commit 1a94a6a

Please sign in to comment.