Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions isl_interface/include/isl/cpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -2963,7 +2963,9 @@ class space {
inline isl::ctx get_ctx() const;
inline std::string to_str() const;

inline isl::space add_named_tuple_id_ui(isl::id tuple_id, unsigned int dim) const;
inline isl::space add_param(isl::id id) const;
inline isl::space add_unnamed_tuple_ui(unsigned int dim) const;
inline isl::space align_params(isl::space dim2) const;
inline bool can_curry() const;
inline bool can_uncurry() const;
Expand All @@ -2983,15 +2985,13 @@ class space {
inline bool is_wrapping() const;
inline isl::space map_from_domain_and_range(isl::space range) const;
inline isl::space map_from_set() const;
inline isl::space named_set_from_params_id(isl::id tuple_id, unsigned int dim) const;
inline isl::space params() const;
inline isl::space product(isl::space right) const;
inline isl::space range() const;
inline isl::space range_map() const;
inline isl::space range_product(isl::space right) const;
inline isl::space set_from_params() const;
inline isl::space uncurry() const;
inline isl::space unnamed_set_from_params(unsigned int dim) const;
inline isl::space unwrap() const;
inline isl::space wrap() const;
typedef isl_space* isl_ptr_t;
Expand Down Expand Up @@ -17694,6 +17694,18 @@ isl::ctx space::get_ctx() const {
return isl::ctx(isl_space_get_ctx(ptr));
}

isl::space space::add_named_tuple_id_ui(isl::id tuple_id, unsigned int dim) const
{
if (!ptr || tuple_id.is_null())
throw isl::exception::create(isl_error_invalid,
"NULL input", __FILE__, __LINE__);
options_scoped_set_on_error saved_on_error(get_ctx(), ISL_ON_ERROR_CONTINUE);
auto res = isl_space_add_named_tuple_id_ui(copy(), tuple_id.release(), dim);
if (!res)
throw exception::create_from_last_error(get_ctx());
return manage(res);
}

isl::space space::add_param(isl::id id) const
{
if (!ptr || id.is_null())
Expand All @@ -17706,6 +17718,18 @@ isl::space space::add_param(isl::id id) const
return manage(res);
}

isl::space space::add_unnamed_tuple_ui(unsigned int dim) const
{
if (!ptr)
throw isl::exception::create(isl_error_invalid,
"NULL input", __FILE__, __LINE__);
options_scoped_set_on_error saved_on_error(get_ctx(), ISL_ON_ERROR_CONTINUE);
auto res = isl_space_add_unnamed_tuple_ui(copy(), dim);
if (!res)
throw exception::create_from_last_error(get_ctx());
return manage(res);
}

isl::space space::align_params(isl::space dim2) const
{
if (!ptr || dim2.is_null())
Expand Down Expand Up @@ -17934,18 +17958,6 @@ isl::space space::map_from_set() const
return manage(res);
}

isl::space space::named_set_from_params_id(isl::id tuple_id, unsigned int dim) const
{
if (!ptr || tuple_id.is_null())
throw isl::exception::create(isl_error_invalid,
"NULL input", __FILE__, __LINE__);
options_scoped_set_on_error saved_on_error(get_ctx(), ISL_ON_ERROR_CONTINUE);
auto res = isl_space_named_set_from_params_id(copy(), tuple_id.release(), dim);
if (!res)
throw exception::create_from_last_error(get_ctx());
return manage(res);
}

isl::space space::params() const
{
if (!ptr)
Expand Down Expand Up @@ -18030,18 +18042,6 @@ isl::space space::uncurry() const
return manage(res);
}

isl::space space::unnamed_set_from_params(unsigned int dim) const
{
if (!ptr)
throw isl::exception::create(isl_error_invalid,
"NULL input", __FILE__, __LINE__);
options_scoped_set_on_error saved_on_error(get_ctx(), ISL_ON_ERROR_CONTINUE);
auto res = isl_space_unnamed_set_from_params(copy(), dim);
if (!res)
throw exception::create_from_last_error(get_ctx());
return manage(res);
}

isl::space space::unwrap() const
{
if (!ptr)
Expand Down
8 changes: 4 additions & 4 deletions tc/core/halide2isl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ isl::map extractAccess(

isl::space paramSpace = domain.paramSpace;
isl::id tensorID(paramSpace.get_ctx(), tensor);
auto tensorSpace = paramSpace.named_set_from_params_id(tensorID, args.size());
auto tensorSpace = paramSpace.add_named_tuple_id_ui(tensorID, args.size());

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

Expand Down Expand Up @@ -367,7 +367,7 @@ static isl::multi_aff mapToOther(
list = list.add(aff);
}
auto domainSpace = iterationDomain.tuple.get_space();
auto space = domainSpace.params().named_set_from_params_id(id, list.size());
auto space = domainSpace.params().add_named_tuple_id_ui(id, list.size());
space = domainSpace.product(space).unwrap();
return isl::multi_aff(space, list);
}
Expand Down Expand Up @@ -525,7 +525,7 @@ isl::schedule makeScheduleTreeHelper(
isl::id id(set.get_ctx(), kStatementLabel + std::to_string(stmtIndex));
statements->emplace(id, op);
auto tupleSpace = isl::space(set.get_ctx(), 0);
tupleSpace = tupleSpace.named_set_from_params_id(id, outer.size());
tupleSpace = tupleSpace.add_named_tuple_id_ui(id, outer.size());
IterationDomain iterationDomain;
iterationDomain.paramSpace = set.get_space();
iterationDomain.tuple = isl::multi_id(tupleSpace, outer);
Expand Down
4 changes: 2 additions & 2 deletions tc/core/polyhedral/cuda/codegen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,8 @@ isl::multi_aff makeMultiAffAccess(
<< "cannot build subscript aff for a scalar";

auto domainSpace = findDomainSpaceById(context);
auto tensorSpace = domainSpace.params().named_set_from_params_id(
tensorId, subscripts.size());
auto tensorSpace =
domainSpace.params().add_named_tuple_id_ui(tensorId, subscripts.size());
auto space = domainSpace.map_from_domain_and_range(tensorSpace);

auto ma = isl::multi_aff::zero(space);
Expand Down
4 changes: 2 additions & 2 deletions tc/core/polyhedral/cuda/mapped_scop.cc
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,8 @@ isl::multi_aff constructThreadToWarp(
const Block& block) {
auto space = isl::space(ctx, 0);
auto id = isl::id(ctx, kBlock);
auto blockSpace = space.named_set_from_params_id(id, block.view.size());
auto warpSpace = space.named_set_from_params_id(isl::id(ctx, kWarp), 1);
auto blockSpace = space.add_named_tuple_id_ui(id, block.view.size());
auto warpSpace = space.add_named_tuple_id_ui(isl::id(ctx, kWarp), 1);
auto aff = isl::aff::zero_on_domain(blockSpace);

auto nThread = block.view.size();
Expand Down
4 changes: 2 additions & 2 deletions tc/core/polyhedral/memory_promotion.cc
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ isl::set tensorElementsSet(const Scop& scop, isl::id tensorId) {
auto halideParameter = scop.findArgument(tensorId).parameter();
auto space = scop.domain().get_space().params();
auto nDim = halideParameter.dimensions();
space = space.named_set_from_params_id(tensorId, nDim);
space = space.add_named_tuple_id_ui(tensorId, nDim);

auto tensorElements = isl::set::universe(space);
auto identity = isl::multi_aff::identity(space.range().map_from_set());
Expand Down Expand Up @@ -449,7 +449,7 @@ isl::multi_aff dropDummyTensorDimensions(
}
}

space = addRange(space, list.size());
space = space.add_unnamed_tuple_ui(list.size());
return isl::multi_aff(space, list);
}

Expand Down
4 changes: 2 additions & 2 deletions tc/core/polyhedral/schedule_transforms.cc
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ detail::ScheduleTree* insertEmptyExtensionAbove(
isl::map labelExtension(ScheduleTree* root, ScheduleTree* tree, isl::id id) {
auto prefix = prefixScheduleMupa(root, tree);
auto scheduleSpace = prefix.get_space();
auto space = scheduleSpace.params().named_set_from_params_id(id, 0);
auto space = scheduleSpace.params().add_named_tuple_id_ui(id, 0);
auto extensionSpace = scheduleSpace.map_from_domain_and_range(space);
return isl::map::universe(extensionSpace);
}
Expand Down Expand Up @@ -551,7 +551,7 @@ bool canOrder(
}
// Create an ordering schedule function first -> 0; second -> 1.
auto ctx = dependences.get_ctx();
auto space = isl::space(ctx, 0).unnamed_set_from_params(1);
auto space = isl::space(ctx, 0).add_unnamed_tuple_ui(1);
auto zero = isl::multi_val::zero(space);
auto one = zero.set_val(0, isl::val::one(ctx));
auto order = isl::multi_union_pw_aff(first, zero);
Expand Down
4 changes: 2 additions & 2 deletions tc/core/polyhedral/schedule_tree_elem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void ScheduleTreeBand::drop(size_t pos, size_t n) {
auto list = mupa_.get_union_pw_aff_list();
auto space = mupa_.get_space().domain();
list = list.drop(pos, n);
space = addRange(space, list.size());
space = space.add_unnamed_tuple_ui(list.size());
mupa_ = isl::multi_union_pw_aff(space, list);

std::copy(
Expand All @@ -92,7 +92,7 @@ void ScheduleTreeBand::drop(size_t pos, size_t n) {
isl::multi_union_pw_aff ScheduleTreeBand::memberRange(size_t first, size_t n)
const {
auto list = mupa_.get_union_pw_aff_list();
auto space = addRange(mupa_.get_space().domain(), n);
auto space = mupa_.get_space().domain().add_unnamed_tuple_ui(n);
auto end = first + n;
TC_CHECK_LE(end, nMember());
list = list.drop(end, nMember() - end);
Expand Down
2 changes: 1 addition & 1 deletion tc/core/polyhedral/schedule_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ isl::multi_union_pw_aff extractDomainToIds(

auto space = isl::space(tree->ctx_, 0);
auto empty = isl::union_set::empty(space);
space = space.named_set_from_params_id(tupleId, ids.size());
space = space.add_named_tuple_id_ui(tupleId, ids.size());
auto zero = isl::multi_val::zero(space);
auto domainToIds = isl::multi_union_pw_aff(empty, zero);

Expand Down
3 changes: 2 additions & 1 deletion tc/core/polyhedral/unroll.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ isl::val boundInstancesAndMarkUnroll(
auto outerMap = prefix;
if (i > 0) {
list = list.drop(i, 1);
auto outer = isl::multi_union_pw_aff(addRange(space, list.size()), list);
auto outerSpace = space.add_unnamed_tuple_ui(list.size());
auto outer = isl::multi_union_pw_aff(outerSpace, list);
outerMap = outerMap.flat_range_product(isl::union_map::from(outer));
}
bound = bound.mul(relativeRange(outerMap, member));
Expand Down
7 changes: 0 additions & 7 deletions tc/external/detail/islpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,13 +281,6 @@ inline bool operator!=(const isl::id& id1, const isl::id& id2) {
// Helper functions
///////////////////////////////////////////////////////////////////////////////

// Given a set space, construct a map space with the input as domain and
// a range of the given size.
inline isl::space addRange(isl::space space, unsigned dim) {
auto range = space.params().unnamed_set_from_params(dim);
return space.map_from_domain_and_range(range);
}

// Given a space and a list of values, this returns the corresponding multi_val.
template <typename T>
isl::multi_val makeMultiVal(isl::space s, const std::vector<T>& vals) {
Expand Down
2 changes: 1 addition & 1 deletion test/test_cuda_mapper_memory_promotion.cc
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def fun(float(N, M) A, float(N, M) B) -> (C) {

EXPECT_EQ(groups.size(), 3u);

isl::space tileSpace = isl::space(ctx, 0).unnamed_set_from_params(2);
isl::space tileSpace = isl::space(ctx, 0).add_unnamed_tuple_ui(2);
auto tileZero = isl::set::from(isl::multi_aff::zero(tileSpace));

// Must have groups for these tensors, in arbitrary order.
Expand Down
2 changes: 1 addition & 1 deletion third-party/islpp
Submodule islpp updated from 2a9f1d to 8f8a21