11.07.2015 Views

A Compiler for Parallel Exeuction of Numerical Python Programs on ...

A Compiler for Parallel Exeuction of Numerical Python Programs on ...

A Compiler for Parallel Exeuction of Numerical Python Programs on ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

1 <str<strong>on</strong>g>for</str<strong>on</strong>g> i 1 in prange(u 1 ) :2 <str<strong>on</strong>g>for</str<strong>on</strong>g> i 2 in prange(u 2 ) :3 . . .4 <str<strong>on</strong>g>for</str<strong>on</strong>g> i m in prange(u m ) :5 <str<strong>on</strong>g>for</str<strong>on</strong>g> i m+1 in range(u m+1 ) :6 .7 .8 <str<strong>on</strong>g>for</str<strong>on</strong>g> i d in range(u d )9 #loop bodyFigure 5.1: Loop nests c<strong>on</strong>sidered <str<strong>on</strong>g>for</str<strong>on</strong>g> array access analysisloop counters to <strong>on</strong>e-dimensi<strong>on</strong>al space <str<strong>on</strong>g>of</str<strong>on</strong>g> memory locati<strong>on</strong>s. The space <str<strong>on</strong>g>of</str<strong>on</strong>g> memory locati<strong>on</strong>srepresents the locati<strong>on</strong>s in virtual memory. This space starts at zero and ends at positiveinfinity. The memory space is assumed to c<strong>on</strong>sist <str<strong>on</strong>g>of</str<strong>on</strong>g> discrete cells where each cell is composed<str<strong>on</strong>g>of</str<strong>on</strong>g> <strong>on</strong>e discrete unit <str<strong>on</strong>g>of</str<strong>on</strong>g> memory. If all the arrays in the loop have the same element size s,(<str<strong>on</strong>g>for</str<strong>on</strong>g> example if all arrays are arrays <str<strong>on</strong>g>of</str<strong>on</strong>g> 4-byte values), and if the starting positi<strong>on</strong> <str<strong>on</strong>g>of</str<strong>on</strong>g> allarrays is aligned <strong>on</strong> s bytes, then <strong>on</strong>e cell <str<strong>on</strong>g>of</str<strong>on</strong>g> memory can be thought <str<strong>on</strong>g>of</str<strong>on</strong>g> as having s bytes.In this work, I restrict myself to the case where <strong>on</strong>e cell <str<strong>on</strong>g>of</str<strong>on</strong>g> memory is equated to the size <str<strong>on</strong>g>of</str<strong>on</strong>g><strong>on</strong>e element <str<strong>on</strong>g>of</str<strong>on</strong>g> the array.For array-access analysis, representing and reas<strong>on</strong>ing about arbitrary memory access patternsis not feasible. Thus array-access analysis is typically restricted to representing <strong>on</strong>eparticular class <str<strong>on</strong>g>of</str<strong>on</strong>g> memory access patterns. Linear Memory Access Descriptors or LMADs,first introduced by Paek et al. [17], are <strong>on</strong>e such representati<strong>on</strong> capable <str<strong>on</strong>g>of</str<strong>on</strong>g> precisely representinga wide variety <str<strong>on</strong>g>of</str<strong>on</strong>g> memory access patterns.Definiti<strong>on</strong> 1. An LMAD L is a mapping from a d-dimensi<strong>on</strong>al space <str<strong>on</strong>g>of</str<strong>on</strong>g> tuples <str<strong>on</strong>g>of</str<strong>on</strong>g> loopcounters to the 1-dimensi<strong>on</strong>al space <str<strong>on</strong>g>of</str<strong>on</strong>g> memory locati<strong>on</strong>s <str<strong>on</strong>g>of</str<strong>on</strong>g> the <str<strong>on</strong>g>for</str<strong>on</strong>g>m:d∑L(i 1 , i 2 , .., i d ) = c 0 + f k (i k ) (5.1)k=1where ∀(1 ≤ k ≤ d), starting with k = 1 and going to k = d:0 ≤ i k < u k (5.2)u k = g k (i 1 , i 2 , .., i k−1 ) (5.3)i k , u k , c 0 , f k (i k ), g k (i 1 , i 2 , .., i k−1 )ɛZ (5.4)where L is the LMAD, Z is the set <str<strong>on</strong>g>of</str<strong>on</strong>g> integers, i k is the k-th loop counter, c 0 to c d areinteger c<strong>on</strong>stants and u k is the upper bound <str<strong>on</strong>g>of</str<strong>on</strong>g> the k-th loop counter. Functi<strong>on</strong>s f k and g kare arbitrary integer functi<strong>on</strong>s.34

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

Saved successfully!

Ooh no, something went wrong!