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

broadcast issue

Open rveltz opened this issue 6 years ago • 0 comments

Hi,

In order to have AF working alongside with CuArrays, I would need the following to work:

a .= a  .+ b

but it returns

julia> a .= a .+ b
ERROR: MethodError: no method matching ndims(::Type{AFArray{Float64,1}})
Closest candidates are:
  ndims(::Base.Generator) at generator.jl:53
  ndims(::Number) at number.jl:67
  ndims(::Type{#s75} where #s75<:Number) at number.jl:68
  ...
Stacktrace:
 [1] Base.Broadcast.BroadcastStyle(::Type{AFArray{Float64,1}}) at ./broadcast.jl:103
 [2] combine_styles(::AFArray{Float64,1}) at ./broadcast.jl:405
 [3] Base.Broadcast.Broadcasted(::typeof(identity), ::Tuple{AFArray{Float64,1}}, ::Tuple{Base.OneTo{Int64}}) at ./broadcast.jl:175
 [4] materialize!(::AFArray{Float64,1}, ::AFArray{Float64,1}) at ./broadcast.jl:804
 [5] top-level scope at REPL[7]:1

Is it an easy fix?

Btw you should consider making AF a backend for GPUArrays

Thank you,

Best

rveltz avatar Sep 23 '19 05:09 rveltz