Skip to content

Commit

Permalink
fix test because mutating bindings captured by closures shouldn't be …
Browse files Browse the repository at this point in the history
…a thing that exists
  • Loading branch information
chriselrod committed Aug 23, 2022
1 parent b13e9ee commit 0fec6fe
Showing 1 changed file with 26 additions and 25 deletions.
51 changes: 26 additions & 25 deletions test/ifelsemasks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ T = Float32
end

function twoifelses!(res, half, m, keep = nothing, final = true)
𝒶𝓍j = axes(half, 1)
local 𝒶𝓍j = axes(half, 1)
for j in 𝒶𝓍j
𝓇𝒽𝓈 = if isnothing(keep)
log(half[j]) + m[j]
Expand All @@ -331,7 +331,7 @@ T = Float32
res
end
function twoifelses_avx!(res, half, m, keep = nothing, final = true)
𝒶𝓍j = axes(half, 1)
local 𝒶𝓍j = axes(half, 1)
@turbo for j in 𝒶𝓍j
𝓇𝒽𝓈 = if isnothing(keep)
log(half[j]) + m[j]
Expand Down Expand Up @@ -363,9 +363,9 @@ T = Float32

chebpts(m) = (n = m - 1; [cos(k * pi / n) for k = 0:n])
function barycentric_weight0(X)
T = eltype(X)
n = length(X) - 1
w = zero(X)
local T = eltype(X)
local n = length(X) - 1
local w = zero(X)
@inbounds @fastmath for j = 0:n
tmp = one(T)
for k = 0:n
Expand All @@ -376,9 +376,9 @@ T = Float32
return w
end
function barycentric_weight1(X)
T = eltype(X)
n = length(X) - 1
w = zero(X)
local T = eltype(X)
local n = length(X) - 1
local w = zero(X)
@turbo for j = 0:n
tmp = one(T)
for k = 0:n
Expand All @@ -389,9 +389,9 @@ T = Float32
return w
end
function barycentric_weight2(X)
T = eltype(X)
n = length(X) - 1
w = zero(X)
local T = eltype(X)
local n = length(X) - 1
local w = zero(X)
@turbo inline = true for j = 0:n
tmp = one(T)
for k = 0:n
Expand All @@ -402,9 +402,9 @@ T = Float32
return w
end
function barycentric_weight3(X)
T = eltype(X)
n = length(X) - 1
w = zero(X)
local T = eltype(X)
local n = length(X) - 1
local w = zero(X)
@turbo inline = true for j = 0:n
tmp = one(T)
for k = 0:n
Expand All @@ -415,9 +415,9 @@ T = Float32
return w
end
function barycentric_weight4(X)
T = eltype(X)
n = length(X) - 1
w = zero(X)
local T = eltype(X)
local n = length(X) - 1
local w = zero(X)
@turbo for j = 0:n
tmp = one(T)
for k = 0:n
Expand Down Expand Up @@ -469,16 +469,16 @@ T = Float32
end

function absmax_tturbo(a) # LV threaded
result = zero(eltype(a))
local result = zero(eltype(a))
@tturbo for i = 1:length(a)
abs(a[i]) > result && (result = abs(a[i]))
end
result
end

function findminturbo(x)
indmin = 0
minval = typemax(eltype(x))
local indmin = 0
local minval = typemax(eltype(x))
@turbo for i eachindex(x)
newmin = x[i] < minval
minval = newmin ? x[i] : minval
Expand All @@ -487,8 +487,8 @@ T = Float32
minval, indmin
end
function findmintturbo(x)
indmin = 0
minval = typemax(eltype(x))
local indmin = 0
local minval = typemax(eltype(x))
@tturbo for i eachindex(x)
newmin = x[i] < minval
minval = newmin ? x[i] : minval
Expand All @@ -497,8 +497,8 @@ T = Float32
minval, indmin
end
function findminturbo_u4(x)
indmin = 0
minval = typemax(eltype(x))
local indmin = 0
local minval = typemax(eltype(x))
@turbo unroll = 4 for i eachindex(x)
newmin = x[i] < minval
minval = newmin ? x[i] : minval
Expand All @@ -507,7 +507,8 @@ T = Float32
minval, indmin
end
function extrema_turbo(x)
a = b = first(x)
local a = first(x)
local b = a;
@turbo for i in eachindex(x)
local e = x[i]
b = max(b, e)
Expand Down

2 comments on commit 0fec6fe

@chriselrod
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/66876

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.12.124 -m "<description of version>" 0fec6fed7f2341f1754150aea8ae2a0b5c883ad8
git push origin v0.12.124

Please sign in to comment.