-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
90c30ba
commit a6c390b
Showing
7 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
include/ttmlir/Dialect/TTKernel/Pipelines/TTKernelPipelines.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,34 @@ | ||
// SPDX-FileCopyrightText: (c) 2024 Tenstorrent AI ULC | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#ifndef TTMLIR_DIALECT_TTKERNEL_PIPELINES_TTKERNELPIPELINES_H | ||
#define TTMLIR_DIALECT_TTKERNEL_PIPELINES_TTKERNELPIPELINES_H | ||
|
||
#include "mlir/Pass/PassOptions.h" | ||
|
||
namespace mlir::tt::ttkernel { | ||
// Options for the TTKernel to EmitC pipeline. | ||
// | ||
// struct TTIRToTTMetalBackendPipelineOptions | ||
// : public PassPipelineOptions<TTIRToTTMetalBackendPipelineOptions> { | ||
// ListOption<int64_t> meshShape{ | ||
// *this, "mesh-shape", llvm::cl::desc("Set the multi-device mesh | ||
// shape.")}; | ||
|
||
// // Option to provide a system descriptor flatbuffer file to compile | ||
// // against. | ||
// // | ||
// Option<std::string> systemDescPath{ | ||
// *this, "system-desc-path", | ||
// llvm::cl::desc( | ||
// "Pass in a system descriptor flatbuffer to compile against."), | ||
// llvm::cl::init("")}; | ||
// }; | ||
|
||
void createTTKernelToEmitCPipeline(OpPassManager &pm); | ||
|
||
void registerTTKernelPipelines(); | ||
} // namespace mlir::tt::ttkernel | ||
|
||
#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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
add_subdirectory(IR) | ||
add_subdirectory(Pipelines) |
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,11 @@ | ||
add_mlir_dialect_library(MLIRTTKernelPipelines | ||
TTKernelPipelines.cpp | ||
|
||
ADDITIONAL_HEADER_DIRS | ||
${PROJECT_SOURCE_DIR}/include/ttmlir | ||
|
||
LINK_LIBS PUBLIC | ||
MLIRTTIRDialect | ||
MLIRTTKernelDialect | ||
MLIRTransforms | ||
) |
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,30 @@ | ||
// SPDX-FileCopyrightText: (c) 2024 Tenstorrent AI ULC | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#include "ttmlir/Dialect/TTKernel/Pipelines/TTKernelPipelines.h" | ||
|
||
#include "mlir/Pass/PassManager.h" | ||
|
||
#include "ttmlir/Conversion/Passes.h" | ||
#include "ttmlir/Dialect/TTIR/Transforms/Passes.h" | ||
|
||
namespace mlir::tt::ttkernel { | ||
//===----------------------------------------------------------------------===// | ||
// Pipeline implementation. | ||
//===----------------------------------------------------------------------===// | ||
|
||
void createTTKernelToEmitCPipeline(OpPassManager &pm) { | ||
pm.addPass(createConvertTTKernelToEmitC()); | ||
} | ||
|
||
//===----------------------------------------------------------------------===// | ||
// Pipeline registration. | ||
//===----------------------------------------------------------------------===// | ||
|
||
void registerTTKernelPipelines() { | ||
mlir::PassPipelineRegistration<>( | ||
"ttkernel-to-emitc-pipeline", "Pipeline lowering ttkernel to emitc.", | ||
mlir::tt::ttkernel::createTTKernelToEmitCPipeline); | ||
} | ||
} // namespace mlir::tt::ttkernel |
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