mapreduce fails if init has different type
- Dominant language
- Julia
- Stars
- 1.4k
- Forks
- 281
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 30
Description
```
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
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.