Friends with LoopVectorization once again

This commit is contained in:
zymon 2024-11-30 23:46:55 +01:00
parent f0fa05284e
commit b1a11ef54c
3 changed files with 8 additions and 7 deletions

View file

@ -6,12 +6,13 @@ version = "0.3.1"
[deps]
DSP = "717857b8-e6f2-59f4-9121-6e50c889abd2"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
LoopVectorization = "bdcacae8-1622-11e9-2a5c-532679323890"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SLEEFPirates = "476501e8-09a2-5ece-8869-fb82de89a1fa"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
[compat]
DSP = "0.7"
LoopVectorization = "0.12.171"
StaticArrays = "1"
julia = "1.6"

View file

@ -80,7 +80,7 @@ function image_source_generator(
if config.isd > 0.0 && o > 0
# generate random displacement for the image source
isp .+= randn(config.lrng) * config.isd
isp = isp .+ randn(config.lrng) .* config.isd
end
# Distance between receiver and image source
@ -124,12 +124,12 @@ function insert_impuse!(h, A, τ, impulse_width, fs, Δt, twid, ω, N)
i_e = min(floor(Int, (τ + a) * fs) + 1, N) # end
# Insert yet another impulse into transfer function
for i i_s:i_e
@turbo for i i_s:i_e
t = (i - 1) * Δt - τ # time signature
w = fma(cos_fast(ω*t), 0.5, 0.5) # Hann window
w = 0.5 * (1.0 + cos(ω*t)) # Hann window
x = twid * t
sinc = ifelse(iszero(x), 1.0, sin_fast(x)/x)
@inbounds h[i] += w * A * sinc
sinc = ifelse(iszero(x), 1.0, sin(x)/x)
h[i] += w * A * sinc
end
end

View file

@ -6,7 +6,7 @@ using Statistics
using Random
using Random: GLOBAL_RNG
using SLEEFPirates: cos_fast, sin_fast
using LoopVectorization
using DSP: conv
include("TxRxModels.jl")