Skip to content

Commit

Permalink
ok, ok these methods were needed
Browse files Browse the repository at this point in the history
  • Loading branch information
vchuravy committed Aug 24, 2018
1 parent 682b40a commit ee75d66
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/mapreduce.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@

Base.any(A::GPUArray{Bool}) = mapreduce(identity, |, false, A)
Base.all(A::GPUArray{Bool}) = mapreduce(identity, &, true, A)
Base.count(pred, A::GPUArray) = Int(mapreduce(pred, +, 0, A))

Base.any(f::Function, A::GPUArray) = mapreduce(f, |, false, A)
Base.all(f::Function, A::GPUArray) = mapreduce(f, &, true, A)
Base.count(pred::Function, A::GPUArray) = Int(mapreduce(pred, +, 0, A))

Base.:(==)(A::GPUArray, B::GPUArray) = Bool(mapreduce(==, &, true, A, B))

Expand Down

0 comments on commit ee75d66

Please sign in to comment.