29.01.2015 Views

Embedded Software for SoC - Grupo de Mecatrônica EESC/USP

Embedded Software for SoC - Grupo de Mecatrônica EESC/USP

Embedded Software for SoC - Grupo de Mecatrônica EESC/USP

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Data Space Oriented Scheduling 237<br />

and only if For example, A[i + l][j – 1] and A[i][j] are uni<strong>for</strong>mly<br />

generated, whereas A[i][j]and A[j][i] are not. Then, we count the number of<br />

references in each uni<strong>for</strong>mly generated reference group, and the access matrix<br />

of the group with the highest count is consi<strong>de</strong>red as the representative reference<br />

of this array in the nest in question. This is a viable approach because<br />

of the following reason. In many array-intensive benchmarks, most of the<br />

references (of a given array) in a given nest are uni<strong>for</strong>mly generated. This is<br />

particularly true <strong>for</strong> array-intensive image and vi<strong>de</strong>o applications where most<br />

computations are of stencil type. Note that in our example nests in Figure<br />

18-3, each array has a single uni<strong>for</strong>mly generated reference set.<br />

Multiple arrays in a nest: If we have more than one array in the co<strong>de</strong>, the<br />

process of selecting suitable data tile shapes becomes more complex. It should<br />

be noted that our approach explained above is a data space centric one; that<br />

is, we reor<strong>de</strong>r the computation according to the data tile access pattern.<br />

Consequently, if we have two arrays in the co<strong>de</strong>, we can end up with two<br />

different execution or<strong>de</strong>rs. Clearly, one of these or<strong>de</strong>rs might be preferable<br />

over the other. Let us assume, <strong>for</strong> the clarity of presentation, that we have<br />

two arrays, A and B, in a given nest. Our objective is to <strong>de</strong>termine two data<br />

tile matrices (<strong>for</strong> array A) and (<strong>for</strong> array B) such that the total number<br />

of non-zero elements in and is minimized. Obviously, data<br />

<strong>de</strong>pen<strong>de</strong>nces in the co<strong>de</strong> need also be satisfied (i.e., where is<br />

the iteration tile matrix). We can approach this problem in two ways. Let us<br />

first focus on If we select a suitable so that the number of non-zero<br />

elements in is minimized, we can <strong>de</strong>termine an <strong>for</strong> the nest in<br />

question using this and the access matrix More specifically,<br />

(assuming that is invertible). After that, using this we can find<br />

an from An alternative way would start with then<br />

<strong>de</strong>termine and after that, <strong>de</strong>termine One way of <strong>de</strong>ciding which of<br />

these strategies is better than the other is to look at the number of zero (or<br />

non-zero) entries in the resulting and matrices. Obviously, in<br />

both the cases, if there are data <strong>de</strong>pen<strong>de</strong>nces, the condition needs<br />

also be satisfied.<br />

Multiple nests in a process co<strong>de</strong>: Each nest can have a different iteration<br />

tile shape <strong>for</strong> the same data tile, and a legal iteration tile (<strong>for</strong> a given data<br />

tile) should be chosen <strong>for</strong> each process separately. As an example, let us focus<br />

on a process co<strong>de</strong> that contains two nests (that access the same array). Our<br />

approach proceeds as follows. If there are no <strong>de</strong>pen<strong>de</strong>nces, we first find a<br />

such that the number of non-zero entries in and is minimized.<br />

Here, and are the matrices that capture the relations between array<br />

elements in the first nest and the second nest, respectively. Then, using this<br />

we can <strong>de</strong>termine and from and respectively.<br />

In these expressions, and are the access matrices in the first and<br />

the second nest, respectively. It should be noted, however, that the nests in a<br />

given process do not need to use the same data tile matrix matrix <strong>for</strong> the<br />

same array. In other words, it is possible (and in some cases actually benefi-

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!