/mobile Handheld Friendly website
Ubuntu : Intel® Q6600® quad-core |
Each table row shows performance measurements for this Ada 2005 GNAT program with a particular command-line input value N.
| N | CPU secs | Elapsed secs | Memory KB | Code B | ≈ CPU Load |
|---|---|---|---|---|---|
| 500 | 0.18 | 0.19 | ? | 710 | 5% 0% 100% 5% |
| 3,000 | 6.48 | 6.49 | 1,232 | 710 | 59% 0% 0% 42% |
| 5,500 | 21.76 | 21.78 | 1,232 | 710 | 97% 0% 0% 3% |
Read the ↓ make, command line, and program output logs to see how this program was run.
Read spectral-norm benchmark to see what this program should do.
GNATMAKE 4.6
gcc (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3
----------------------------------------- -- The Computer Language Benchmarks Game -- http://benchmarksgame.alioth.debian.org/ -- -- Contributed by Jim Rogers ----------------------------------------- package Spectral_Utils is type Matrix is array(Natural range <>) of Long_Float; function Eval_A(I, J : Integer) return Long_Float; procedure Eval_A_Times(U : Matrix; Au : out Matrix); procedure Eval_At_Times(U : Matrix; Au : out Matrix); procedure Eval_Ata_Times_U(U : Matrix; Atau : out Matrix); end Spectral_Utils; ----------------------------------------- -- The Great Computer Language Shootout -- -- Contributed by Jim Rogers ----------------------------------------- package body Spectral_Utils is function Eval_A (I, J : Integer) return Long_Float is begin return 1.0 / Long_Float((I + J) * (I + J + 1) /2 + I + 1); end Eval_A; procedure Eval_A_Times (U : Matrix; Au : out Matrix) is begin for I in Au'range loop Au(I) := 0.0; for J in U'range loop Au(I) := Au(I) + Eval_A(I, J) * U(J); end loop; end loop; end Eval_A_Times; procedure Eval_At_Times (U : Matrix; Au : out Matrix) is begin for I in Au'range loop Au(I) := 0.0; for J in U'range loop Au(I) := Au(I) + Eval_A(J, I) * U(J); end loop; end loop; end Eval_At_Times; procedure Eval_Ata_Times_U (U : Matrix; Atau : out Matrix) is V : Matrix(0..U'Length - 1); begin Eval_A_Times(U, V); Eval_At_Times(V, Atau); end Eval_Ata_Times_U; end Spectral_Utils; ----------------------------------------------------------- -- The Great Computer Language Shootout -- -- Contributed by Jim Rogers ----------------------------------------------------------- with Ada.Text_Io; with Ada.Numerics.Generic_Elementary_Functions ; with Ada.Command_Line; use Ada.Command_Line; with Spectral_Utils; use Spectral_Utils; procedure SpectralNorm is package Long_Io is new Ada.Text_Io.Float_Io(Long_Float); package Long_Funcs is new Ada.Numerics.Generic_Elementary_Functions(Long_Float); use Long_Funcs; N : Natural := 100; Vbv, vv : Long_Float := 0.0; begin if Argument_Count = 1 then N := Natural'Value(Argument(1)); end if; declare U : Matrix(0..N-1) := (Others => 1.0); V : Matrix(0..N-1) := (Others => 0.0); begin for I in 1..10 loop Eval_Ata_Times_U(U, V); Eval_Ata_Times_U(V, U); end loop; for I in V'range loop Vbv := Vbv + U(I) * V(I); Vv := Vv + V(I)*V(I); end loop; end; Long_Io.Put(Item => Sqrt(Vbv/Vv), Fore => 1, Aft => 9, Exp => 0); Ada.Text_Io.New_Line; end SpectralNorm;
Sat, 27 Apr 2013 17:13:44 GMT MAKE: /usr/bin/gnatchop -r -w spectralnorm.gnat splitting spectralnorm.gnat into: spectral_utils.ads spectral_utils.adb spectralnorm.adb /usr/bin/gnatmake -O3 -fomit-frame-pointer -march=native -msse3 -mfpmath=sse -gnatNp -f spectralnorm.adb -o spectralnorm.gnat_run gcc-4.6 -c -O3 -fomit-frame-pointer -march=native -msse3 -mfpmath=sse -gnatNp spectralnorm.adb gcc-4.6 -c -O3 -fomit-frame-pointer -march=native -msse3 -mfpmath=sse -gnatNp spectral_utils.adb gnatbind -x spectralnorm.ali gnatlink spectralnorm.ali -O3 -fomit-frame-pointer -march=native -msse3 -mfpmath=sse -o spectralnorm.gnat_run 0.59s to complete and log all make actions COMMAND LINE: ./spectralnorm.gnat_run 5500 PROGRAM OUTPUT: 1.274224153