Skip to content

Commit

Permalink
WIP Workaround a problem with view of ROCArray
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf committed Apr 8, 2021
1 parent 7edb86e commit a511ee2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/transduce.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ end
function transduce_impl(device, groupsize, basesize, rf::F, init, arrays...) where {F}
(ys, buf) = transduce!(nothing, device, groupsize, basesize, rf, init, arrays...)
# @info "ys, = transduce!(nothing, rf, ...)" ys
length(ys) == 1 && return @allowscalar ys[1]
length(ys) == 1 && return @allowscalar ys[begin:end][1]
monoid = asmonoid(always_combine(rf))
rf2 = Map(first)'(monoid) # TODO: reduce wrapping
dest = ys
while true
ys, = transduce!(buf, device, groupsize, basesize, rf2, InitialValue(monoid), ys)
# @info "ys, = transduce!(buf, rf2, ...)" ys
length(ys) == 1 && return @allowscalar ys[1]
length(ys) == 1 && return @allowscalar ys[begin:end][1]
dest, buf = buf, dest
# reusing buffer; is it useful?
end
Expand Down

0 comments on commit a511ee2

Please sign in to comment.