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

Commit 4cbab8c

Browse files
author
Sven Verdoolaege
committed
[RFC] use templated isl types Scop::context()
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 90cf2c7 commit 4cbab8c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

tc/core/polyhedral/cuda/mapped_scop.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include "tc/core/polyhedral/cuda/mapping_types.h"
3333
#include "tc/core/polyhedral/cuda/memory_promotion_heuristic.h"
3434
#include "tc/core/polyhedral/cuda/tighten_launch_bounds.h"
35+
#include "tc/core/polyhedral/domain_types.h"
3536
#include "tc/core/polyhedral/exceptions.h"
3637
#include "tc/core/polyhedral/schedule_transforms.h"
3738
#include "tc/core/polyhedral/schedule_tree_matcher.h"
@@ -895,7 +896,7 @@ std::unique_ptr<MappedScop> makeSpecializedMappedScop(
895896
// outer schedule dimensions, so the space of a parameter context code is that
896897
// of a zero-dimensional space.
897898
auto root = scop->scheduleRoot();
898-
updateTopLevelContext(root, scop->context().from_params());
899+
updateTopLevelContext(root, scop->context().from_params<Prefix>());
899900

900901
tc::Grid grid = mappedScop.numBlocks;
901902
tc::Block block = mappedScop.numThreads;

tc/core/polyhedral/scop.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ struct Scop {
9292
// The schedule tree of the scop does not necessarily have
9393
// a context node. Call updateTopLevelContext on the schedule tree
9494
// to introduce or refine such a context node.
95-
isl::set context() const {
95+
isl::Set<> context() const {
9696
auto ctx = domain().get_ctx();
9797
auto context = halide2isl::makeParamContext(ctx, halide.params);
98-
return context.intersect(makeContext(parameterValues));
98+
return isl::Set<>(context.intersect(makeContext(parameterValues)));
9999
}
100100

101101
// Specialize a Scop by fixing the given parameters to the given sizes.

0 commit comments

Comments
 (0)