tc/core/polyhedral/cuda/memory_promotion_heuristic.cc
// Obtain the depth of the schedule dimension that was mapped to threadIdx.x
// for the domain elements identified by "s".  Assumes the depth is the same
// for all these elements.
Obtain the depth of the schedule dimension that was mapped to threadIdx.x
for the domain elements identified by "s".  Assumes the depth is the same
for all these elements.
Obtain the depth of the schedule dimension that was mapped to threadIdx . x for the domain elements identified by " s " . Assumes the depth is the same for all these elements .
size_t computeThreadIdxXScheduleDepth(
    const ThreadIdxXScheduleDepthState& threadIdxXScheduleDepthState,
    isl::union_set s) {
  std::unordered_set<size_t> depths;
  for (auto p : threadIdxXScheduleDepthState) {
    if (!p.first.intersect(s).is_empty()) {
      depths.insert(p.second);
    }
  }
  if (depths.size() != 1) {
    std::stringstream ss;
    ss << "threadIdx.x depth " << (depths.size() == 0 ? "unknown" : "diverged")
       << " for " << s;
    throw promotion::PromotionLogicError(ss.str());
  }
  return *depths.begin();
}
size_t computeThreadIdxXScheduleDepth ( const ThreadIdxXScheduleDepthState & threadIdxXScheduleDepthState , isl :: union_set s ) { std :: unordered_set < size_t > depths ; for ( auto p : threadIdxXScheduleDepthState ) { if ( ! p . first . intersect ( s ) . is_empty ( ) ) { depths . insert ( p . second ) ; } } if ( depths . size ( ) != 1 ) { std :: stringstream ss ; ss << " " << ( depths . size ( ) == 0 ? " " : " " ) << " " << s ; throw promotion :: PromotionLogicError ( ss . str ( ) ) ; } return * depths . begin ( ) ; }
Obtain the depth of the schedule dimension that was mapped to threadIdx.x
for the domain elements identified by "s".
Obtain the depth of the schedule dimension that was mapped to threadIdx . x for the domain elements identified by " s " .