ok thanks! and so I should define my SIMD-able function like

function vadd!{N,T}(xs::Vector{T}, ys::Vector{T}, ::Type{Vec{N,T}})
    @assert length(ys) == length(xs)
    @assert length(xs) % N == 0
    @inbounds for i in 1:N:length(xs)
        xv = vload(Vec{N,T}, xs, i)
        yv = vload(Vec{N,T}, ys, i)
        xv += yv
        vstore(xv, xs, i)
    endend

i.e. using vload() and vstore() methods?


On Thursday, 13 October 2016 15:29:50 UTC+2, Valentin Churavy wrote:
>
> If you want explicit simd the best way right now is the great SIMD.jl 
> package https://github.com/eschnett/SIMD.jl  it is builds on top of 
> VecElement.
>
> In many cases we can perform automatic vectorisation, but you have to 
> start Julia with -O3
>
> On Thursday, 13 October 2016 22:15:00 UTC+9, Florian Oswald wrote:
>>
>> i see on the docs 
>> http://docs.julialang.org/en/release-0.5/stdlib/simd-types/?highlight=SIMD 
>> that there is a vecElement that is build for SIMD support. I don't 
>> understand if as a user I should construct vecElement arrays and hope for 
>> some SIMD optimization? thanks.
>>
>>

Reply via email to