Commit 2fc12dcd by tqchen

temp checkin of schedule ops

parent 28876530
...@@ -10,6 +10,23 @@ namespace tvm { ...@@ -10,6 +10,23 @@ namespace tvm {
namespace ir { namespace ir {
namespace { namespace {
Stmt MakeCompute(const ComputeOpNode* op, const Array<Split>& splits) {
Tensor output;
std::vector<Expr> args(op->dim_var.size());
for (size_t i = 0; i < args.size(); ++i) {
args[i] = op->dim_var[i];
}
Array<Expr> values{op->body};
Stmt stmt = Provide::make(output, values, args);
// add splits from ousside most to outsidemost to innermost
return stmt;
}
Stmt MakePipeline(const Schedule& sch, Stmt body) {
return body;
}
// inject the operator's realization on the stmt. // inject the operator's realization on the stmt.
class InjectRealize : public IRMutator { class InjectRealize : public IRMutator {
public: public:
...@@ -18,9 +35,17 @@ class InjectRealize : public IRMutator { ...@@ -18,9 +35,17 @@ class InjectRealize : public IRMutator {
Stmt Mutate(Stmt stmt) final { Stmt Mutate(Stmt stmt) final {
stmt = IRMutator::Mutate(stmt); stmt = IRMutator::Mutate(stmt);
const For* op = stmt.as<For>(); const AttrStmt* op = stmt.as<AttrStmt>();
if (op != nullptr &&
op->type_key == "Split" &&
op->node == sch_->attach_parent) {
return AttrStmt::make(
op->node, op->type_key, op->value,
MakePipeline(sch_, op->body));
} else {
return stmt; return stmt;
} }
}
private: private:
// the operations to be carried // the operations to be carried
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment