[PATCH] re-export isl_pw_aff_param_on_domain_id as isl_set_param_pw_aff_on_domain_id

1 view
Skip to first unread message

skim...@kotnet.org

unread,
Sep 16, 2021, 5:58:59 PMSep 16
to isl-dev...@googlegroups.com
From: Sven Verdoolaege <sv...@cerebras.net>

In the bindings, it can be more convenient to use a method
on the domain of the object than
to call a named constructor with the set as argument.

The naming is analogous to isl_space_param_aff_on_domain_id,
which ensures that the new function is also exported
to the templated interface.

Signed-off-by: Sven Verdoolaege <sv...@cerebras.net>
---
doc/user.pod | 5 +++++
include/isl/aff.h | 3 +++
isl_aff.c | 10 ++++++++++
3 files changed, 18 insertions(+)

diff --git a/doc/user.pod b/doc/user.pod
index 36d46f33c3..3c9e7ea727 100644
--- a/doc/user.pod
+++ b/doc/user.pod
@@ -3785,9 +3785,14 @@ then create a piecewise expression over a given domain.
__isl_give isl_pw_aff *isl_pw_aff_param_on_domain_id(
__isl_take isl_set *domain,
__isl_take isl_id *id);
+ __isl_give isl_pw_aff *isl_set_param_pw_aff_on_domain_id(
+ __isl_take isl_set *domain,
+ __isl_take isl_id *id);

C<isl_set_pw_multi_aff_on_domain_multi_val> is an alternative name
for C<isl_pw_multi_aff_multi_val_on_domain>.
+Similarly for C<isl_set_param_pw_aff_on_domain_id> and
+C<isl_pw_aff_param_on_domain_id>.

As a convenience, a piecewise multiple expression can
also be created from a piecewise expression.
diff --git a/include/isl/aff.h b/include/isl/aff.h
index 918116b581..8b0702fcdb 100644
--- a/include/isl/aff.h
+++ b/include/isl/aff.h
@@ -232,6 +232,9 @@ __isl_give isl_pw_aff *isl_pw_aff_val_on_domain(__isl_take isl_set *domain,
__isl_overload
__isl_give isl_pw_aff *isl_pw_aff_param_on_domain_id(
__isl_take isl_set *domain, __isl_take isl_id *id);
+__isl_overload
+__isl_give isl_pw_aff *isl_set_param_pw_aff_on_domain_id(
+ __isl_take isl_set *domain, __isl_take isl_id *id);

__isl_export
__isl_give isl_pw_aff *isl_set_indicator_function(__isl_take isl_set *set);
diff --git a/isl_aff.c b/isl_aff.c
index d2ac33ec37..b3f45a2275 100644
--- a/isl_aff.c
+++ b/isl_aff.c
@@ -7629,6 +7629,16 @@ __isl_give isl_pw_aff *isl_pw_aff_param_on_domain_id(
return isl_pw_aff_alloc(domain, aff);
}

+/* This function performs the same operation as
+ * isl_pw_aff_param_on_domain_id,
+ * but is considered as a function on an isl_set when exported.
+ */
+__isl_give isl_pw_aff *isl_set_param_pw_aff_on_domain_id(
+ __isl_take isl_set *domain, __isl_take isl_id *id)
+{
+ return isl_pw_aff_param_on_domain_id(domain, id);
+}
+
/* Return a multi affine expression that is equal to "mv" on domain
* space "space".
*/
--
2.25.1

Reply all
Reply to author
Forward
0 new messages