Skip to content

Commit

Permalink
fix broken @avx call
Browse files Browse the repository at this point in the history
  • Loading branch information
guyvdbroeck committed Feb 16, 2021
1 parent 8766430 commit 90a16a5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/satisfies_flow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,9 @@ assign_flow(f::Matrix{<:Unsigned}, v, d, g, s) =
@inbounds @views @. f[:, d] = v[:, s] & v[:, d] & f[:, g]

function assign_flow(f::Matrix{<:AbstractFloat}, v, d, g, s)
@avx for j in 1:size(f,1)
@simd for j in 1:size(f,1) # adding @avx here gives incorrect results
edge_flow = v[j, s] * v[j, d] / v[j, g] * f[j, g]
edge_flow = vifelse(isfinite(edge_flow), edge_flow, zero(eltype(f)))
edge_flow = ifelse(isfinite(edge_flow), edge_flow, zero(eltype(f)))
f[j, d] = edge_flow
end
end
Expand All @@ -290,9 +290,9 @@ accum_flow(f::Matrix{<:Unsigned}, v, d, g, s) =
@inbounds @views @. f[:, d] |= v[:, s] & v[:, d] & f[:, g]

function accum_flow(f::Matrix{<:AbstractFloat}, v, d, g, s)
@avx for j in 1:size(f,1)
@simd for j in 1:size(f,1) # adding @avx here gives incorrect results
edge_flow = v[j, s] * v[j, d] / v[j, g] * f[j, g]
edge_flow = vifelse(isfinite(edge_flow), edge_flow, zero(eltype(f)))
edge_flow = ifelse(isfinite(edge_flow), edge_flow, zero(eltype(f)))
f[j, d] += edge_flow
end
end
Expand Down

0 comments on commit 90a16a5

Please sign in to comment.