@@ -106,7 +106,7 @@ function anepeakflops(; kwargs...)
106106 return res
107107end
108108
109- function compare (Ns, Fs, inT, outT= inT; n_batch= 1 , ntrials)
109+ function compare (Ns, Fs, inT, outT= inT; n_batch= 1 , ntrials, verbose = true )
110110 results = Dict ()
111111
112112 newFs = if (outT == Float16 || (outT == Float32 && inT == Float16))
@@ -125,12 +125,12 @@ function compare(Ns, Fs, inT, outT=inT; n_batch=1, ntrials)
125125 verify = (n < maxintfloat (outT) && (inT != Float16 || (n < maxintfloat (inT))))
126126 n_str = " $n : "
127127 for (f, info_str) in newFs
128- print (prefixstr, n_str, info_str)
128+ verbose && print (prefixstr, n_str, info_str)
129129 push! (results[info_str], f (; inT, outT, n, n_batch, ntrials, verify))
130- GC. gc ()
130+ GC. gc (false )
131131 end
132132 end
133- print (" \3 3[2K\r " )
133+ verbose && print (" \3 3[2K\r " )
134134 end
135135 return results
136136end
@@ -144,10 +144,10 @@ DEFAULT_FS = [
144144 # (cpupeakflops, "CPU (AppleAccelerate)"), # Uncomment to test CPU performance
145145]
146146
147- function runcomparison (; Ns= DEFAULT_NS, Fs= DEFAULT_FS, n_batch= 1 , ntrials= 5 )
147+ function runcomparison (; Ns= DEFAULT_NS, Fs= DEFAULT_FS, n_batch= 1 , ntrials= 5 , verbose = true )
148148 res = Dict ()
149149 for (inT, outT) in Ts
150- res[(inT,outT)] = (n_batch, Ns, compare (Ns, Fs, inT, outT; n_batch, ntrials))
150+ res[(inT,outT)] = (n_batch, Ns, compare (Ns, Fs, inT, outT; n_batch, ntrials, verbose ))
151151 end
152152 return res
153153end
@@ -190,7 +190,7 @@ function plot_results(res, Fs=DEFAULT_FS; outpath=nothing, outtype="svg", plt_ti
190190end
191191
192192if testing
193- runcomparison (Ns= [50 , 64 , 100 , 128 , 250 , 256 , 500 , 512 ])
193+ runcomparison (; Ns= [50 , 64 , 100 , 128 , 250 , 256 , 500 , 512 ], verbose = false )
194194elseif abspath (PROGRAM_FILE ) == @__FILE__
195195 res = runcomparison ()
196196 plot_results (res; outpath= " ." )
0 commit comments