better throughput scheduling with steady state cost model, now limited to spatial
This commit is contained in:
@@ -171,7 +171,9 @@ static llvm::FailureOr<int64_t> resolveConstantGlobalLoad(mlir::memref::LoadOp l
|
||||
if (indices.size() != static_cast<size_t>(globalType.getRank()))
|
||||
return mlir::failure();
|
||||
|
||||
auto strides = computeRowMajorStrides(globalType.getShape());
|
||||
auto checkedStrides = computeRowMajorStridesChecked(globalType.getShape());
|
||||
if (failed(checkedStrides)) return mlir::failure();
|
||||
auto strides = std::move(*checkedStrides);
|
||||
int64_t linearIndex = linearizeIndex(indices, strides);
|
||||
if (linearIndex < 0 || linearIndex >= globalType.getNumElements())
|
||||
return mlir::failure();
|
||||
@@ -308,7 +310,9 @@ llvm::FailureOr<CompiledIndexExpr> compileConstantGlobalLoad(mlir::memref::LoadO
|
||||
CompiledIndexExprNode expr;
|
||||
expr.kind = CompiledIndexExprNode::Kind::ConstantGlobalLoad;
|
||||
expr.globalOp = globalOp;
|
||||
expr.globalStrides = computeRowMajorStrides(globalType.getShape());
|
||||
auto checkedStrides = computeRowMajorStridesChecked(globalType.getShape());
|
||||
if (failed(checkedStrides)) return mlir::failure();
|
||||
expr.globalStrides = std::move(*checkedStrides);
|
||||
expr.operands.reserve(loadOp.getIndices().size());
|
||||
for (mlir::Value index : loadOp.getIndices()) {
|
||||
auto compiledIndex = compileIndexValueImpl(index);
|
||||
|
||||
Reference in New Issue
Block a user