Forum Discussion
Altera_Forum
Honored Contributor
8 years agoComplex loop exit condition
Hello, I have a very simple code with a few lines, but the outer loop is not pipelined due to "Loop exit condition unresolvable at iteration initiation". Inner loop is pipelined well with II=1. Ca...
Altera_Forum
Honored Contributor
8 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