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

vmapreduce: no method matching reduce_to_onevec #423

Open
nsajko opened this issue Aug 23, 2022 · 1 comment
Open

vmapreduce: no method matching reduce_to_onevec #423

nsajko opened this issue Aug 23, 2022 · 1 comment

Comments

@nsajko
Copy link

nsajko commented Aug 23, 2022

vmapreduce_bugreport.jl:

using LoopVectorization

f(a) =
  (a, a)

g(a, b) =
  let (q, w) = a, (e, r) = b
    (min(q, e), max(w, r))
  end

myminmax_mapreduce(x) =
  mapreduce(f, g, x)

myminmax_vmapreduce(x) =
  vmapreduce(f, g, x)

const inp = rand(1:9, 100)

myminmax_mapreduce(inp)

myminmax_vmapreduce(inp)

nothing
$ julia -O3 --min-optlevel=3 -g 2 --threads 4
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.8.0 (2022-08-17)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> include("vmapreduce_bugreport.jl")
ERROR: LoadError: MethodError: no method matching reduce_to_onevec(::typeof(g), ::Tuple{VectorizationBase.VecUnroll{3, 4, Int64, VectorizationBase.Vec{4, Int64}}, VectorizationBase.VecUnroll{3, 4, Int64, VectorizationBase.Vec{4, Int64}}})
Closest candidates are:
  reduce_to_onevec(::F, ::VectorizationBase.VecUnroll) where F at ~/.julia/packages/VectorizationBase/oCgEJ/src/VectorizationBase.jl:504
Stacktrace:
 [1] _vmapreduce
   @ ~/.julia/packages/LoopVectorization/aw6pf/src/simdfunctionals/mapreduce.jl:83 [inlined]
 [2] vmapreduce
   @ ~/.julia/packages/LoopVectorization/aw6pf/src/simdfunctionals/mapreduce.jl:62 [inlined]
 [3] myminmax_vmapreduce(x::Vector{Int64})
   @ Main ~/vmapreduce_bugreport.jl:14
 [4] top-level scope
   @ ~/vmapreduce_bugreport.jl:21
 [5] include(fname::String)
   @ Base.MainInclude ./client.jl:476
 [6] top-level scope
   @ REPL[1]:1
in expression starting at /home/nsajko/vmapreduce_bugreport.jl:21
@chriselrod
Copy link
Member

The code here shouldn't be that hard to read. You're welcome to try and tackle 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