TAILIEUCHUNG - compilers principles techniques and tools phần 9

Hình 11,19: Thứ hạng và huỷ bỏ các truy cập afin tiếp giáp trong C và X [i, j] và X [i 1, j] là tiếp giáp trong Fortran. Nếu không có mất tính tổng quát, trong phần còn lại của chương này, chúng tôi sẽ thông qua C (hàng chính) bố trí khoảng 6-7 lần dài hơn bóng Gouraud. Nhanh Phong che cho dihse sự phản ánh có thể được mở rộng để | Simpo PDF Merge and Split Unregistered Version - http Access Affine Expression Rank Nullity Basis of Null Space Xfi-I 1 0 i . 3 . -1 1 1 0 1 Y i j 10 0 1 i 0 0 2 0 Y j j 1 01 0 1 i . 3 0 1 1 1 1 0 Y l 2 00 0 0 i . 3 1 2 0 2 1 0 5 0 1 z l i 2 i j 0 0 1 0 2 1 i _ 3 . 1 0 0 _ 2 0 Figure Rank and nullity of affine accesses contiguous in c and x i j and X z 1 j are contiguous in Fortran. Without loss of generality in the rest of the chapter we shall adopt the c row-major array layout. As a first appròximation we consider two array elements to share the same cache line if and only if they share the same row in a two-dimensional array. More generally in an array of d dimensions we take array elements to share a cache line if they differ only in the last dimension. Since for a typical array and cache many array elements can fit in one cache line there is significant speedup to be had by accessing an entire row in order even though strictly speaking we occasionally have to wait to load a new cache line. The trick to discovering and taking advantage of self-spatial reuse is to drop the last row from thè coefficient matrix F. If the resulting truncated matrix has rank that is less thán the depth of the loop nest then we can assure spatial locality by making sure that the innermost loop varies only the last coordinate of the array. Example Consider the last access Z l i 2 i j in Fig. . If we Simpo PDF Merge and Split Unregistered Version - http delete the last row we are left with the truncated matrix 0 0 1 0 The rank of this matrix is evidently 1 and since the loop nest has depth 2 there is the opportunity for spatial reuse. In this case since j is the inner-loop index the inner loop visits contiguous elements of the array z stored in row-major order. Making i the inner-loop index will not yield spatial locality since as i changes both the second and third dimensions change. The general rule for determining whether there is .

TỪ KHÓA LIÊN QUAN
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.