Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit f045fc1

Browse files
Merge pull request #561 from facebookresearch/pr/space
bump isl for replacing isl_space_{un}named_set_from_params
2 parents 3dfab71 + 20d3d4f commit f045fc1

File tree

12 files changed

+45
-51
lines changed

12 files changed

+45
-51
lines changed

isl_interface/include/isl/cpp.h

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2963,7 +2963,9 @@ class space {
29632963
inline isl::ctx get_ctx() const;
29642964
inline std::string to_str() const;
29652965

2966+
inline isl::space add_named_tuple_id_ui(isl::id tuple_id, unsigned int dim) const;
29662967
inline isl::space add_param(isl::id id) const;
2968+
inline isl::space add_unnamed_tuple_ui(unsigned int dim) const;
29672969
inline isl::space align_params(isl::space dim2) const;
29682970
inline bool can_curry() const;
29692971
inline bool can_uncurry() const;
@@ -2983,15 +2985,13 @@ class space {
29832985
inline bool is_wrapping() const;
29842986
inline isl::space map_from_domain_and_range(isl::space range) const;
29852987
inline isl::space map_from_set() const;
2986-
inline isl::space named_set_from_params_id(isl::id tuple_id, unsigned int dim) const;
29872988
inline isl::space params() const;
29882989
inline isl::space product(isl::space right) const;
29892990
inline isl::space range() const;
29902991
inline isl::space range_map() const;
29912992
inline isl::space range_product(isl::space right) const;
29922993
inline isl::space set_from_params() const;
29932994
inline isl::space uncurry() const;
2994-
inline isl::space unnamed_set_from_params(unsigned int dim) const;
29952995
inline isl::space unwrap() const;
29962996
inline isl::space wrap() const;
29972997
typedef isl_space* isl_ptr_t;
@@ -17694,6 +17694,18 @@ isl::ctx space::get_ctx() const {
1769417694
return isl::ctx(isl_space_get_ctx(ptr));
1769517695
}
1769617696

17697+
isl::space space::add_named_tuple_id_ui(isl::id tuple_id, unsigned int dim) const
17698+
{
17699+
if (!ptr || tuple_id.is_null())
17700+
throw isl::exception::create(isl_error_invalid,
17701+
"NULL input", __FILE__, __LINE__);
17702+
options_scoped_set_on_error saved_on_error(get_ctx(), ISL_ON_ERROR_CONTINUE);
17703+
auto res = isl_space_add_named_tuple_id_ui(copy(), tuple_id.release(), dim);
17704+
if (!res)
17705+
throw exception::create_from_last_error(get_ctx());
17706+
return manage(res);
17707+
}
17708+
1769717709
isl::space space::add_param(isl::id id) const
1769817710
{
1769917711
if (!ptr || id.is_null())
@@ -17706,6 +17718,18 @@ isl::space space::add_param(isl::id id) const
1770617718
return manage(res);
1770717719
}
1770817720

17721+
isl::space space::add_unnamed_tuple_ui(unsigned int dim) const
17722+
{
17723+
if (!ptr)
17724+
throw isl::exception::create(isl_error_invalid,
17725+
"NULL input", __FILE__, __LINE__);
17726+
options_scoped_set_on_error saved_on_error(get_ctx(), ISL_ON_ERROR_CONTINUE);
17727+
auto res = isl_space_add_unnamed_tuple_ui(copy(), dim);
17728+
if (!res)
17729+
throw exception::create_from_last_error(get_ctx());
17730+
return manage(res);
17731+
}
17732+
1770917733
isl::space space::align_params(isl::space dim2) const
1771017734
{
1771117735
if (!ptr || dim2.is_null())
@@ -17934,18 +17958,6 @@ isl::space space::map_from_set() const
1793417958
return manage(res);
1793517959
}
1793617960

17937-
isl::space space::named_set_from_params_id(isl::id tuple_id, unsigned int dim) const
17938-
{
17939-
if (!ptr || tuple_id.is_null())
17940-
throw isl::exception::create(isl_error_invalid,
17941-
"NULL input", __FILE__, __LINE__);
17942-
options_scoped_set_on_error saved_on_error(get_ctx(), ISL_ON_ERROR_CONTINUE);
17943-
auto res = isl_space_named_set_from_params_id(copy(), tuple_id.release(), dim);
17944-
if (!res)
17945-
throw exception::create_from_last_error(get_ctx());
17946-
return manage(res);
17947-
}
17948-
1794917961
isl::space space::params() const
1795017962
{
1795117963
if (!ptr)
@@ -18030,18 +18042,6 @@ isl::space space::uncurry() const
1803018042
return manage(res);
1803118043
}
1803218044

18033-
isl::space space::unnamed_set_from_params(unsigned int dim) const
18034-
{
18035-
if (!ptr)
18036-
throw isl::exception::create(isl_error_invalid,
18037-
"NULL input", __FILE__, __LINE__);
18038-
options_scoped_set_on_error saved_on_error(get_ctx(), ISL_ON_ERROR_CONTINUE);
18039-
auto res = isl_space_unnamed_set_from_params(copy(), dim);
18040-
if (!res)
18041-
throw exception::create_from_last_error(get_ctx());
18042-
return manage(res);
18043-
}
18044-
1804518045
isl::space space::unwrap() const
1804618046
{
1804718047
if (!ptr)

tc/core/halide2isl.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ isl::map extractAccess(
259259

260260
isl::space paramSpace = domain.paramSpace;
261261
isl::id tensorID(paramSpace.get_ctx(), tensor);
262-
auto tensorSpace = paramSpace.named_set_from_params_id(tensorID, args.size());
262+
auto tensorSpace = paramSpace.add_named_tuple_id_ui(tensorID, args.size());
263263

264264
// Start with a totally unconstrained set - every point in
265265
// the allocation could be accessed.
@@ -290,7 +290,7 @@ isl::map extractAccess(
290290
isl::id tagID(domain.paramSpace.get_ctx(), tag);
291291
accesses->emplace(op, tagID);
292292
isl::space domainSpace = map.get_space().domain();
293-
isl::space tagSpace = domainSpace.params().named_set_from_params_id(tagID, 0);
293+
isl::space tagSpace = domainSpace.params().add_named_tuple_id_ui(tagID, 0);
294294
domainSpace = domainSpace.product(tagSpace).unwrap();
295295
map = map.preimage_domain(isl::multi_aff::domain_map(domainSpace));
296296

@@ -367,7 +367,7 @@ static isl::multi_aff mapToOther(
367367
list = list.add(aff);
368368
}
369369
auto domainSpace = iterationDomain.tuple.get_space();
370-
auto space = domainSpace.params().named_set_from_params_id(id, list.size());
370+
auto space = domainSpace.params().add_named_tuple_id_ui(id, list.size());
371371
space = domainSpace.product(space).unwrap();
372372
return isl::multi_aff(space, list);
373373
}
@@ -525,7 +525,7 @@ isl::schedule makeScheduleTreeHelper(
525525
isl::id id(set.get_ctx(), kStatementLabel + std::to_string(stmtIndex));
526526
statements->emplace(id, op);
527527
auto tupleSpace = isl::space(set.get_ctx(), 0);
528-
tupleSpace = tupleSpace.named_set_from_params_id(id, outer.size());
528+
tupleSpace = tupleSpace.add_named_tuple_id_ui(id, outer.size());
529529
IterationDomain iterationDomain;
530530
iterationDomain.paramSpace = set.get_space();
531531
iterationDomain.tuple = isl::multi_id(tupleSpace, outer);

tc/core/polyhedral/cuda/codegen.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,8 +554,8 @@ isl::multi_aff makeMultiAffAccess(
554554
<< "cannot build subscript aff for a scalar";
555555

556556
auto domainSpace = findDomainSpaceById(context);
557-
auto tensorSpace = domainSpace.params().named_set_from_params_id(
558-
tensorId, subscripts.size());
557+
auto tensorSpace =
558+
domainSpace.params().add_named_tuple_id_ui(tensorId, subscripts.size());
559559
auto space = domainSpace.map_from_domain_and_range(tensorSpace);
560560

561561
auto ma = isl::multi_aff::zero(space);

tc/core/polyhedral/cuda/mapped_scop.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,8 +514,8 @@ isl::multi_aff constructThreadToWarp(
514514
const Block& block) {
515515
auto space = isl::space(ctx, 0);
516516
auto id = isl::id(ctx, kBlock);
517-
auto blockSpace = space.named_set_from_params_id(id, block.view.size());
518-
auto warpSpace = space.named_set_from_params_id(isl::id(ctx, kWarp), 1);
517+
auto blockSpace = space.add_named_tuple_id_ui(id, block.view.size());
518+
auto warpSpace = space.add_named_tuple_id_ui(isl::id(ctx, kWarp), 1);
519519
auto aff = isl::aff::zero_on_domain(blockSpace);
520520

521521
auto nThread = block.view.size();

tc/core/polyhedral/memory_promotion.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ isl::set tensorElementsSet(const Scop& scop, isl::id tensorId) {
411411
auto halideParameter = scop.findArgument(tensorId).parameter();
412412
auto space = scop.domain().get_space().params();
413413
auto nDim = halideParameter.dimensions();
414-
space = space.named_set_from_params_id(tensorId, nDim);
414+
space = space.add_named_tuple_id_ui(tensorId, nDim);
415415

416416
auto tensorElements = isl::set::universe(space);
417417
auto identity = isl::multi_aff::identity(space.range().map_from_set());
@@ -449,7 +449,7 @@ isl::multi_aff dropDummyTensorDimensions(
449449
}
450450
}
451451

452-
space = addRange(space, list.size());
452+
space = space.add_unnamed_tuple_ui(list.size());
453453
return isl::multi_aff(space, list);
454454
}
455455

tc/core/polyhedral/schedule_transforms.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ detail::ScheduleTree* insertEmptyExtensionAbove(
366366
isl::map labelExtension(ScheduleTree* root, ScheduleTree* tree, isl::id id) {
367367
auto prefix = prefixScheduleMupa(root, tree);
368368
auto scheduleSpace = prefix.get_space();
369-
auto space = scheduleSpace.params().named_set_from_params_id(id, 0);
369+
auto space = scheduleSpace.params().add_named_tuple_id_ui(id, 0);
370370
auto extensionSpace = scheduleSpace.map_from_domain_and_range(space);
371371
return isl::map::universe(extensionSpace);
372372
}
@@ -551,7 +551,7 @@ bool canOrder(
551551
}
552552
// Create an ordering schedule function first -> 0; second -> 1.
553553
auto ctx = dependences.get_ctx();
554-
auto space = isl::space(ctx, 0).unnamed_set_from_params(1);
554+
auto space = isl::space(ctx, 0).add_unnamed_tuple_ui(1);
555555
auto zero = isl::multi_val::zero(space);
556556
auto one = zero.set_val(0, isl::val::one(ctx));
557557
auto order = isl::multi_union_pw_aff(first, zero);

tc/core/polyhedral/schedule_tree_elem.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ void ScheduleTreeBand::drop(size_t pos, size_t n) {
7676
auto list = mupa_.get_union_pw_aff_list();
7777
auto space = mupa_.get_space().domain();
7878
list = list.drop(pos, n);
79-
space = addRange(space, list.size());
79+
space = space.add_unnamed_tuple_ui(list.size());
8080
mupa_ = isl::multi_union_pw_aff(space, list);
8181

8282
std::copy(
@@ -92,7 +92,7 @@ void ScheduleTreeBand::drop(size_t pos, size_t n) {
9292
isl::multi_union_pw_aff ScheduleTreeBand::memberRange(size_t first, size_t n)
9393
const {
9494
auto list = mupa_.get_union_pw_aff_list();
95-
auto space = addRange(mupa_.get_space().domain(), n);
95+
auto space = mupa_.get_space().domain().add_unnamed_tuple_ui(n);
9696
auto end = first + n;
9797
TC_CHECK_LE(end, nMember());
9898
list = list.drop(end, nMember() - end);

tc/core/polyhedral/schedule_utils.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ isl::multi_union_pw_aff extractDomainToIds(
280280

281281
auto space = isl::space(tree->ctx_, 0);
282282
auto empty = isl::union_set::empty(space);
283-
space = space.named_set_from_params_id(tupleId, ids.size());
283+
space = space.add_named_tuple_id_ui(tupleId, ids.size());
284284
auto zero = isl::multi_val::zero(space);
285285
auto domainToIds = isl::multi_union_pw_aff(empty, zero);
286286

tc/core/polyhedral/unroll.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ isl::val boundInstancesAndMarkUnroll(
100100
auto outerMap = prefix;
101101
if (i > 0) {
102102
list = list.drop(i, 1);
103-
auto outer = isl::multi_union_pw_aff(addRange(space, list.size()), list);
103+
auto outerSpace = space.add_unnamed_tuple_ui(list.size());
104+
auto outer = isl::multi_union_pw_aff(outerSpace, list);
104105
outerMap = outerMap.flat_range_product(isl::union_map::from(outer));
105106
}
106107
bound = bound.mul(relativeRange(outerMap, member));

tc/external/detail/islpp.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -281,13 +281,6 @@ inline bool operator!=(const isl::id& id1, const isl::id& id2) {
281281
// Helper functions
282282
///////////////////////////////////////////////////////////////////////////////
283283

284-
// Given a set space, construct a map space with the input as domain and
285-
// a range of the given size.
286-
inline isl::space addRange(isl::space space, unsigned dim) {
287-
auto range = space.params().unnamed_set_from_params(dim);
288-
return space.map_from_domain_and_range(range);
289-
}
290-
291284
// Given a space and a list of values, this returns the corresponding multi_val.
292285
template <typename T>
293286
isl::multi_val makeMultiVal(isl::space s, const std::vector<T>& vals) {

0 commit comments

Comments
 (0)