Closed igouy closed 5 years ago
Could you elaborate? What do you mean when you say "needs to be"?
The Julia programs were written to avoid defining one function and a few function calls, but the program will not be shown on the benchmarks game website unless that function is defined and those function calls are performed.
So just something like
diff --git a/spectralnorm/spectralnorm-fast.jl b/spectralnorm/spectralnorm-fast.jl
index 87982f2..e1438f8 100644
--- a/spectralnorm/spectralnorm-fast.jl
+++ b/spectralnorm/spectralnorm-fast.jl
@@ -31,16 +31,19 @@ end
end
end
+@inline function AtAu!(w, v, u)
+ Au!(w, u)
+ Atu!(v, w)
+end
+
function perf_spectralnorm(n::Int=100)
u = ones(Float64, n)
v = zeros(Float64 ,n)
w = zeros(Float64, n)
vv = vBv = 0
for i = 1:10
- Au!(w, u)
- Atu!(v, w)
- Au!(w, v)
- Atu!(u, w)
+ AtAu!(w, v, u)
+ AtAu!(w, u, v)
end
@inbounds @simd for i = 1:n
vBv += u[i]*v[i]
?
Yes.
needs to be something like