Skip to content

Commit 7dbd99a

Browse files
Katharine Hyattkshyatt
authored andcommitted
Fix blocksectors handling
1 parent b739743 commit 7dbd99a

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎src/factorizations/matrixalgebrakit.jl‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ for (f!, bf!) in ((:svd_compact!, :batched_svd_compact!), (:svd_full!, :batched_
6262
@timeit_debug GLOBAL_TIMER $(string(f!)) begin
6363
U, S, Vᴴ = F
6464
driver = get(alg.kwargs, :driver, MAK.DefaultDriver())
65-
if MAK.supports_ragged_batch(MAK.$f!, alg, driver, storagetype(t))
66-
cs = collect(blocksectors(t))
65+
cs = collect(union(blocksectors.((t, U, S, Vᴴ))...))
66+
if !isempty(cs) && MAK.supports_ragged_batch(MAK.$f!, alg, driver, storagetype(t))
6767
As = [block(t, c) for c in cs]
6868
Fs = ([block(U, c) for c in cs], [block(S, c) for c in cs], [block(Vᴴ, c) for c in cs])
6969
if applicable(MAK.$bf!, As, Fs, alg)
@@ -113,8 +113,8 @@ for (f!, bf!) in ((:svd_vals!, :batched_svd_vals!),)
113113
@eval function MAK.$f!(t::AbstractTensorMap, N, alg::AbstractAlgorithm)
114114
@timeit_debug GLOBAL_TIMER $(string(f!)) begin
115115
driver = get(alg.kwargs, :driver, MAK.DefaultDriver())
116-
if MAK.supports_ragged_batch(MAK.$f!, alg, driver, storagetype(t))
117-
cs = collect(blocksectors(t))
116+
cs = collect(union(blocksectors.((t, N))...))
117+
if !isempty(cs) && MAK.supports_ragged_batch(MAK.$f!, alg, driver, storagetype(t))
118118
As, Ns = [block(t, c) for c in cs], [block(N, c) for c in cs]
119119
if applicable(MAK.$bf!, As, Ns, alg)
120120
@timeit_debug GLOBAL_TIMER "batched: MatrixAlgebraKit" MAK.$bf!(As, Ns, alg)

0 commit comments

Comments
 (0)