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

Commit c70ca38

Browse files
author
Sven Verdoolaege
committed
MappedScop::makeOneBlockOneThread: return proper mapped scop
One of the invariants of a MappedScop is that there should be mappings to blocks and threads in every path of the tree. In particular, tightenLaunchBounds assumes that these mappings are available, even though it will silently compute possibly incorrect results (which happen to be correct on a scop mapped with makeOneBlockOneThread) if they are missing. Insert the required mappings in makeOneBlockOneThread.
1 parent c69cf78 commit c70ca38

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tc/core/polyhedral/cuda/mapped_scop.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,12 @@ class MappedScop {
7272
public:
7373
static inline std::unique_ptr<MappedScop> makeOneBlockOneThread(
7474
std::unique_ptr<Scop>&& scop) {
75-
return std::unique_ptr<MappedScop>(new MappedScop(
75+
auto mscop = std::unique_ptr<MappedScop>(new MappedScop(
7676
std::move(scop), ::tc::Grid{1, 1, 1}, ::tc::Block{1, 1, 1}, 1, false));
77+
auto band = mscop->scop_->obtainOuterBand();
78+
mscop->mapBlocksForward(band, 0);
79+
mscop->mapThreadsBackward(band);
80+
return mscop;
7781
}
7882
static inline std::unique_ptr<MappedScop> makeMappedScop(
7983
std::unique_ptr<Scop>&& scop,

0 commit comments

Comments
 (0)