Post Reply 
Benchmark: Whetstones
12-04-2017, 12:01 AM (This post was last modified: 12-04-2017 12:02 AM by StephenG1CMZ.)
Post: #2
RE: Benchmark: Whetstones
Version 0.1 is a simple translation of the Original Algol benchmark.
No attempt has been made to optimise the PPL.
The figures here are not intended to be representative of what the PPL can achieve.


 LOCAL ID:="Whetstones V0.1 (UNVERIFIED)\nPPL StephenG1CMZ 2017";

 //Requires a procedure to output a list of reals
 //(to list,print or logfile)
 //IMPORT(OUTREAL);//See Benchmarks for example

  MSGBOX(" Aims to approximate the workload of Whetstone & verify that the algorithm is implementable in PPL.");
  MSGBOX("Neither accuracy nor timing is approved.");
  MSGBOX("The unoptimised version makes no attempt to improve loops.");


 LOCAL UnitST:="Mwhetstone";


 LOCAL TT:=0.499975;
 LOCAL T1:=0.50025;
 LOCAL T2:=2.0;

 LOCAL E1:={};//4
 LOCAL NK:={0,12,14,345,0,210,32,899,616,0,93};//11 ITERATION CONSTANTS



  LOCAL JJ:=0;
   EE(1):=( EE(1) + EE(2) + EE(3) - EE(4))*TT;
   EE(2):=( EE(1) + EE(2) - EE(3) + EE(4))*TT; 
   EE(3):=( EE(1) - EE(2) + EE(3) + EE(4))*TT;
   EE(4):=(−EE(1) + EE(2) + EE(3) + EE(4))*TT; 

 //Unoptimised:No PPL optimisation
   X4:=−1.0; X3:=X4; X2:=X3;
    X1:=( X1 + X2 + X3 - X4)*TT;
    X2:=( X1 + X2 - X3 + X4)*TT;
    X3:=( X1 - X2 + X3 + X4)*TT;
    X4:=(−X1 + X2 + X3 + X4)*TT;
   E1(4):=−1.0; E1(3):=E1(4); E1(2):=E1(3);
    E1(1):=( E1(1) + E1(2) + E1(3) - E1(4))*TT;
    E1(2):=( E1(1) + E1(2) - E1(3) + E1(4))*TT;
    E1(3):=( E1(1) - E1(2) + E1(3) + E1(4))*TT;
    E1(4):=(−E1(1) + E1(2) + E1(3) + E1(4))*TT; 
    IF JJ==1 THEN
    IF JJ>2 THEN
    IF JJ<1 THEN









  //END MODULE 11 




 EXPORT WhetstoneIt(ITER)
  RETURN WhetstoneItUnopt(ITER);

 EXPORT MegaWhetstone()

 EXPORT MegaWhetstones(Mwhetstones)

 EXPORT MWhetstone_s ()
  LOCAL TM:=TEVAL(MegaWhetstone);

  LOCAL TM:=MWhetstone_s();

  TM:=TM/1_s;//Remove Units
  //0s=>clock err or more Whetstones needed
  MWIPS:=IFTE(TM,ROUND((1/TM),6),"NaN");//Guard 0 Time


Stephen Lewkowicz (G1CMZ)
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
Benchmark: Whetstones - StephenG1CMZ - 12-03-2017, 11:51 PM
RE: Benchmark: Whetstones - StephenG1CMZ - 12-04-2017 12:01 AM
RE: Benchmark: Whetstones - StephenG1CMZ - 11-01-2018, 07:59 PM

User(s) browsing this thread: 1 Guest(s)