Skip to content

Error: "Don't know how to handle expression: ..." #26

@hofmannmartin

Description

@hofmannmartin

Hi @chriselrod,

something seem to be broken in version v0.3.10. i get

"Don't know how to handle expression:\nzre += xre[i] * Are[i, k] - xim[i] * Aim[i, k]"

Stacktrace:
 [1] push!(::LoopVectorization.LoopSet, ::Expr, ::Int64) at /home/moeddel/.julia/packages/LoopVectorization/WdP5f/src/graphs.jl:539
 [2] add_block!(::LoopVectorization.LoopSet, ::Expr, ::Int64) at /home/moeddel/.julia/packages/LoopVectorization/WdP5f/src/graphs.jl:310
 [3] add_loop!(::LoopVectorization.LoopSet, ::Expr, ::Int64) at /home/moeddel/.julia/packages/LoopVectorization/WdP5f/src/graphs.jl:401
 [4] add_loop! at /home/moeddel/.julia/packages/LoopVectorization/WdP5f/src/graphs.jl:398 [inlined]
 [5] copyto! at /home/moeddel/.julia/packages/LoopVectorization/WdP5f/src/constructors.jl:6 [inlined]
 [6] LoopVectorization.LoopSet(::Expr) at /home/moeddel/.julia/packages/LoopVectorization/WdP5f/src/constructors.jl:45
 [7] @avx(::LineNumberNode, ::Module, ::Any) at /home/moeddel/.julia/packages/LoopVectorization/WdP5f/src/constructors.jl:93

when executing

using LoopVectorization

function test_avx(xre::Vector{T}, xim::Vector{T}, Are::Matrix{T}, Aim::Matrix{T}, k::Int) where {T<:AbstractFloat}
    zre = zero(T)
    zim = zero(T)
    @avx for i  1:length(xre)
        zre += xre[i]*Are[i,k] - xim[i]*Aim[i,k]
        zim += xre[i]*Aim[i,k] + xim[i]*Are[i,k]
    end
    return Complex{T}(zre,zim)
end

function test_avx(x::StructVector{Complex{T}}, A::StructArray{Complex{T},2}, k::Int) where {T<:AbstractFloat}
    return test_avx(x.re, x.im, A.re , A.im, k)
end

test_avx(b, A, k)

Metadata

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