JuliaSIMD / JuliaSIMD/LoopVectorization.jl
Assignment vectorization
- Lenguaje dominante
- Julia
- Estrellas
- 789
- Forks
- 73
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
Now if I run the following I get an error:
```julia
a = collect(1:100)
items = rand(20)
indices = collect(1:20)
@avx a[indices] .= items
```
```julia
ERROR: MethodError: no method matching vmaterialize!(::SubArray{Int64,1,Array{Int64,1},Tuple{Array{Int64,1}},false}, ::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1},Nothing,typeof(identity),Tuple{Array{Int64,1}}}, ::Val{:Main})Closest candidates are:
vmaterialize!(::Union{LinearAlgebra.Adjoint{T,A}, LinearAlgebra.Transpose{T,A}}, ::BC, ::Val{Mod}) where {T<:Union{Float32, Float64}, N, A<:AbstractArray{T,N}, BC<:Base.Broadcast.Broadcasted, Mod} at C:\Users\yahyaaba\.julia\packages\LoopVectorization\iNfCA\src\broadcast.jl:218
vmaterialize!(::AbstractArray{T,N}, ::BC, ::Val{Mod}) where {T<:Union{Float32, Float64}, N, BC<:Base.Broadcast.Broadcasted, Mod} at C:\Users\yahyaaba\.julia\packages\LoopVectorization\iNfCA\src\broadcast.jl:194
```
That expression is equal to the following that works
```julia
indiceslen = length(indices)
@avx for k = 1:indiceslen
a[indices[k]] = items[k]
end
```
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Start with the @avx broadcast expression and the vmaterialize! methods named in the error, then compare them with the working @avx loop. Reproduce the indexed assignment and determine whether the broadcast form should be supported; done means the example runs without the MethodError and relevant behavior is covered by a test.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- julia
- Área
- performance
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 45/100