Skip to content

Commit 634866a

Browse files
committed
fix: update workspace buffer correctly
1 parent c5541ca commit 634866a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/enzyme_ad/jax/Passes/LowerEnzymeXLALapack.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2283,7 +2283,11 @@ LogicalResult lowerSVDAlgorithmCPU(OpTy op, PatternRewriter &rewriter,
22832283

22842284
LLVM::StoreOp::create(rewriter, op.getLoc(), workSpaceSize, lworkptr);
22852285

2286-
args[11] = workspace;
2286+
if (algorithm == enzymexla::SVDAlgorithm::QRIteration) {
2287+
args[11] = workspace;
2288+
} else if (algorithm == enzymexla::SVDAlgorithm::DivideAndConquer) {
2289+
args[10] = workspace;
2290+
}
22872291

22882292
LLVM::CallOp::create(rewriter, op.getLoc(), TypeRange{},
22892293
SymbolRefAttr::get(ctx, bind_fn), ValueRange(args));

0 commit comments

Comments
 (0)