Tensor Comprehensions
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
memory_promotion_heuristic.h
Go to the documentation of this file.
1 
16 #pragma once
17 
18 #include <cstddef>
19 #include <vector>
20 
21 #include "tc/external/isl.h"
22 
23 namespace tc {
24 namespace polyhedral {
25 using ThreadIdxxScheduleDepthState =
26  std::vector<std::pair<isl::union_set, size_t>>;
27 
28 class MappedScop;
29 
30 // In the given mapped scop "mscop",
31 // promote to shared memory at "depth" until "sharedMemorySize" is used.
32 // Map copies between global and shared memory to threads and unroll those
33 // copies if "unrollCopies" is set, using the options in "mscop".
34 // "threadIdxxScheduleDepthState" contains the schedule depth at which the
35 // computation was mapped to thread x and is used to check whether the global
36 // memory is accessed in a coalesced way.
37 void promoteGreedilyAtDepth(
38  MappedScop& scop,
39  const ThreadIdxxScheduleDepthState& threadIdxxScheduleDepthState,
40  std::size_t depth,
41  std::size_t sharedMemorySize,
42  bool unrollCopies);
43 } // namespace polyhedral
44 } // namespace tc