Skip to content

Commit 1eca7a8

Browse files
committed
simplify mul!
1 parent c501f63 commit 1eca7a8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/tensors/linalg.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,11 +391,12 @@ function threaded_mul!(tC::AbstractTensorMap, tA::AbstractTensorMap, tB::Abstrac
391391
# obtain cached data before multithreading
392392
bCs, bAs, bBs = blocks(tC), blocks(tA), blocks(tB)
393393

394-
tforeach(blocksectors(tC); scheduler) do c
394+
# TODO: investigate if it's worth it to attempt to sort/split off the mul! vs scale!
395+
tforeach(bCs; scheduler) do (c, bC)
395396
if haskey(bAs, c) # then also bBs should have it
396-
mul!(bCs[c], bAs[c], bBs[c], α, β)
397+
mul!(bC, bAs[c], bBs[c], α, β)
397398
elseif !isone(β)
398-
scale!(bCs[c], β)
399+
scale!(bC, β)
399400
end
400401
end
401402

0 commit comments

Comments
 (0)