Skip to content

Commit

Permalink
Retry @inbounds implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
lkdvos committed May 6, 2024
1 parent 4427596 commit 260626d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/tensors/indexmanipulations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -318,15 +318,15 @@ function add_transform!(tdst::AbstractTensorMap{S,N₁,N₂},

I = sectortype(S)
if p₁ == codomainind(tsrc) && p₂ == domainind(tsrc)
@inbounds add!(tdst, tsrc, α, β)
add!(tdst, tsrc, α, β)
elseif I === Trivial
@inbounds _add_trivial_kernel!(tdst, tsrc, (p₁, p₂), fusiontreetransform, α, β,
_add_trivial_kernel!(tdst, tsrc, (p₁, p₂), fusiontreetransform, α, β,
backend...)
elseif FusionStyle(I) isa UniqueFusion
@inbounds _add_abelian_kernel!(tdst, tsrc, (p₁, p₂), fusiontreetransform, α, β,
_add_abelian_kernel!(tdst, tsrc, (p₁, p₂), fusiontreetransform, α, β,
backend...)
else
@inbounds _add_general_kernel!(tdst, tsrc, (p₁, p₂), fusiontreetransform, α, β,
_add_general_kernel!(tdst, tsrc, (p₁, p₂), fusiontreetransform, α, β,
backend...)
end
return tdst
Expand Down Expand Up @@ -355,7 +355,7 @@ end

function _add_abelian_block!(tdst, tsrc, p, fusiontreetransform, f₁, f₂, α, β, backend...)
(f₁′, f₂′), coeff = first(fusiontreetransform(f₁, f₂))
TO.tensoradd!(tdst[f₁′, f₂′], p, tsrc[f₁, f₂], :N, α * coeff, β, backend...)
@inbounds TO.tensoradd!(tdst[f₁′, f₂′], p, tsrc[f₁, f₂], :N, α * coeff, β, backend...)
return nothing
end

Expand All @@ -373,7 +373,7 @@ function _add_general_kernel!(tdst, tsrc, p, fusiontreetransform, α, β, backen
else
for (f₁, f₂) in fusiontrees(tsrc)
for ((f₁′, f₂′), coeff) in fusiontreetransform(f₁, f₂)
TO.tensoradd!(tdst[f₁′, f₂′], p, tsrc[f₁, f₂], :N, α * coeff, true,
@inbounds TO.tensoradd!(tdst[f₁′, f₂′], p, tsrc[f₁, f₂], :N, α * coeff, true,
backend...)
end
end
Expand All @@ -386,7 +386,7 @@ function _add_nonabelian_sector!(tdst, tsrc, p, fusiontreetransform, s₁, s₂,
for (f₁, f₂) in fusiontrees(tsrc)
(f₁.uncoupled == s₁ && f₂.uncoupled == s₂) || continue
for ((f₁′, f₂′), coeff) in fusiontreetransform(f₁, f₂)
TO.tensoradd!(tdst[f₁′, f₂′], p, tsrc[f₁, f₂], :N, α * coeff, true, backend...)
@inbounds TO.tensoradd!(tdst[f₁′, f₂′], p, tsrc[f₁, f₂], :N, α * coeff, true, backend...)
end
end
return nothing
Expand Down

0 comments on commit 260626d

Please sign in to comment.