Skip to content
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

cpp: export space and the set and map empty and universe constructors #11

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

tobiasgrosser
Copy link
Member

Export isl_space as well as empty and universe constructors for isl sets and maps.

@tobiasgrosser tobiasgrosser changed the title Export space and the set and map empty and universe constructors cpp: export space and the set and map empty and universe constructors Aug 3, 2017
@ftynse
Copy link
Member

ftynse commented Aug 3, 2017

CI itself seems broken..

@tobiasgrosser tobiasgrosser force-pushed the export_space_and_set_map_constructors branch 3 times, most recently from 32ffe24 to 422de74 Compare August 3, 2017 21:23
@tobiasgrosser
Copy link
Member Author

CI is fixed. As I did not yet upstream the travis file, I need to include it in each PR.

@tobiasgrosser
Copy link
Member Author

Proposed for inclusion on the isl mailing list.

@tobiasgrosser tobiasgrosser force-pushed the export_space_and_set_map_constructors branch from 422de74 to 571a075 Compare August 18, 2017 19:00
This allows the allocation of an isl_space with a list of parameter ids.
As a result, the space that is returned contains parameter dimensions
that are uniquely identified by an isl_id. Such parameter dimensions are
also called named parameter dimensions.

Named parameter dimensions are uniquely identified by the isl_id they
reference and compare according to the rules for isl_ids (see manual):

  "Identifiers with the same name but different pointer values are
   considered to be distinct. Similarly, identifiers with different names
   but the same pointer value are also considered to be distinct. Equal
   identifiers are represented using the same object."

Also add isl_space_[set|map]_noparams and isl_space_params_alloc_empty
for the allocation of spaces without any parameters. These will later
serve as convenience alternatives in the python/c++ interfaces, where
the allocation functions that allow for the creation of unnamed
parameter dimensions are not available.

Signed-off-by: Tobias Grosser <tobias@grosser.es>
@tobiasgrosser tobiasgrosser force-pushed the export_space_and_set_map_constructors branch from 571a075 to 1d55124 Compare August 18, 2017 19:03
isl_space is a documented isl data type required to programmatically
generate isl objects. It is required to generate empty and universe sets
and maps.

To construct an isl_space this commit also exports three allocators,
isl_[set|map]_alloc_noparams and isl_params_alloc_empty that allow the
convenient construction of spaces without parameter dimensions.

These constructors are exported as unnamed constructors. This is
according to the isl interface guidelines, as each given set of argument
types uniquely identifies the constructed space. Hence, there is no
ambiguity and an unnamed constructor can be used.

Spaces with named parameter dimensions can currently be obtained by using
isl::manage or isl::manage_copy. After isl_id and isl_id_list have been
exposed additional constructors that allow construction with named
parameter lists can be exposed.

Signed-off-by: Tobias Grosser <tobias@grosser.es>
Reviewed-by: Oleksandr Zinenko <oleksandr.zinenko@inria.fr>
These functions are documented and commonly used when constructing isl
sets. Export them for basic sets, sets, and union sets:

            isl_basic_set_empty
            isl_basic_set_universe

            isl_set_empty
            isl_set_universe

            isl_union_set_empty

As the arguments of these constructors do not always uniquely identify
the constructed object, named constructors are introduced according to
the isl interface guidelines.

Signed-off-by: Tobias Grosser <tobias@grosser.es>
Reviewed-by: Oleksandr Zinenko <oleksandr.zinenko@inria.fr>
These functions are documented and commonly used when constructing isl
maps. Export them for basic maps, maps, and union maps:

	isl_basic_map_empty
	isl_basic_map_universe

	isl_map_empty
	isl_map_universe

	isl_union_map_empty

As the arguments of these constructors do not always uniquely identify
the constructed object, named constructors are introduced according to
the isl interface guidelines.

Signed-off-by: Tobias Grosser <tobias@grosser.es>
Reviewed-by: Oleksandr Zinenko <oleksandr.zinenko@inria.fr>
@tobiasgrosser tobiasgrosser force-pushed the export_space_and_set_map_constructors branch from 1d55124 to 7cc58a9 Compare August 18, 2017 19:07
@tobiasgrosser
Copy link
Member Author

Hi @ftynse and others. I updated this pull request with the latest revision.

We now have the following interface:

+       __isl_give isl_space *isl_space_map_alloc_from_id_list(
+               __isl_take isl_id_list *param_ids,
+               unsigned n_in, unsigned n_out);
+       __isl_give isl_space *isl_space_set_alloc_from_id_list(
+               __isl_take isl_id_list *param_ids,
+               unsigned n_set);
+       __isl_give isl_space *isl_space_params_alloc_from_id_list(
+               __isl_take isl_id_list *param_ids);
+       __isl_give isl_space *isl_space_map_alloc_noparams(isl_ctx *ctx);
+       __isl_give isl_space *isl_space_set_alloc_noparams(isl_ctx *ctx);
+       __isl_give isl_space *isl_space_params_alloc_empty(isl_ctx *ctx);

This patch set exposes the constructors without parameter dimensions. For the second set of constructors we need isl_id and isl_id_list to be exported.

Let me know your opinion.

This was referenced Aug 18, 2017
@ftynse
Copy link
Member

ftynse commented Aug 18, 2017

Why the names are isl_type_alloc_from_other_type? isl convention for conversions seems to be isl_type_from_other_type?

The check/enforcement that ids actually have names will happen on the C++ side then?

LGTM otherwise.

@tobiasgrosser
Copy link
Member Author

Why the names are isl_type_alloc_from_other_type? isl convention for conversions seems to be
isl_type_from_other_type?

That's a good point. I will suggest it as an alternative naming.

The check/enforcement that ids actually have names will happen on the C++ side then?.

There is no need. Any isl_id that is constructed is "named". It either must have a name string or a pointer (which implicitly "names") it (at least in isl-speak).

LGTM otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants