Lines Matching refs:forOp
73 static Operation::operand_range getLowerBoundOperands(AffineForOp forOp) { in getLowerBoundOperands() argument
74 return forOp.getLowerBoundOperands(); in getLowerBoundOperands()
78 static Operation::operand_range getUpperBoundOperands(AffineForOp forOp) { in getUpperBoundOperands() argument
79 return forOp.getUpperBoundOperands(); in getUpperBoundOperands()
84 static Value getOrCreateStep(AffineForOp forOp, OpBuilder &builder) { in getOrCreateStep() argument
85 return builder.create<arith::ConstantIndexOp>(forOp.getLoc(), in getOrCreateStep()
86 forOp.getStep()); in getOrCreateStep()
91 static Value getOrEmitLowerBound(AffineForOp forOp, OpBuilder &builder) { in getOrEmitLowerBound() argument
92 return lowerAffineLowerBound(forOp, builder); in getOrEmitLowerBound()
97 static Value getOrEmitUpperBound(AffineForOp forOp, OpBuilder &builder) { in getOrEmitUpperBound() argument
98 return lowerAffineUpperBound(forOp, builder); in getOrEmitUpperBound()
107 static LogicalResult checkAffineLoopNestMappableImpl(AffineForOp forOp, in checkAffineLoopNestMappableImpl() argument
109 Region &limit = forOp.getRegion(); in checkAffineLoopNestMappableImpl()
111 Operation *nested = &forOp.getBody()->front(); in checkAffineLoopNestMappableImpl()
112 if (!areValuesDefinedAbove(getLowerBoundOperands(forOp), limit) || in checkAffineLoopNestMappableImpl()
113 !areValuesDefinedAbove(getUpperBoundOperands(forOp), limit)) in checkAffineLoopNestMappableImpl()
114 return forOp.emitError( in checkAffineLoopNestMappableImpl()
123 auto begin = forOp.getBody()->begin(), end = forOp.getBody()->end(); in checkAffineLoopNestMappableImpl()
124 if (forOp.getBody()->empty() || std::next(begin, 2) != end) in checkAffineLoopNestMappableImpl()
125 return forOp.emitError("expected perfectly nested loops in the body"); in checkAffineLoopNestMappableImpl()
127 if (!(forOp = dyn_cast<AffineForOp>(nested))) in checkAffineLoopNestMappableImpl()
133 static LogicalResult checkAffineLoopNestMappable(AffineForOp forOp, in checkAffineLoopNestMappable() argument
142 return forOp.emitError("cannot map to more than 3 block dimensions"); in checkAffineLoopNestMappable()
145 return forOp.emitError("cannot map to more than 3 thread dimensions"); in checkAffineLoopNestMappable()
147 return checkAffineLoopNestMappableImpl(forOp, numBlockDims + numThreadDims); in checkAffineLoopNestMappable()
154 Optional<AffineForOp> collectBounds(AffineForOp forOp, unsigned numLoops);
183 AffineLoopToGpuConverter::collectBounds(AffineForOp forOp, unsigned numLoops) { in collectBounds() argument
184 OpBuilder builder(forOp.getOperation()); in collectBounds()
189 AffineForOp currentLoop = forOp; in collectBounds()
283 static LogicalResult convertAffineLoopNestToGPULaunch(AffineForOp forOp, in convertAffineLoopNestToGPULaunch() argument
286 if (failed(checkAffineLoopNestMappable(forOp, numBlockDims, numThreadDims))) in convertAffineLoopNestToGPULaunch()
291 converter.collectBounds(forOp, numBlockDims + numThreadDims); in convertAffineLoopNestToGPULaunch()
294 converter.createLaunch(forOp, *maybeInnerLoop, numBlockDims, numThreadDims); in convertAffineLoopNestToGPULaunch()
299 LogicalResult mlir::convertAffineLoopNestToGPULaunch(AffineForOp forOp, in convertAffineLoopNestToGPULaunch() argument
302 return ::convertAffineLoopNestToGPULaunch(forOp, numBlockDims, numThreadDims); in convertAffineLoopNestToGPULaunch()