Skip to content

Commit

Permalink
fix: PGO swapping did not set non support to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
anirudh2 committed May 1, 2023
1 parent b6197f7 commit 144b9dd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/SemioticOpt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ using Accessors
using Lazy
using LinearAlgebra
using Zygote
using InvertedIndices

abstract type OptAlgorithm end

Expand Down
1 change: 1 addition & 0 deletions src/pgo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ function bestswap(xinit::AbstractVector{T}, supports::AbstractMatrix{<:Integer},

# Compute optimal swap
_ = map(eachcol(xs), eachcol(supports), 1:npossibilities) do x, support, i # In-place so don't need to return or assign
x[Not(support)] .= zero(T)
v = swap!(x, support, f, fa)
os[i] = selection(v)
return nothing
Expand Down

0 comments on commit 144b9dd

Please sign in to comment.