Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,15 @@ function *(op1::AbstractLinearOperator, op2::AbstractLinearOperator)
throw(LinearOperatorException("shape mismatch"))
end
S = promote_type(storage_type(op1), storage_type(op2))
isconcretetype(S) ||
throw(LinearOperatorException("storage types cannot be promoted to a concrete type"))
if !isconcretetype(S)
throw(
LinearOperatorException(
"storage types $(storage_type(op1)) and $(storage_type(op2)) " *
"cannot be promoted to a concrete type. " *
"Ensure both operators use compatible storage types (e.g., both GPU or both CPU).",
),
)
end
Comment thread
tmigot marked this conversation as resolved.
#tmp vector for products
vtmp = fill!(S(undef, m2), zero(T))
utmp = fill!(S(undef, n1), zero(T))
Expand Down