Skip to content

Commit aec5d4c

Browse files
committed
Mostly a todo list
1 parent 1ef12d6 commit aec5d4c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

ext/ITensorsVectorInterfaceExt/ITensorsVectorInterfaceExt.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@ function VectorInterface.add(a::ITensor, b::ITensor, α::Number, β::Number)
3838
return a * β + b * α
3939
end
4040
function VectorInterface.add!(a::ITensor, b::ITensor, α::Number, β::Number)
41-
a .= a .* β .+ b .* α
41+
## TODO Coding it this way skips code which fails on GPU in broadcast.jl
42+
## Not a permanant fix, just here until the broadcast function can be
43+
## updated
44+
a .*= β
45+
a .+= b .* α
46+
# a .= a .* β .+ b .* α
4247
return a
4348
end
4449
function VectorInterface.add!!(a::ITensor, b::ITensor, α::Number, β::Number)

src/broadcast.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,10 @@ function Base.copyto!(
414414
A, C = C, A
415415
end
416416
if !isnothing(A) && !isnothing(C) && !isnothing(α) && !isnothing(β)
417+
## TODO this line fails, because the function (r, t) -> β * r + α * t
418+
## is an anonymous ITensor function which the GPU compiler cannot process
419+
## This code is being called in ITensorsVectorInterfaceExt but checked was missed because
420+
417421
map!((r, t) -> β * r + α * t, T, T, A)
418422
else
419423
bc_bc_α = find_type(Broadcasted, bc_α.args)

0 commit comments

Comments
 (0)