@@ -8,7 +8,7 @@ function broadcast_kernel(op::Function, x::WgpuArray{T, N}, y::WgpuArray{T, N},
88 out[gId] = op (x[gId], y[gId])
99end
1010
11- function broadcast_kernel (op:: Function , x:: WgpuArray{T, N} , y:: Number , out:: WgpuArray{T, N} ) where {T, N}
11+ function broadcast_kernel (op:: Function , x:: WgpuArray{T, N} , y:: Float32 , out:: WgpuArray{T, N} ) where {T, N}
1212 xdim = workgroupDims. x
1313 ydim = workgroupDims. y
1414 gIdx = workgroupId. x* xdim + localId. x
@@ -44,15 +44,15 @@ function elwise(f::Function, a::Number, b::WgpuArray{T, N}) where {T, N}
4444 return out
4545end
4646
47- # Base.:+(a::WgpuArray{T, N}, b::WgpuArray{T, N}) where {T, N} = elwise(+, a, b)
48- # Base.:-(a::WgpuArray{T, N}, b::WgpuArray{T, N}) where {T, N} = elwise(-, a, b)
49- # Base.:*(a::WgpuArray{T, N}, b::WgpuArray{T, N}) where {T, N} = elwise(*, a, b)
50- # Base.:/(a::WgpuArray{T, N}, b::WgpuArray{T, N}) where {T, N} = elwise(/, a, b)
51- # Base.:+(a::WgpuArray{T, N}, b::Number) where {T, N} = elwise(+, a, b)
52- # Base.:-(a::WgpuArray{T, N}, b::Number) where {T, N} = elwise(-, a, b)
53- # Base.:*(a::WgpuArray{T, N}, b::Number) where {T, N} = elwise(*, a, b)
54- # Base.:/(a::WgpuArray{T, N}, b::Number) where {T, N} = elwise(/, a, b)
55- # Base.:+(a::Number, b::WgpuArray{T, N}) where {T, N} = elwise(+, a, b)
56- # Base.:-(a::Number, b::WgpuArray{T, N}) where {T, N} = elwise(-, a, b)
57- # Base.:*(a::Number, b::WgpuArray{T, N}) where {T, N} = elwise(*, a, b)
58- # Base.:/(a::Number, b::WgpuArray{T, N}) where {T, N} = elwise(/, a, b)
47+ Base.:+ (a:: WgpuArray{T, N} , b:: WgpuArray{T, N} ) where {T, N} = elwise (+ , a, b)
48+ Base.:- (a:: WgpuArray{T, N} , b:: WgpuArray{T, N} ) where {T, N} = elwise (- , a, b)
49+ Base.:* (a:: WgpuArray{T, N} , b:: WgpuArray{T, N} ) where {T, N} = elwise (* , a, b)
50+ Base.:/ (a:: WgpuArray{T, N} , b:: WgpuArray{T, N} ) where {T, N} = elwise (/ , a, b)
51+ Base.:+ (a:: WgpuArray{T, N} , b:: Number ) where {T, N} = elwise (+ , a, b)
52+ Base.:- (a:: WgpuArray{T, N} , b:: Number ) where {T, N} = elwise (- , a, b)
53+ Base.:* (a:: WgpuArray{T, N} , b:: Number ) where {T, N} = elwise (* , a, b)
54+ Base.:/ (a:: WgpuArray{T, N} , b:: Number ) where {T, N} = elwise (/ , a, b)
55+ Base.:+ (a:: Number , b:: WgpuArray{T, N} ) where {T, N} = elwise (+ , a, b)
56+ Base.:- (a:: Number , b:: WgpuArray{T, N} ) where {T, N} = elwise (- , a, b)
57+ Base.:* (a:: Number , b:: WgpuArray{T, N} ) where {T, N} = elwise (* , a, b)
58+ Base.:/ (a:: Number , b:: WgpuArray{T, N} ) where {T, N} = elwise (/ , a, b)
0 commit comments