Skip to content

Commit 4bcb517

Browse files
committed
Add BlockAlgorithm
1 parent f5023f7 commit 4bcb517

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/tensors/backends.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,18 @@ Run `f` in a scope where the `blockscheduler` is determined by `scheduler' and `
2626
kwargs...)
2727
@with blockscheduler => select_scheduler(scheduler; kwargs...) f()
2828
end
29+
30+
# TODO: disable for trivial symmetry or small tensors?
31+
default_blockscheduler(t::AbstractTensorMap) = blockscheduler[]
32+
33+
# MatrixAlgebraKit
34+
# ----------------
35+
"""
36+
BlockAlgorithm{A,S}(alg, scheduler)
37+
38+
Generic wrapper for implementing block-wise algorithms.
39+
"""
40+
struct BlockAlgorithm{A,S} <: MatrixAlgebraKit.AbstractAlgorithm
41+
alg::A
42+
scheduler::S
43+
end

0 commit comments

Comments
 (0)