-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into odjuricic/grid-analysis
- Loading branch information
Showing
98 changed files
with
2,566 additions
and
1,150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
include/ttmlir/Conversion/TTKernelToEmitC/TTKernelToEmitC.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// SPDX-FileCopyrightText: (c) 2024 Tenstorrent AI ULC | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#ifndef TTMLIR_CONVERSION_TTKERNELTOEMITC_TTKERNELTOEMITC_H | ||
#define TTMLIR_CONVERSION_TTKERNELTOEMITC_TTKERNELTOEMITC_H | ||
|
||
#include "mlir/IR/BuiltinOps.h" | ||
#include "mlir/Pass/Pass.h" | ||
|
||
#include "ttmlir/Dialect/TTKernel/IR/TTKernelOpsTypes.h" | ||
#include "ttmlir/Dialect/TTMetal/IR/TTMetalOps.h" | ||
#include <llvm/ADT/SmallVector.h> | ||
|
||
namespace mlir::tt { | ||
#define GEN_PASS_DECL_CONVERTTTKERNELTOEMITC | ||
#include "ttmlir/Conversion/Passes.h.inc" | ||
|
||
// Runs a conversion pass to EmitC dialect on a func op containing given | ||
// region's body. Also, it adds boilerplate code such as includes and namespace | ||
// declarations. | ||
LogicalResult | ||
convertTTKernelRegionToEmitC(OpBuilder &builder, Region *region, | ||
const ttkernel::ThreadTypeAttr &threadType); | ||
|
||
// Converts given region to EmitC dialect and translates it to C++ code. | ||
LogicalResult | ||
emitDispatchOpRegionAsCpp(Region *region, std::string ®ionCpp, | ||
const ttkernel::ThreadTypeAttr &threadType); | ||
|
||
// Converts dispatch op's regions to C++ code. | ||
LogicalResult | ||
emitDispatchOpRegionsAsCpp(ttmetal::DispatchOp dispatchOp, | ||
llvm::SmallVector<std::string> &cppStrings); | ||
|
||
} // namespace mlir::tt | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.