Skip to content

Commit e54ba00

Browse files
committed
peakflops: make the element type a static parameter of the method
Otherwise `eltype` is inferred as merely `DataType`. Too bad that constprop doesn't fix this on its own. This should make the sysimage more resistant to invalidation (checking rn).
1 parent bfdb742 commit e54ba00

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/LinearAlgebra.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -750,10 +750,10 @@ of the problem that is solved on each processor.
750750
This function requires at least Julia 1.1. In Julia 1.0 it is available from
751751
the standard library `InteractiveUtils`.
752752
"""
753-
function peakflops(n::Integer=4096; eltype::DataType=Float64, ntrials::Integer=3, parallel::Bool=false)
753+
function peakflops(n::Integer=4096; eltype::Type{ElType}=Float64, ntrials::Integer=3, parallel::Bool=false) where {ElType}
754754
t = zeros(Float64, ntrials)
755755
for i=1:ntrials
756-
a = ones(eltype,n,n)
756+
a = ones(ElType,n,n)
757757
t[i] = @elapsed a2 = a*a
758758
@assert a2[1,1] == n
759759
end

0 commit comments

Comments
 (0)