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

Commit d7a03e1

Browse files
author
Sven Verdoolaege
committed
[RFC] use templated isl types makeParameterContext
Templated isl types require the user to specify the domain and range universes of isl objects, allowing the compiler to check whether it makes sense to combine pairs of objects. This RFC only converts isPromotableToRegistersBelow and some related functions to illustrate the effect. The isPromotableToRegistersBelow was already applying operations correctly, so the code itself did not require any changes. However, one variable was reused to store different types of intermediate result and this one had to be split up into several variables because they now have different types.
1 parent b37dbbb commit d7a03e1

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

tc/core/polyhedral/cuda/mapped_scop.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,8 @@ void MappedScop::insertMappingContext() {
866866
auto space = scop.domain().get_space();
867867
auto mappingContext = makeParameterContext(
868868
space, mappingIdsWithSizes.begin(), mappingIdsWithSizes.end());
869-
updateTopLevelContext(scop.scheduleRoot(), mappingContext.from_params());
869+
updateTopLevelContext(
870+
scop.scheduleRoot(), mappingContext.from_params<Prefix>());
870871
}
871872

872873
namespace {

tc/external/detail/islpp.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -303,17 +303,17 @@ isl::multi_val makeMultiVal(isl::space s, const std::vector<T>& vals) {
303303
// 2. each new parameter dimension p(i) is bounded to be in [0, e(i) - 1]
304304
// 3. if e (i) == 0 then no constraint is set on the corresponding id(i)
305305
template <typename IterPair>
306-
inline isl::set makeParameterContext(
307-
isl::space paramSpace,
306+
inline isl::Set<> makeParameterContext(
307+
isl::Space<> paramSpace,
308308
const IterPair begin,
309309
const IterPair end) {
310310
for (auto it = begin; it != end; ++it) {
311311
paramSpace = paramSpace.add_param(it->first);
312312
}
313-
isl::set res(isl::set::universe(paramSpace));
313+
auto res(isl::Set<>::universe(paramSpace));
314314
for (auto it = begin; it != end; ++it) {
315-
isl::aff a(isl::aff::param_on_domain_space(paramSpace, it->first));
316-
res = res & (isl::aff_set(a) >= 0) & (isl::aff_set(a) < it->second);
315+
auto a(isl::AffOn<>::param_on_domain_space(paramSpace, it->first));
316+
res = res & isl::PwAffOn<>(a).nonneg_set() & isl::PwAffOn<>(it->second - a).pos_set();
317317
}
318318
return res;
319319
}

0 commit comments

Comments
 (0)