Integrating Task and Data Parallelism in UC.

Maneesh Dhagat, Rajive L. Bagrodia, K. Mani Chandy · 1995

loat areal[N], aimag[N]; float breal[N], bimag[N]; float creal[N], cimag[N]; for (l = 0; l ! L; l++) -- fft(areal, aimag, true); fft(breal, bimag, true); /* pointwise multiply */ creal[k] = areal[k]*breal[k] - aimag[k]*bimag[k]; cimag[k] = areal[k]*bimag[k] + breal[k]*aimag[k];; fft(creal, creal, false); #endif /* DATAPARALLEL */ 23 A Polynomial Multiplication (FFT) UC code #define PI 3.141592654 #define L 20 #define N 1024 range K:k=--0..N-1; void fft(float areal[N], float aimag[N], bool forward) -- int s, m, j, c = 1, ub = log(N)/log(2); float treal[N], timag[N], ureal[N], uimag[N]; float tmpreal[N], tmpimag[N], wrealfact[N], wimagfact[N]; float wreal, wimag, wmreal, wmimag, tmp; int dst[N], myk[N], bitmap[N]; channel x[N]; /****** initialize *******/ if (forward) readinput(a); /****** put a in bit-reverse order ******/ arb (K) -- myk[k] = k; dst[k] = 0; for (s = ub-1; s ?= 0; s--) -- arb (K) -- bitmap[k] = 1; if (myk[k] ?= pow(

Read the paper · More papers on PaperTik