-
Notifications
You must be signed in to change notification settings - Fork 2
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
Simplify construction of parameteric pw affs #25
base: master
Are you sure you want to change the base?
Simplify construction of parameteric pw affs #25
Conversation
The piplib submodule was removed all the way back isl-0.01-134-g309036cf4f (add copyright statements, Wed Dec 16 19:25:40 2009 +0000), initially by mistake and then properly in isl-0.01-146-gff1ea6be3f (properly remove piplib submodule, Wed Jan 13 09:59:16 2010 +0100). However, it may not get removed completely when moving from an earlier commit to a later one since it may itself leave some untracked files. Just ignore it in that case. Signed-off-by: Sven Verdoolaege <[email protected]>
This function will be reused in the next commit. Signed-off-by: Sven Verdoolaege <[email protected]>
isl_multi_*_from_*_list calls isl_multi_*_set_* on an uninitialized multi expression. If any parameter alignment needs to be performed, then it will fail (without error message) on the uninitialized multi expression while trying to align the missing elements. Perform parameter alignment beforehand. Signed-off-by: Sven Verdoolaege <[email protected]>
This function will be reused in the next commit. Signed-off-by: Sven Verdoolaege <[email protected]>
This makes it more explicit when a multi expression may have missing elements. Signed-off-by: Sven Verdoolaege <[email protected]>
Signed-off-by: Sven Verdoolaege <[email protected]>
…tive The isl AST generator will always produce division of this form. For those created by the user, it's the user's responsibility. Requested-by: Uday Reddy B <[email protected]> Signed-off-by: Sven Verdoolaege <[email protected]>
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.
All commit messages have the same typo "piecewiese". Individual comments are mostly typos and minor suggestions.
doc/user.pod
Outdated
The following convenience functions first create a base expression and | ||
then create a piecewise expression over a universe domain. | ||
The following convenience functions first create a base expression and then | ||
create a piecewise expression over a universe domain of a given (local) space. |
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.
I'm not sure that "over a universe domain of a space" is mathematically correct. "over domain that is a universe set in the given (local) space", leaving that to @skimo-openhub.
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.
Done.
doc/user.pod
Outdated
@@ -3099,6 +3099,14 @@ then create a piecewise expression over a universe domain. | |||
__isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_zero( | |||
__isl_take isl_space *space); | |||
|
|||
The following convenience functions first create a base expression and then | |||
create a piecewise expression over a universe domain of a parameter space | |||
which contains exactly one parameter dimension corresponding to the newly |
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.
"newly introduced" -> "given" ?
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.
Done.
doc/user.pod
Outdated
The following convenience functions first create a base expression and then | ||
create a piecewise expression over a universe domain of a parameter space | ||
which contains exactly one parameter dimension corresponding to the newly | ||
introduced parameter dimensions. |
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.
"dimension" (singular)
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.
I used 'id' instead.
isl_aff.c
Outdated
@@ -216,6 +216,26 @@ __isl_give isl_aff *isl_aff_var_on_domain(__isl_take isl_local_space *ls, | |||
return NULL; | |||
} | |||
|
|||
/* Return a piecewise affine expression defined over a one dimensional |
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.
"one-dimensional"
isl_test.c
Outdated
if (equal < 0) | ||
return isl_stat_error; | ||
if (!equal) | ||
isl_die(ctx, isl_error_unknown, "can not construct pw from id", |
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.
pw_aff
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.
Used 'piecewise aff' to be more clear.
isl_test.c
Outdated
@@ -6048,6 +6075,8 @@ int test_aff(isl_ctx *ctx) | |||
isl_aff *aff; | |||
int zero, equal; | |||
|
|||
if (test_pwa(ctx) < 0) |
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.
I'd call this function test_pa
for consistency with the test_upa
below
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.
Done.
isl_aff.c
Outdated
@@ -236,6 +236,21 @@ __isl_give isl_pw_aff *isl_pw_aff_param_from_id(__isl_take isl_id *id) | |||
return isl_pw_aff_from_aff(aff); | |||
} | |||
|
|||
/* Return a piecewise affine expression defined over a zero dimensional |
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.
"zero-dimensional"
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.
Done.
isl_test.c
Outdated
@@ -4765,10 +4765,12 @@ static isl_bool union_pw_aff_plain_is_equal(__isl_keep isl_union_pw_aff *upa, | |||
|
|||
/* Basic tests on isl_pw_aff. | |||
* | |||
* In particular test the construction of a single-parameter pw_aff from an id. | |||
* In particular test the construction of a single-parameter pw_aff from an id |
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.
or a zero-parameter pw_aff from an isl val
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.
Done.
isl_test.c
Outdated
if (equal < 0) | ||
return isl_stat_error; | ||
if (!equal) | ||
isl_die(ctx, isl_error_unknown, "can not construct pw from val", |
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.
from signed integer
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.
Done.
b7667eb
to
0ba9251
Compare
This function constructs a new piecewise affine expression defined over a one-dimensional parameter space where the parameter dimension identifier is 'id' and the value of the piecewise affine expression is the single parameter dimension over the full universe domain. This function simplifies the construction of parameter expressions. Specifically, there is no need to talk about set dimensions or even set spaces in case parameter only expressions are constructed. Signed-off-by: Tobias Grosser <[email protected]>
This function constructs a new piecewise affine expression defined over a zero-dimensional parameter space. The value of the piecewise affine expression is the constant value passed to this function. This function simplifies the construction of parameter expressions. Specifically, there is no need to talk about set dimensions or even set spaces in case parameter only expressions are constructed. Constant piecewise expressions with zero parameter dimensions can be combined with other parameter-space only dimensions thanks to isl auto-alignment of parameter dimensions. Signed-off-by: Tobias Grosser <[email protected]>
This function constructs a new piecewise affine expression defined over a zero-dimensional parameter space. The value of the piecewise affine expression is the constant value passed to this function. This function simplifies the construction of parameter expressions. Specifically, there is no need to talk about set dimensions or even set spaces in case parameter only expressions are constructed. Constant piecewise expressions with zero parameter dimensions can be combined with other parameter-space only dimensions thanks to isl auto-alignment of parameter dimensions. Signed-off-by: Tobias Grosser <[email protected]>
0ba9251
to
dbfe618
Compare
@ftynse, thanks for the comments. I addressed them all in the latest version of this patch set. I missed a high-level comment from you. Do you think the functions themselves and specifically the function names picked make sense? |
These functions make sense in context of further set/map construction. I don't see other potential uses now, but may be overlooking something. I did think about the names. Existing aff construction functions use the pattern "_on_domain", but here we don't have the domain. Alternative names can be along the lines of " |
OK, so we basically have the following two naming schemes: Conversion-style namingThese functions transform a constant value / id into a constant function over a zero-dimensional space and are consequently conversion style constructors.
Explicit function names (Alex)
I think we should use param/val, as the term 'constant' might refer both to a parameter or an integer value -- basically everything that does not depend on a variable. I also don't think that Explicit function names (Tobias)
|
This pull request proposes three new functions to simplify the generation of pw_aff expressions on parameter spaces. All expressions are generated on a universe domain.