From ee75d660d7ef97a964037349849226cc55dd58ba Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Fri, 24 Aug 2018 09:36:28 -0700 Subject: [PATCH] ok, ok these methods were needed --- src/mapreduce.jl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mapreduce.jl b/src/mapreduce.jl index 87672532..1d76ccc3 100644 --- a/src/mapreduce.jl +++ b/src/mapreduce.jl @@ -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))