Skip to content

Commit ca04055

Browse files
committed
Update elemwise.jl
1 parent 840329c commit ca04055

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/ops/elemwise.jl

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -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])
99
end
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
4545
end
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

Comments
 (0)