ArrayFire.jl icon indicating copy to clipboard operation
ArrayFire.jl copied to clipboard

union of arrays of length 1 does not work

Open ghost opened this issue 7 years ago • 1 comments

Taking union works when the arrays are of length > 1:

julia> Array(union(AFArray([1,2]), AFArray([4,54]))) 4-element Array{Int64,1}: 1 2 4 54

but not when arrays are of length 1:

julia> Array(union(AFArray([1]), AFArray([4]))) ERROR: ArrayFire Error (202) : Invalid input argument in throwAFerror(::Int32) at /Users/alha02/.julia/v0.5/ArrayFire/src/error.jl:50 in af_set_union(::Base.RefValue{Ptr{Void}}, ::ArrayFire.AFArray{Int64,1}, ::ArrayFire.AFArra y{Int64,1}, ::Bool) at /Users/alha02/.julia/v0.5/ArrayFire/src/wrap.jl:206 in #union#50(::Bool, ::Function, ::ArrayFire.AFArray{Int64,1}, ::ArrayFire.AFArray{Int64,1}) at /Users/alha02/.julia/v0.5/ArrayFire/src/vector.jl:112 in union(::ArrayFire.AFArray{Int64,1}, ::ArrayFire.AFArray{Int64,1}) at /Users/alha02/.julia /v0.5/ArrayFire/src/vector.jl:111

even though they have the same type:

julia> Array(AFArray([1])) 1-element Array{Int64,1}: 1

julia> Array(AFArray([1, 4])) 2-element Array{Int64,1}: 1 4

ghost avatar Dec 04 '16 17:12 ghost

Hi @alha02, thanks for pointing this out. This is an error in the original C++ library, and I've filed a bug report here (https://github.com/arrayfire/arrayfire/issues/1660).

ranjanan avatar Dec 05 '16 11:12 ranjanan