// ************************************************************************** // // // // eses eses // // eses eses // // eses eseses esesese eses Embedded Systems Group // // ese ese ese ese ese // // ese eseseses eseseses ese Department of Computer Science // // eses eses ese eses // // eses eseses eseseses eses University of Kaiserslautern // // eses eses // // // // ************************************************************************** // [16]nat x; thread ParallelPrefixTree_16 { [16]nat y; y[0] = x[0]; y[1] = x[1]; y[2] = x[2]; y[3] = x[3]; y[4] = x[4]; y[5] = x[5]; y[6] = x[6]; y[7] = x[7]; y[8] = x[8]; y[9] = x[9]; y[10] = x[10]; y[11] = x[11]; y[12] = x[12]; y[13] = x[13]; y[14] = x[14]; y[15] = x[15]; // up-level 0 y[1] = y[0] + y[1]; y[3] = y[2] + y[3]; y[5] = y[4] + y[5]; y[7] = y[6] + y[7]; y[9] = y[8] + y[9]; y[11] = y[10] + y[11]; y[13] = y[12] + y[13]; y[15] = y[14] + y[15]; // up-level 1 y[3] = y[1] + y[3]; y[7] = y[5] + y[7]; y[11] = y[9] + y[11]; y[15] = y[13] + y[15]; // up-level 2 y[7] = y[3] + y[7]; y[15] = y[11] + y[15]; // up-level 3 y[15] = y[7] + y[15]; // up-level 4 // down-level 5 // down-level 6 y[11] = y[7] + y[11]; // down-level 7 y[5] = y[3] + y[5]; y[9] = y[7] + y[9]; y[13] = y[11] + y[13]; // down-level 8 y[2] = y[1] + y[2]; y[4] = y[3] + y[4]; y[6] = y[5] + y[6]; y[8] = y[7] + y[8]; y[10] = y[9] + y[10]; y[12] = y[11] + y[12]; y[14] = y[13] + y[14]; x[0] = y[0]; x[1] = y[1]; x[2] = y[2]; x[3] = y[3]; x[4] = y[4]; x[5] = y[5]; x[6] = y[6]; x[7] = y[7]; x[8] = y[8]; x[9] = y[9]; x[10] = y[10]; x[11] = y[11]; x[12] = y[12]; x[13] = y[13]; x[14] = y[14]; x[15] = y[15]; }