JuliaSIMD / JuliaSIMD/LoopVectorization.jl

Support vectorizing `rand`?

オープン
#281 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Julia
スター
789
フォーク
73
PR マージ指標
30日以内にマージされた PR はありません

説明

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.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

Start with the @avxt loop and the VectorizedRNG approach mentioned in the issue, then inspect how LoopVectorization handles rand calls and bounds. Clarify the intended per-element boundary behavior for the a and b arrays. Done means the shown loop can generate bounded random values through vectorization, with tests covering the supported usage.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
julia
領域
performance
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
30/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。