Skip to content

Commit e3e9987

Browse files
authored
peakflops: make eltype a static parameter of the method (#1253)
Otherwise `eltype` is inferred as merely `DataType`. Too bad that constprop doesn't fix this on its own. This will make the sysimage more resistant to invalidation, once JuliaLang/julia updates LinearAlgebra.
2 parents e53b50c + 781eb5d commit e3e9987

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
@@ -752,10 +752,10 @@ of the problem that is solved on each processor.
752752
This function requires at least Julia 1.1. In Julia 1.0 it is available from
753753
the standard library `InteractiveUtils`.
754754
"""
755-
function peakflops(n::Integer=default_peakflops_size; eltype::DataType=Float64, ntrials::Integer=3, parallel::Bool=false)
755+
function peakflops(n::Integer=default_peakflops_size; eltype::Type{ElType}=Float64, ntrials::Integer=3, parallel::Bool=false) where {ElType}
756756
t = zeros(Float64, ntrials)
757757
for i=1:ntrials
758-
a = ones(eltype,n,n)
758+
a = ones(ElType,n,n)
759759
t[i] = @elapsed a2 = a*a
760760
@assert a2[1,1] == n
761761
end

0 commit comments

Comments
 (0)