Skip to content

Compiler

Try ELI Compiler

  1. Download ecc and put in a designated directory DIR.
  2. Put source code with a main function mf in a mc.esf file, and add lparm and rparm variables to that file
  3. Execute ./ecc mc to get compiled C code mf.c in DIR.
  4. Execute gcc -o mf mf.c eli3lib.c -lm with eli3lib.h, elimacros.h reside in DIR to get object code mf.
  5. Prepare input file(s) (inm.lef and) inm.rig by export argument variable(s) from a workspace and modify.
  6. Run compiled C code: type mf inm in DIR to get result.

Try ecc now

Examples

Description

BlackSchole is a mathematical model of a financial market containing certain derivative investment instruments. (more)

Benchmark

Princeton PARSEC 3.0 (download)
Directory: parsec-3.0\pkgs\apps\blackscholes
Data: parsec-3.0\pkgs\apps\blackscholes\inputs

ELI code: save or html

@.OptionPrice<-timet BlkSchls RARG;sptprice;strike;rate;volatility;time;otype;otypeC;xRiskFreeRate;xSqrtTime;logValues;xLogTerm;xD1;xD2;xPowerTerm;xDen;d1;d2;FutureValueX;NofXd1;NofXd2;valuex;out1;out2;out3
(sptprice strike rate volatility time otypeC)<-RARG
xSqrtTime <- time *. 0.5
xLogTerm  <- logValues <- %. sptprice % strike
xRiskFreeRate <- rate
otype<-otypeC='P' // 5
d1<- xD1 <- (xLogTerm + time * xRiskFreeRate + xPowerTerm <- volatility * volatility * 0.5) % xDen <- volatility * xSqrtTime
d2<- xD2 <- xD1 - xDen // 7
invs2xPI <- 0.39894228040143270286 // 8
NofXd1 <- CNDF( d1 ) // 9
NofXd2 <- CNDF( d2 ) // 10
FutureValueX <- strike * *. - rate * time
OptionPrice <- otype * (FutureValueX * 1.0 - NofXd2) - (sptprice * 1.0 - NofXd1)
OptionPrice <- OptionPrice + (~otype) * (sptprice * NofXd1) - (FutureValueX * NofXd2)
@.

@.OutputX<-CNDF InputX;sign;xInput;xNPrimeofX;expValues;xK2;xK2_2;xK2_3;xK2_4;xK2_5;xLocal;xLocal_1;xLocal_2;xLocal_22;xLocal_23;xLocal_24;xLocal_25;xa1;xa2;xOut1;xOut2
sign <- InputX < 0
xInput <- | InputX 
xNPrimeofX <- invs2xPI * expValues <- *. _0.5 * InputX * InputX
xK2_5 <- xK2 * xK2_4 <- xK2 * xK2_3 <- xK2 * xK2_2 <- xK2 * xK2 <- 1.0 % 1.0 + 0.2316419 * xInput
xLocal_1 <- xK2 * 0.319381530     //  9
xLocal_2 <- (xK2_2 * _0.356563782) + (xK2_3 * 1.781477937) + (xK2_4 * _1.821255978) + xK2_5 * 1.330274429
OutputX<-(sign * 1.0 - xLocal) + (~sign) * xLocal <- 1.0 - xNPrimeofX * xLocal_2 + xLocal_1
@.

&LPARM C 1 18
'BlkSchls I(EEEEEC)'
&

&RPARM I 1 14
0 0 1 _1 1 _1 1 _1 1 _1 1 _1 1 _1
&

Description

k-means clustering is a method of vector quantization originally from signal processing, that is popular for cluster analysis in data mining. (more)

Benchmark

Rodinia 2.3 (download)
Directory: rodinia_2.3\openmp\kmeans
Data: rodinia_2.3\data\kmeans

ELI code: save or html

// kmeans for compilation
@.clusters<-k kmeans feature;np;nc;t0;t1;t2;df;dist;index;mb;preclust;preclen;curp;loop;delta
mb <- index <- (np <- 1 ^. df <- #feature) # loop <- _1  // 1
clusters <- (nc <- k, df[2]) ^. feature     //2
L0:preclust <- nc # curp <- 0               //3
preclen <- k # 0                            //4
L1:->(np < curp <- curp + 1)/L2             //5
index[curp] <- t0 <- dist ! _./ dist <- +/ ((nc # feature[curp;]) - clusters) *. 2  //6
preclust[t0;] <- preclust[t0;] + feature[curp;] //7
preclen[t0]  <- preclen[t0]  + 1            //8
->L1
L2: delta <- +/ mb ~= index
clusters[t2;] <- preclust[t2;] % &. (df[2],#t2) # preclen[t2 <- t1 / ! #t1 <- preclen ~= 0]
mb <- index
->((delta > 0.001)^(500 > loop<-loop+1))/L0
@.

&LPARM C 1 9
'kmeans IE'
&

&RPARM I 1 5
1 0 2 _1 _1
&

Description

HotSpot is a widely used tool to estimate processor temperature based on an architectural floorplan and simulated power measurements. (more)

Benchmark

Rodinia 2.3 (download)
Directory: rodinia_2.3\openmp\hotspot
Data: rodinia_2.3\data\hotspot

ELI code: save or html

@.z<-temp hotspot power;Cap;Rx;Ry;Rz;step;k;cnt;m1;m2;x;n1;n2;y;c1;c2;row;col;gw;gh
t_chip <- 0.0005
height <- width <- 0.016
amb_temp <- 80.0
FACTOR_CHIP<-0.5
K_SI<- 100
SPEC_HEAT_SI <- 1750000
PRECISION <- 0.001
MAX_PD <- 3000000
cnt <- 2 // number of iteration
Cap <- FACTOR_CHIP * SPEC_HEAT_SI * t_chip * (gw <- width % col <- _1^.#temp) * gh <- height % row <- 1^.#temp
Rx <- gw % (2.0 * K_SI * t_chip * gh)
Ry <- gh % (2.0 * K_SI * t_chip * gw)
Rz <- t_chip % (K_SI * gh * gw)
step <- PRECISION % MAX_PD % (FACTOR_CHIP * t_chip * SPEC_HEAT_SI)
k <- 0
c1 <- c2 <- (row,col)#2
c1[;0,col-1] <- 1
c2[0,row-1;] <- 1
L0:->(cnt < k <- k + 1)/L1
m1 <- (0 1!.temp),0
m2 <- 0,0 _1!.temp
x <- (m1 + m2) - c1 * temp
n1 <- (1 0!.temp),[0]0
n2 <- 0,[0](_1 0)!.temp
y <- (n1 + n2) - c2 * temp
temp <- temp + (step % Cap) * (power + (x % Rx) + (y % Ry) + (amb_temp - temp) % Rz)
->L0
L1:z <- temp
@.

&LPARM C 1 10
'hotspot EE'
&

&RPARM I 1 7
0 2 _1 _1 2 _1 _1
&