3 # The range of grid sizes to consider
6 # The number of trials to consider. If this is set to one, the time
7 # for a single trial will be outputted. For higher values, the mean
8 # of all the trials will be outputted, along with the standard
12 # The flags to pass for code optimization. The second line is appropriate for
13 # Mac OS X, forcing more function inlining, and enabling the Apple-only "-fast"
14 # flag for maximum code optimization.
16 #$opt+="-fast --param large-function-growth=1000 --param max-inline-insns-single=2000";
20 # Compile the code with the current grid size
21 system "g++ -I../../src -DNNN=$r -o timing_test $opt timing_test.cc";
23 # Carry out the trials for this grid size
25 foreach $t (1..$tries) {
27 # Run the code, and output the timing information to the
29 system "./timing_test >time_temp";
31 # Read the "time_temp" file to find the duration of the run
32 open F
,"time_temp" or die "Can't open timing file: $!";
38 # Compute the mean and variance and print to standard output
40 $stt=$stt/$tries-$st*$st;$stt=$stt>0?
sqrt($stt):0;
41 print "$r $st $stt\n";
44 # Delete the temporary timing file
45 system "rm time_temp";