JuliaGPU / JuliaGPU/ArrayFire.jl

union of arrays of length 1 does not work

Open
#99 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
207
Forks
33
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.