Skip to content

Commit e180162

Browse files
authored
Merge pull request #366 from JuliaGPU/tb/rm_math_overrides
Remove backend-specific math functionality.
2 parents d9cc5a8 + 9f1df65 commit e180162

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

src/host/random.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ function Random.randn!(rng::RNG, A::AnyGPUArray{T}) where T <: Number
9898
idx = 2*(linear_index(ctx) - 1) + 1
9999
U1 = gpu_rand(T, ctx, randstates)
100100
U2 = gpu_rand(T, ctx, randstates)
101-
Z0 = sqrt(ctx, T(-2.0)*log(ctx, U1))*cos(ctx, T(2pi)*U2)
102-
Z1 = sqrt(ctx, T(-2.0)*log(ctx, U1))*sin(ctx, T(2pi)*U2)
101+
Z0 = sqrt(T(-2.0)*log(U1))*cos(T(2pi)*U2)
102+
Z1 = sqrt(T(-2.0)*log(U1))*sin(T(2pi)*U2)
103103
@inbounds a[idx] = Z0
104104
idx + 1 > length(a) && return
105105
@inbounds a[idx + 1] = Z1

test/jlarray.jl

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -271,13 +271,6 @@ Base.similar(bc::Broadcasted{JLArrayStyle{N}}, ::Type{T}, dims) where {N,T} =
271271
JLArray{T}(undef, dims)
272272

273273

274-
## math
275-
276-
for f in (:cos, :sin, :sqrt, :log)
277-
@eval GPUArrays.$f(ctx::JLKernelContext, x) = $f(x)
278-
end
279-
280-
281274
## memory operations
282275

283276
function Base.copyto!(dest::Array{T}, d_offset::Integer,

0 commit comments

Comments
 (0)