// // This file is part of the Bones source-to-source compiler examples. The C-code // is largely identical in terms of functionality and variable naming to the code // found in PolyBench/C version 3.2. For more information on PolyBench/C or Bones // please use the contact information below. // // == More information on PolyBench/C // Contact............Louis-Noel Pouchet // Web address........http://polybench.sourceforge.net/ // // == More information on Bones // Contact............Cedric Nugteren // Web address........http://parse.ele.tue.nl/bones/ // // == File information // Filename...........benchmark/durbin.c // Author.............Cedric Nugteren // Last modified on...03-Jul-2012 // #include "common.h" // This is 'durbin', an algorithm to solve an equation involving a Toeplitz matrix using the Levinson-Durbin recursion int main(void) { int i,j,k; float alpha_k; // Declare arrays on the stack float alpha[NX]; float beta[NX]; float r[NX]; float y[NX][NX]; float sum[NX][NX]; float out[NX]; // Set the input data for (i=0; i y[0:k-1,k:k]|element for (i = 0; i <= k - 1; i++) { y[i][k] = y[i][k - 1] + alpha_k * y[k - i - 1][k - 1]; } #pragma species endkernel durbin_k11 y[k][k] = alpha[k]; } #pragma species kernel y[0:NX-1,NX-1:NX-1]|element -> out[0:NX-1]|element for (i = 0; i < NX; i++) { out[i] = y[i][NX - 1]; } #pragma species endkernel durbin_k5 } #pragma endscop // Clean-up and exit the function fflush(stdout); return 0; }