Skip to content

Commit

Permalink
Support nested software pipelining (#463)
Browse files Browse the repository at this point in the history
* Support nested software pipelining

* Update test_schedule_software_pipeline.py
  • Loading branch information
vinx13 authored Sep 1, 2021
1 parent ca726d7 commit 8d398d0
Show file tree
Hide file tree
Showing 5 changed files with 417 additions and 479 deletions.
6 changes: 6 additions & 0 deletions include/tvm/tir/transform.h
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,12 @@ TVM_DLL Pass UnifyThreadBinding();
*/
TVM_DLL Pass LowerLogicalLayout();

/*!
* \brief Transform annotated loops into pipelined one that parallelize producers and consumers.
* \return The IR transform pass.
*/
TVM_DLL Pass InjectSoftwarePipeline();

/*!
* \brief Lower logical intrinsics into physical intrinsics.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/tir/transforms/flatten_buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class BufferFlattener : public StmtExprMutator {
for (const auto& annotation : op->annotations) {
const String& ann_key = annotation.first;
const ObjectRef& ann_value = annotation.second;
if (attr::IsPragmaKey(ann_key)) {
if (attr::IsPragmaKey(ann_key) || ann_key == attr::pipeline_scope ) {
body = AttrStmt(op->loop_var, ann_key, Downcast<PrimExpr>(ann_value), std::move(body));
}
}
Expand Down
Loading

0 comments on commit 8d398d0

Please sign in to comment.