19 namespace polyhedral {
21 template <
typename MappingIdType>
22 inline ScheduleTreeUPtr ScheduleTree::makeMappingFilter(
23 isl::union_set filter,
24 const std::unordered_set<MappingIdType, typename MappingIdType::Hash>&
26 std::vector<ScheduleTreeUPtr>&& children) {
28 std::unordered_set<mapping::MappingId, typename mapping::MappingId::Hash> ids;
29 for (
auto id : mappingIds) {
30 CHECK_EQ(1, mappingIds.count(
id)) <<
"id: " <<
id <<
" mapped != 1 times";
33 isl::ctx ctx(filter.get_ctx());
34 ScheduleTreeUPtr res(
new ScheduleTree(ctx));
35 res->elem_ = std::unique_ptr<ScheduleTreeElemMappingFilter>(
36 new ScheduleTreeElemMappingFilter(filter, ids));
37 res->type_ = ScheduleTreeType::MappingFilter;
38 res->appendChildren(std::move(children));