Skip to content

Commit

Permalink
Remove use of rand in peakflops
Browse files Browse the repository at this point in the history
Add an assertion for correctness too.
Address #10349
  • Loading branch information
ViralBShah committed Mar 10, 2015
1 parent 493d444 commit 515ebed
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions base/linalg/generic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,11 @@ scale!(b::AbstractVector, A::AbstractMatrix) = scale!(A,b,A)
#findmin(a::AbstractArray)

function peakflops(n::Integer=2000; parallel::Bool=false)
a = rand(100,100)
t = @elapsed a*a
a = rand(n,n)
t = @elapsed a*a
a = ones(Float64,100,100)
t = @elapsed a2 = a*a
a = ones(Float64,n,n)
t = @elapsed a2 = a*a
@assert a2[1,1] == n
parallel ? sum(pmap(peakflops, [ n for i in 1:nworkers()])) : (2*Float64(n)^3/t)
end

Expand Down

0 comments on commit 515ebed

Please sign in to comment.