-
Notifications
You must be signed in to change notification settings - Fork 189
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
Bound #521
base: master
Are you sure you want to change the base?
Bound #521
Changes from 22 commits
d4d492b
b765721
cbc872c
897bb04
d6c5bb7
f2e5cfb
aa1a114
fc86897
e74bf06
9ae9908
ba95326
2cf16af
6dc9ad4
9ec3e6e
79f2d47
ba621eb
12af135
27288ff
a52bb4e
57dd389
c27ef8a
e21812b
e258dca
af4ff8f
b437560
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 |
---|---|---|
|
@@ -601,6 +601,8 @@ class IndexStmt : public util::IntrusivePtr<const IndexStmtNode> { | |
/// variable, a \textit{tail strategy} is employed such as emitting a variable | ||
/// sized loop that handles remaining iterations. | ||
/// Preconditions: splitFactor is a positive nonzero integer | ||
IndexStmt splitUpDown(IndexVar i, IndexVar i1, IndexVar i2, bool split_up, size_t splitFactor) const; | ||
|
||
IndexStmt split(IndexVar i, IndexVar i1, IndexVar i2, size_t splitFactor) const; // TODO: TailStrategy | ||
|
||
/// The divide transformation splits one index variable into | ||
|
@@ -736,8 +738,13 @@ class IndexStmt : public util::IntrusivePtr<const IndexStmtNode> { | |
/// Preconditions: | ||
/// The precondition for bound is that the computation bounds supplied are | ||
/// correct given the inputs that this code will be run on. | ||
// IndexStmt bound(IndexVar i, IndexVar i1, size_t bound, BoundType bound_type) const; | ||
|
||
IndexStmt bound(IndexVar i, IndexVar i1, size_t bound, BoundType bound_type) const; | ||
|
||
|
||
IndexStmt bound(IndexVar i, size_t bound, BoundType bound_type) const; | ||
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. You can probably remove the old bound call and replace all users with the new method (I don't think we care that much about backwards compat, and bound doesn't have that many users). |
||
|
||
/// The unroll primitive unrolls the corresponding loop by a statically-known | ||
/// integer number of iterations | ||
/// Preconditions: unrollFactor is a positive nonzero integer | ||
|
@@ -1031,6 +1038,18 @@ class IndexVar : public IndexExpr, public IndexVarInterface { | |
/// Returns the name of the index variable. | ||
std::string getName() const; | ||
|
||
size_t& getBound() const; | ||
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. Why are these things attached to this index variable instead of tagged to a particular for loop? 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. Mapping a for all to an index var's bound is not possible since adding schedules replaces the occurrence of the index var from the stmt in certain cases. Instead, in the updated pull request, we tag this information to a suchThatNode, adding a map that relates the bounded variable, bound size and bound type. |
||
|
||
const BoundType& getBoundType() const; | ||
|
||
void setBoundType(BoundType boundType); | ||
|
||
void setBound(size_t bound); | ||
|
||
void bound(size_t bound, BoundType boundType); | ||
|
||
bool isBound(); | ||
|
||
// Need these to overshadow the comparisons in for the IndexExpr instrusive pointer | ||
friend bool operator==(const IndexVar&, const IndexVar&); | ||
friend bool operator<(const IndexVar&, const IndexVar&); | ||
|
@@ -1055,6 +1074,9 @@ class IndexVar : public IndexExpr, public IndexVarInterface { | |
|
||
struct IndexVar::Content { | ||
std::string name; | ||
size_t bound; | ||
taco::BoundType boundType; | ||
bool isbound; | ||
}; | ||
|
||
struct WindowedIndexVar::Content { | ||
|
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.
It feels like this shouldn't be a separate API call, but instead an additional argument to the existing split call that takes in an enum, with an enum that has a default value.
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.
Removed: it is not relevant to this pull request