-
Notifications
You must be signed in to change notification settings - Fork 67
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
MethodError: no method matching vload(::Ptr{Float64}, ::Int64, ::Mask{4,UInt8}) #116
Comments
Thanks for the report. I'm overhauling how indexing is handled on LoopVectorization master, so I'll add this as a test case for the 0.8 release and make sure it's resolved. As a hotfix, I think the vload method at VectorizationBase.jl/src/vectorizable.jl L217 should be @inline function vload(ptr::AbstractPointer, i::Tuple, u::Union{AbstractMask,Unsigned})
vload(ptr.ptr, offset(ptr, staticm1(i)), extract_data(u))
end instead of the current definition (shown in long form below for readability) @inline function vload(ptr::AbstractPointer, i::Tuple, u::Union{AbstractMask,Unsigned})
vload(ptr.ptr, offset(ptr, staticm1(i)), u)
end but I'd have to make sure this doesn't break other code, since the call may be recursive and the method for |
On my local versions... julia> function avx_problem(x::AbstractVector{T}, m) where T
N = length(x)
n = N-m+1
ent = zeros(T, N)
x isa AbstractVector && (x = x')
@avx for i = 1:N
for j = 1:size(x,1)
ent[i] += x[j,i]*log(x[j,i])
end
end
ent
end
avx_problem (generic function with 1 method)
julia> x = rand(10);
julia> e1 = avx_problem(x, 4);
julia> e1
10-element Array{Float64,1}:
-0.014324309330997381
-0.3574754936802546
-0.1615672896072288
-0.3575533568057155
-0.3080345204163032
-0.28612490368920807
-0.11497348037080715
-0.08191664892303317
-0.2838872967103637
-0.3384879959637381
julia> function no_avx_problem(x::AbstractVector{T}, m) where T
N = length(x)
n = N-m+1
ent = zeros(T, N)
x isa AbstractVector && (x = x')
for i = 1:N
for j = 1:size(x,1)
ent[i] += x[j,i]*log(x[j,i])
end
end
ent
end
no_avx_problem (generic function with 1 method)
julia> e2 = no_avx_problem(x, 4);
julia> e2
10-element Array{Float64,1}:
-0.014324309330997381
-0.3574754936802546
-0.1615672896072288
-0.3575533568057155
-0.30803452041630325
-0.2861249036892081
-0.11497348037080715
-0.08191664892303317
-0.2838872967103638
-0.3384879959637381 |
Finally merged the branch into master. I'll register shortly. |
Trying to produce a MWE for another problem, I stumbled into the following. If the length of
x
is changed to 12, the error goes away.The text was updated successfully, but these errors were encountered: