Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
liuanji committed Feb 26, 2021
2 parents 31d1c90 + 0ec435f commit 3fc4328
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ CSV = "0.7, 0.8"
CUDA = "2"
DataFrames = "0.21, 0.22"
LightGraphs = "1.3"
LoopVectorization = "0.8"
LoopVectorization = "0.8, 0.11"
MLDatasets = "0.4, 0.5"
Reexport = "0.2"
Reexport = "0.2, 1.0"
StatsFuns = "0.9"
TikzGraphs = "1.1"
julia = "1.5"
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 3fc4328

Please sign in to comment.