JuliaSIMD / JuliaSIMD/LoopVectorization.jl
Support vectorizing `rand`?
- Vorherrschende Sprache
- Julia
- Sterne
- 789
- Forks
- 73
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
I have no idea if it is possible to vectorize `rand`.
I hope for a usage like below:
```julia
julia> using LoopVectorization
julia> m = zeros(Float32, 4,4)
4×4 Matrix{Float32}:
0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0
julia> a = rand(Float32, 4,4)
4×4 Matrix{Float32}:
0.251334 0.409923 0.591477 0.04535
0.4116 0.52253 0.34138 0.870923
0.24401 0.116969 0.583924 0.0549548
0.528378 0.898528 0.519574 0.172627
julia> b = rand(Float32, 4,4)
4×4 Matrix{Float32}:
0.874233 0.263186 0.000970364 0.411874
0.0680491 0.951124 0.803958 0.197752
0.669292 0.996646 0.0915098 0.652465
0.395592 0.875268 0.601194 0.518282
julia> @avxt for i in eachindex(m)
m[i] = rand(a[i]:1.0f3:b[i])
end
```
I have tried `VectorizedRNG` but I did not find out how to set boundries.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Bewertung
Dieses Issue wurde noch nicht bewertet.