JuliaSIMD / JuliaSIMD/LoopVectorization.jl

Support for complex numbers?

Open
#19 16 comments 4 reactions 0 assignees View on GitHub
enhancement
Dominant language
Julia
Stars
789
Forks
73
PR merge metrics
No merged PRs in 30d

Description

Does `LoopVectorization` support complex vectors? E.g.
```julia
using LoopVectorization

function test_avx!(x::Vector, y::Vector, beta)
@avx for n=1:length(x)
x[n] += conj(beta)*y[n]
end
end

# set up
T = ComplexF32
N = 1024

x = zeros(T,N)
y = rand(T,N)
β = rand(T)
# end set up

test_avm!(x,y,β)
```
gives me the following error
```
KeyError: key Complex{Float32} not found

Stacktrace:
[1] getindex at ./dict.jl:477 [inlined]
[2] llvmtype(::Type) at /home/moeddel/.julia/packages/VectorizationBase/hBLD0/src/vectorizable.jl:21
[3] #s24#123 at /home/moeddel/.julia/packages/SIMDPirates/aKvPC/src/memory.jl:94 [inlined]
[4] #s24#123(::Any, ::Any, ::Any, ::Any, ::Any, ::Type, ::Any, ::Type, ::Any) at ./none:0
[5] (::Core.GeneratedFunctionStub)(::Any, ::Vararg{Any,N} where N) at ./boot.jl:524
[6] vload at /home/moeddel/.julia/packages/SIMDPirates/aKvPC/src/memory.jl:218 [inlined]
[7] macro expansion at ./gcutils.jl:91 [inlined]
[8] test_avm!(::Array{Complex{Float32},1}, ::Array{Complex{Float32},1}, ::Complex{Float32}) at ./In[26]:4
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.