-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[LANG] Generalize compute to tensor region #1476
Changes from 1 commit
da6a07c
97b3f65
753cb03
cf0134d
81ffb68
58aff04
2cd02e0
714e6f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -186,12 +186,14 @@ class TensorComputeOpNode : public OperationNode { | |
public: | ||
Array<IterVar> axis; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. again, document each field |
||
|
||
Array<IterVar> out_axis; | ||
// Array<IterVar> out_axis; | ||
|
||
Array<IterVar> tensor_axis; | ||
// Array<IterVar> tensor_axis; | ||
|
||
Array<IterVar> reduce_axis; | ||
|
||
int sch_ndim; | ||
|
||
Array<Tensor> inputs; | ||
|
||
Array<Region> input_regions; | ||
|
@@ -231,23 +233,18 @@ class TensorComputeOpNode : public OperationNode { | |
v->Visit("name", &name); | ||
v->Visit("tag", &tag); | ||
v->Visit("axis", &axis); | ||
v->Visit("out_axis", &out_axis); | ||
v->Visit("tensor_axis", &tensor_axis); | ||
v->Visit("reduce_axis", &reduce_axis); | ||
v->Visit("sch_ndim", &sch_ndim); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. schedulable_ndim is fine, |
||
v->Visit("inputs", &inputs); | ||
v->Visit("input_regions", &input_regions); | ||
v->Visit("intrin", &intrin); | ||
} | ||
|
||
static Operation make(std::string name, | ||
std::string tag, | ||
Array<IterVar> out_axis, | ||
Array<IterVar> tensor_axis, | ||
TensorIntrinCall intrin_call); | ||
|
||
static Operation make(std::string name, | ||
std::string tag, | ||
Array<IterVar> out_axis, | ||
Array<IterVar> tensor_axis, | ||
Array<IterVar> axis, | ||
Array<IterVar> reduce_axis, | ||
int sch_ndim, | ||
Array<Tensor> tensors, | ||
Array<Region> regions, | ||
TensorIntrin intrin); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,6 +111,7 @@ def intrin_func(ins, outs): | |
|
||
s = tvm.create_schedule(C.op) | ||
stmt = tvm.lower(s, [A, B, C], simple_mode=True) | ||
print(stmt) | ||
assert isinstance(stmt.body.body, tvm.stmt.Evaluate) | ||
|
||
def test_tensor_compute2(): | ||
|
@@ -154,6 +155,7 @@ def intrin_func(ins, outs): | |
|
||
s = tvm.create_schedule(C.op) | ||
stmt = tvm.lower(s, [A, B, C], simple_mode=True) | ||
print(stmt) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove print |
||
assert isinstance(stmt.body.body.body.first, tvm.stmt.Evaluate) | ||
assert isinstance(stmt.body.body.body.rest.body, tvm.stmt.Evaluate) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
document the fields