Skip to content

mapreduce fails if init has different type #100

@maleadt

Description

@maleadt
julia> mapreduce((x) -> (x+1), +, rand(2,2); init=0)
5.16997158723571

julia> using CuArrays

julia> mapreduce((x) -> (x+1), +, cu(rand(2,2)); init=0)
ERROR: InvalidIRError: compiling partial_mapreduce_grid(var"#5#6", typeof(+), CUDAnative.CuDeviceArray{Float32,2,CUDAnative.AS.Global}, CUDAnative.CuDeviceArray{Int64,3,CUDAnative.AS.Global}, Int64, CartesianIndices{2,Tuple{Base.OneTo{Int64},Base.OneTo{Int64}}}, CartesianIndices{2,Tuple{Base.OneTo{Int64},Base.OneTo{Int64}}}, Int64, Val{true}) resulted in invalid LLVM IR
Reason: unsupported dynamic function invocation (call to reduce_block)
Stacktrace:
 [1] partial_mapreduce_grid at /home/tim/Julia/pkg/CuArrays/src/mapreduce.jl:122

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcuda arrayStuff about CuArray.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions