Forum Discussion
Altera_Forum
Honored Contributor
7 years agoIf the problem is with variable loop limits of inner loop, I wonder why below code doesn't have this problem too, and both loops are pipelined (according to report).
In first problematic code (mentioned earlier), in a graph, a constant value is written to children nodes of every parent node, but in below code, value of children nodes are read, and their summation is written to their parent node. In earlier code, there is a random-access write, however in second one, we have random-access read. Can this be the source of pipelining problem? __attribute__ ((task)) __kernel void compute_pagerank( __global const unsigned* restrict ovid_of_edge, __global const unsigned* restrict start_edge, __global const unsigned* restrict end_edge, __global unsigned* restrict node_data, __global unsigned* restrict node_data2 ) { unsigned acc = 0; unsigned ei; unsigned si; unsigned ovid; for (unsigned i = 0;i < 1000; i++ ) // iterates over graph nodes { acc = 0; si = start_edge; // sequential readei = end_edge; // sequential read for(unsigned j = si; j < ei; j++) // iterates over node's outgoing edges { ovid = ovid_of_edge[j]; // child node. sequential read. acc += node_data[ovid]; // random-access read } node_data2[i] = acc; // sequential write } } //kernel thanks