Skip to content

Scope problem with log10 #249

Closed
Closed
@mcabbott

Description

Here's a bug I just found:

julia> using LoopVectorization

julia> let x=rand(10), y=zeros(10)
       @avx for i in 1:10
       y[i]= log10(x[i])  # same for log2, but log is OK
       end
       y
       end
ERROR: UndefVarError: SLEEFPirates not defined
Stacktrace:
 [1] top-level scope
   @ ./REPL[2]:2

(@v1.6) pkg> st LoopVectorization
      Status `~/.julia/environments/v1.6/Project.toml`
  [bdcacae8] LoopVectorization v0.12.12

julia> using LoopVectorization.SLEEFPirates  # fixes it

julia> let x=rand(10), y=zeros(10)
       @avx for i in 1:10
       y[i]= log10(x[i])
       end
       y
       end
10-element Vector{Float64}:
 -0.5899438714198465
 -0.06561577333335653
...

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions