Skip to content

Commit

Permalink
export isl_pw_multi_aff_get_pw_aff as isl_pw_multi_aff_get_at
Browse files Browse the repository at this point in the history
This is similar to the already exported isl_multi_*_get_at,
the difference being that the multi expression is not
the top level expression of the input.
In theory, there might therefore be some confusion as
to whether isl_pw_multi_aff_get_at extracts a piecewise expression
at a given position in the embedded multi expressions or
a multi expression associated to a given cell
in the piecewise expression.
However, the cells are not ordered, so it seems unlikely
that a function will be publicly exposed that would
identify a cell by a sequence number and even if it does,
then it would have to clarify in the function name that
it is the base expression that is being extracted rather
than the domain of the cell.

Signed-off-by: Sven Verdoolaege <[email protected]>
  • Loading branch information
skimo-openhub committed Jan 13, 2021
1 parent 2389cad commit 84cc1f1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
5 changes: 5 additions & 0 deletions doc/user.pod
Original file line number Diff line number Diff line change
Expand Up @@ -3671,9 +3671,14 @@ position of a piecewise multiple expression can be extracted
using the following function.

#include <isl/aff.h>
__isl_give isl_pw_aff *isl_pw_multi_aff_get_at(
__isl_keep isl_pw_multi_aff *pma, int pos);
__isl_give isl_pw_aff *isl_pw_multi_aff_get_pw_aff(
__isl_keep isl_pw_multi_aff *pma, int pos);

C<isl_pw_multi_aff_get_pw_aff> is an alternative name for
C<isl_pw_multi_aff_get_at>.

These expressions can be replaced using the following function.

#include <isl/aff.h>
Expand Down
3 changes: 3 additions & 0 deletions include/isl/aff.h
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,9 @@ isl_bool isl_pw_multi_aff_involves_param_id(__isl_keep isl_pw_multi_aff *pma,
__isl_keep isl_id *id);
isl_bool isl_pw_multi_aff_involves_dims(__isl_keep isl_pw_multi_aff *pma,
enum isl_dim_type type, unsigned first, unsigned n);
__isl_export
__isl_give isl_pw_aff *isl_pw_multi_aff_get_at(
__isl_keep isl_pw_multi_aff *pma, int pos);
__isl_give isl_pw_aff *isl_pw_multi_aff_get_pw_aff(
__isl_keep isl_pw_multi_aff *pma, int pos);
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_set_pw_aff(
Expand Down
10 changes: 9 additions & 1 deletion isl_aff.c
Original file line number Diff line number Diff line change
Expand Up @@ -6111,7 +6111,7 @@ static

/* Extract an isl_pw_aff corresponding to output dimension "pos" of "pma".
*/
__isl_give isl_pw_aff *isl_pw_multi_aff_get_pw_aff(
__isl_give isl_pw_aff *isl_pw_multi_aff_get_at(
__isl_keep isl_pw_multi_aff *pma, int pos)
{
int i;
Expand Down Expand Up @@ -6141,6 +6141,14 @@ __isl_give isl_pw_aff *isl_pw_multi_aff_get_pw_aff(
return pa;
}

/* This is an alternative name for the function above.
*/
__isl_give isl_pw_aff *isl_pw_multi_aff_get_pw_aff(
__isl_keep isl_pw_multi_aff *pma, int pos)
{
return isl_pw_multi_aff_get_at(pma, pos);
}

/* Return an isl_pw_multi_aff with the given "set" as domain and
* an unnamed zero-dimensional range.
*/
Expand Down

0 comments on commit 84cc1f1

Please sign in to comment.