Skip to content

Commit a29df67

Browse files
committed
Remove unused isapprox support.
1 parent 46a3383 commit a29df67

File tree

2 files changed

+0
-29
lines changed

2 files changed

+0
-29
lines changed

src/host/mapreduce.jl

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -178,14 +178,3 @@ function acc_mapreduce(f, op, v0::OT, A::GPUSrcArray, rest...) where {OT}
178178
target=out, threads=threads, blocks=blocks)
179179
reduce(op, Array(out))
180180
end
181-
182-
"""
183-
Same as Base.isapprox, but without keyword args and without nans
184-
"""
185-
function fast_isapprox(x::Number, y::Number, rtol::Real = Base.rtoldefault(x, y), atol::Real=0)
186-
x == y || (isfinite(x) && isfinite(y) && abs(x-y) <= max(atol, rtol*max(abs(x), abs(y))))
187-
end
188-
189-
Base.isapprox(A::AbstractGPUArray{T1}, B::AbstractGPUArray{T2}, rtol::Real = Base.rtoldefault(T1, T2, 0), atol::Real=0) where {T1, T2} = all(fast_isapprox.(A, B, T1(rtol)|>real, T1(atol)|>real))
190-
Base.isapprox(A::AbstractArray{T1}, B::AbstractGPUArray{T2}, rtol::Real = Base.rtoldefault(T1, T2, 0), atol::Real=0) where {T1, T2} = all(fast_isapprox.(A, Array(B), T1(rtol)|>real, T1(atol)|>real))
191-
Base.isapprox(A::AbstractGPUArray{T1}, B::AbstractArray{T2}, rtol::Real = Base.rtoldefault(T1, T2, 0), atol::Real=0) where {T1, T2} = all(fast_isapprox.(Array(A), B, T1(rtol)|>real, T1(atol)|>real))

test/testsuite/mapreduce.jl

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -58,23 +58,5 @@ function test_mapreduce(AT)
5858
@test A !== deepcopy(A)
5959
end
6060
end
61-
62-
@testset "isapprox" begin
63-
for ET in supported_eltypes()
64-
ET <: Complex && continue
65-
A = fill(AT{ET}, ET(0), (100,))
66-
B = ones(AT{ET}, 100)
67-
@test !(A B)
68-
@test !(A Array(B))
69-
@test !(Array(A) B)
70-
71-
72-
ca = AT(randn(ComplexF64,3,3))
73-
cb = copy(ca)
74-
cb[1:1, 1:1] .+= 1e-7im
75-
@test isapprox(ca, cb, atol=1e-5)
76-
@test !isapprox(ca, cb, atol=1e-9)
77-
end
78-
end
7961
end
8062
end

0 commit comments

Comments
 (0)