Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors from squaring #85

Closed
mcabbott opened this issue Apr 5, 2020 · 3 comments
Closed

Errors from squaring #85

mcabbott opened this issue Apr 5, 2020 · 3 comments

Comments

@mcabbott
Copy link

mcabbott commented Apr 5, 2020

In the example of this thread, LoopVectorization seems not to be working for powers? Simpler examples:

julia> rr = rand(5);

julia> @avx rr.^2
ERROR: syntax: SSAValue objects should not occur in an AST
Stacktrace:
 [1] top-level scope at REPL[7]:1

julia> function sqr(x)
       out = similar(x)
       @avx for i in eachindex(x)
          out[i] = x[i]^2
       end
       out
       end
sqr (generic function with 1 method)

julia> sqr(rr)
ERROR: MethodError: no method matching ^(::VectorizationBase.SVec{4,Float64}, ::Int64)
Closest candidates are:
  ^(::Missing, ::Integer) at missing.jl:155
  ^(::Missing, ::Number) at missing.jl:115
  ^(::BigFloat, ::Union{Int16, Int32, Int64, Int8}) at mpfr.jl:587
  ...
Stacktrace:
 [1] macro expansion at /Users/me/.julia/packages/LoopVectorization/pVDc9/src/reconstruct_loopset.jl:415 [inlined]
 [2] _avx_! at /Users/me/.julia/packages/LoopVectorization/pVDc9/src/reconstruct_loopset.jl:415 [inlined]
 [3] sqr(::Array{Float64,1}) at ./REPL[8]:3
 [4] top-level scope at REPL[9]:1

(sdkfjhsdsdf) pkg> st
     Status `~/trash/sdkfjhsdsdf/Project.toml`
   bdcacae8 LoopVectorization v0.6.27

julia> VERSION # yesterday's, but I get the same on 1.4, just slightly more verbose errors
v"1.5.0-DEV.570"
@chriselrod
Copy link
Member

I'll add Base.literal_pow support.
It'll take more than just a few missing methods, because it doesn't generate calls to Base.literal_pow at the moment.

@mcabbott
Copy link
Author

mcabbott commented Apr 6, 2020

Thanks!

@chriselrod
Copy link
Member

I'll register a new release soon. I added a few unit tests that should cover it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants