Git Product home page Git Product logo

Comments (3)

chriselrod avatar chriselrod commented on July 16, 2024 1

I fixed it without needing to create temporaries via, in VectorizationBase:

@inline stridedpointer(x::AbstractRange) = x
@inline load(r::AbstractRange, i::Tuple{<:Integer}) = @inbounds r[i[1] + 1]

and in SIMDPirates:

@inline vload(r::AbstractRange{T}, i::Tuple{_MM{W}}) where {W,T} = vmuladd(svrange(Val{W}(), T), step(r), @inbounds r[i[1].i + 1])
@inline vload(r::UnitRange{T}, i::Tuple{_MM{W}}) where {W,T} = vadd(svrange(Val{W}(), T), @inbounds r[i[1].i + 1])

@inline vload(r::AbstractRange{T}, i::Tuple{_MM{W}}, ::Unsigned) where {W,T} = vmuladd(svrange(Val{W}(), T), step(r), @inbounds r[i[1].i + 1])
@inline vload(r::UnitRange{T}, i::Tuple{_MM{W}}, ::Unsigned) where {W,T} = vadd(svrange(Val{W}(), T), @inbounds r[i[1].i + 1])

I haven't commited these changes yet, but will within the next few hours.

This is much slower than not having @avx, since it prevents LLVM's O(1) optimization of the loop.
Would be neat if we could avoid preventing that optimization.

from loopvectorization.jl.

MasonProtter avatar MasonProtter commented on July 16, 2024

I have a use-case in mind that wouldn't benefit from O(1) optimization so I don't mind.

from loopvectorization.jl.

chriselrod avatar chriselrod commented on July 16, 2024

I'm closing this because I've now tagged a release where this works.

julia> f([1,2,3])
6.0

julia> f(1:3)
6.0

Let me know if you have any more problems.

from loopvectorization.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.