Skip to content

Commit 38b0345

Browse files
committed
benchmark artefacts removed
1 parent f163176 commit 38b0345

File tree

1 file changed

+0
-60
lines changed

1 file changed

+0
-60
lines changed

src/gradients.jl

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -87,64 +87,4 @@ function ∇²(u::Array{T,2},Δ::Real=1) where {T<:AbstractFloat}
8787
end
8888
end
8989
return du
90-
end
91-
92-
93-
function benchmark_it(N::Vector{Int})
94-
95-
timings = fill(0.0,3,length(N))
96-
97-
for (i,n) in enumerate(N)
98-
for (j,T) in enumerate([Float64,Float32,Float16])
99-
A = rand(T,n,n)
100-
B = rand(T,n,n)
101-
C = rand(T,n,n)
102-
D = rand(T,n,n)
103-
E = rand(T,n,n)
104-
F = rand(T,n,n)
105-
R = zero(A)
106-
timings[j,i] = minimum(@benchmark add!($R,$A,$B,$C,$D,$E,$F) samples=100 evals=1).time
107-
end
108-
end
109-
110-
print("N= ")
111-
for n in N
112-
print(@sprintf(" %4d,",n))
113-
end
114-
println()
115-
116-
for (iT,T) in enumerate([Float64,Float32,Float16])
117-
print("$T:")
118-
for t in 1:length(N)
119-
trel = timings[1,t]/timings[iT,t]
120-
print(@sprintf(" %.3fx,",trel))
121-
end
122-
println()
123-
end
124-
end
125-
126-
127-
function add!(R::Matrix{T},
128-
A::Matrix{T},
129-
B::Matrix{T},
130-
C::Matrix{T},
131-
D::Matrix{T},
132-
E::Matrix{T},
133-
F::Matrix{T},
134-
G::Matrix{T},
135-
H::Matrix{T}) where {T<:AbstractFloat}
136-
137-
m,n = size(R)
138-
@boundscheck size(R) == size(A) || throw(BoundsError())
139-
@boundscheck size(R) == size(B) || throw(BoundsError())
140-
@boundscheck size(R) == size(C) || throw(BoundsError())
141-
@boundscheck size(R) == size(D) || throw(BoundsError())
142-
@boundscheck size(R) == size(E) || throw(BoundsError())
143-
@boundscheck size(R) == size(F) || throw(BoundsError())
144-
@boundscheck size(R) == size(G) || throw(BoundsError())
145-
@boundscheck size(R) == size(H) || throw(BoundsError())
146-
147-
@inbounds for i in eachindex(R)
148-
R[i] = A[i] + B[i] + C[i] + D[i] + E[i] + F[i] + G[i] + H[i]
149-
end
15090
end

0 commit comments

Comments
 (0)