当前位置: 首页>>代码示例>>C++>>正文


C++ Space::getTupleName方法代码示例

本文整理汇总了C++中Space::getTupleName方法的典型用法代码示例。如果您正苦于以下问题:C++ Space::getTupleName方法的具体用法?C++ Space::getTupleName怎么用?C++ Space::getTupleName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Space的用法示例。


在下文中一共展示了Space::getTupleName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: printConditions

void AliasCheckGenerator::printConditions(const isl::Set &ParamContext,
                                          const isl::Set &Acc,
                                          const BoundsMapT &map) const {
  void *np = NULL;
  Set AccA = Acc;

  // Eliminate all but one single dimension and take the min/max.
  unsigned int ndims = AccA.dim(DimType::DTSet);
  AccA = AccA.eliminate(DimType::DTSet, 1, ndims - 1);
  PwAff minA = AccA.dimMin(0);
  PwAff maxA = AccA.dimMax(0);

  AstBuild Builder = AstBuild::fromContext(ParamContext);
  Space A = AccA.getSpace();
  std::string nA = A.getTupleName(DimType::DTSet);
  Id idA = Id::alloc(nA, np);

  AstExpr ExpMinA = Builder.exprFromPwAff(minA);
  AstExpr ExpMaxA = Builder.exprFromPwAff(maxA);
  AstExpr ExpIdA = AstExpr::fromId(idA);

  ExpMinA = ExpIdA.add(ExpMinA);
  ExpMaxA = ExpIdA.add(ExpMaxA);

  for (const isl::Set &s : map) {
    Set AccB = s;
    Space B = AccB.getSpace();

    std::string nB = B.getTupleName(DimType::DTSet);
    Id idB = Id::alloc(nB, np);

    PwAff minB = AccB.dimMin(0);
    PwAff maxB = AccB.dimMax(0);

    AstExpr ExpMinB = Builder.exprFromPwAff(minB);
    AstExpr ExpMaxB = Builder.exprFromPwAff(maxB);
    AstExpr ExpIdB = AstExpr::fromId(idB);

    ExpMinB = ExpIdB.add(ExpMinB);
    ExpMaxB = ExpIdB.add(ExpMaxB);

    dbgs().indent(6) << "[ (" << ExpMinA.toStr(Format::FC) << ")";
    dbgs() << " <=  (" << ExpMaxB.toStr(Format::FC) << ")";
    dbgs() << " && (" << ExpMinB.toStr(Format::FC) << ")";
    dbgs() << " <=  (" << ExpMaxA.toStr(Format::FC) << ") ]\n";
  }
}
开发者ID:CIB,项目名称:polli,代码行数:47,代码来源:AliasCheckCodeGen.cpp

示例2: checkPairs

Set AliasCheckGenerator::checkPairs(const Set &Cond, const Set &Acc,
                                    const BoundsMapT &map) const {
  Set AccA = Acc;
  Set ResCond = Cond;

  // Eliminate all but one single dimension and take the min/max.
  unsigned int ndims = AccA.dim(DimType::DTSet);
  AccA = AccA.eliminate(DimType::DTSet, 1, ndims - 1);
  PwAff minA = AccA.dimMin(0);
  PwAff maxA = AccA.dimMax(0);

  Space spaceA = AccA.getSpace();
  std::string nA = spaceA.getTupleName(DimType::DTSet);
  Set baseA = Set::readFromStr("[" + nA + "] -> { [" + nA + "] };");
  PwAff bpA = baseA.dimMin(0);

  minA = minA.add(bpA);
  maxA = maxA.add(bpA);

  for (const isl::Set &s : map) {
    Set AccB = s;

    ndims = AccB.dim(DimType::DTSet);
    AccB = AccB.eliminate(DimType::DTSet, 1, ndims - 1);

    Space spaceB = AccB.getSpace();
    std::string nB = spaceB.getTupleName(DimType::DTSet);
    Set baseB = Set::readFromStr("[" + nB + "] -> { [" + nB + "] };");
    PwAff bpB = baseB.dimMin(0);

    PwAff minB = AccB.dimMin(0).add(bpB);
    PwAff maxB = AccB.dimMax(0).add(bpB);

    ResCond = ResCond.intersect(minA.leSet(maxB).intersect(minB.leSet(maxA)));
    ResCond = ResCond.coalesce();
  }
  return ResCond;
}
开发者ID:CIB,项目名称:polli,代码行数:38,代码来源:AliasCheckCodeGen.cpp


注:本文中的Space::getTupleName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。