JuliaGPU / JuliaGPU/ArrayFire.jl

broadcast issue

Aperta
#249 0 commenti 3 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Julia
Stelle
207
Fork
33
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Start with the Base.Broadcast.BroadcastStyle(::Type{AFArray}) and materialize! stack frames shown in the report, then inspect how AFArray participates in Julia broadcasting. Reproduce `a .= a .+ b` with AFArray values and compare the behavior with the cited CuArrays interoperability goal. Done means the broadcasted assignment no longer raises the ndims MethodError.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
julia
Ambito
backend-api-design
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.