25 namespace polyhedral {
31 struct MappingId :
public isl::id {
33 MappingId(isl::id i,
unsigned char l) : isl::id(i), dim(l) {}
36 MappingId(
const MappingId&
id) : isl::id(id), dim(id.dim) {}
38 inline bool isBlockId();
39 inline BlockId* asBlockId();
41 inline bool isThreadId();
42 inline ThreadId* asThreadId();
50 const unsigned char dim;
53 static constexpr
size_t unmapped = 1;
56 size_t operator()(
const MappingId&
id)
const {
65 struct BlockId :
public MappingId {
67 inline BlockId(isl::id
id,
unsigned char l) : MappingId(id, l) {}
68 static inline BlockId makeId(
size_t dim);
69 template <
unsigned char Dim>
70 static BlockId makeId(isl::id
id);
72 static constexpr
unsigned char kMaxDim = 3;
74 static inline BlockId x();
75 static inline BlockId y();
76 static inline BlockId z();
81 size_t mappingSize(
const tc::Grid& grid)
const;
84 size_t operator()(
const BlockId&
id)
const {
93 struct ThreadId :
public MappingId {
95 inline ThreadId(isl::id
id,
unsigned char l) : MappingId(id, l) {}
96 static inline ThreadId makeId(
size_t dim);
97 template <
unsigned char Dim>
98 static ThreadId makeId(isl::id
id);
100 static constexpr
unsigned char kMaxDim = 3;
102 static inline ThreadId x();
103 static inline ThreadId y();
104 static inline ThreadId z();
109 size_t mappingSize(
const tc::Block& block)
const;
112 size_t operator()(
const ThreadId&
id)
const {
118 #define USING_MAPPING_SHORT_NAMES(BX, BY, BZ, TX, TY, TZ) \
119 using namespace tc::polyhedral::mapping; \
120 auto BX = BlockId::x(); \
122 auto BY = BlockId::y(); \
124 auto BZ = BlockId::z(); \
126 auto TX = ThreadId::x(); \
128 auto TY = ThreadId::y(); \
130 auto TZ = ThreadId::z(); \
Specializing CudaDim to differentiate between Block and Grid sizes.
Definition: mapping_options.h:208
Specializing CudaDim to differentiate between Block and Grid sizes.
Definition: mapping_options.h:196