An exhaustive evaluation of row-major, column-major and Morton layouts for large two-dimensional arrays
نویسندگان
چکیده
Morton layout is a compromise storage layout between the programming language mandated layouts row-major and column-major, providing substantial locality of reference when traversed in either direction. This paper explores the performance of Morton, row-major and column-major layouts in detail on some representative architectures. Using a small suite of dense kernels working on two-dimensional arrays, we have carried out an extensive study of the impact of poor array layout and of whether Morton layout can offer an attractive compromise. Whether Morton layout is better than traversing a column-major array in row-major order (or vice versa) depends on problem size and architecture. Morton layout generally leads to much more consistent performance and only a small improvement in its performance could make it an attractive alternative.
منابع مشابه
Is Morton layout competitive for large two-dimensional arrays yet?
Two-dimensional arrays are generally arranged in memory in row-major order or column-major order. Traversing a row-major array in column-major order, or vice-versa, leads to poor spatial locality. With large arrays the performance loss can be a factor of 10 or more. This paper explores the Morton storage layout, which has substantial spatial locality whether traversed in row-major or column-maj...
متن کاملAlternative array storage layouts for regular scientific programs
This thesis concerns techniques for using hierarchical storage formats such as Morton layout as an alternative storage layout for regular scientific programs operating over dense two-dimensional arrays. Programming languages with support for two-dimensional arrays use one of two linear mappings from two-dimensional array indices to locations in the machine’s one-dimensional address space: rowma...
متن کاملMinimizing Associativity Conflicts in Morton Layout
Hierarchically-blocked non-linear storage layouts, such as the Morton ordering, have been shown to be a potentially attractive compromise between row-major and column-major for two-dimensional arrays. When combined with appropriate optimizations, Morton layout offers some spatial locality whether traversed rowor column-wise. However, for linear algebra routines with larger problem sizes, the la...
متن کاملSynthesis of Indexing Expressions for Complex Data Layouts
We present a technique for generating and optimizing expressions for indexing complex array layouts. Our technique is built around a declarative, domain-specific layout language that provides support for arbitrarily-nested row-major, column-major, Z-Morton, and Hilbert curve layouts. To maintain programmability, we maintain a ‘logical,’ two-dimensional view of the data in physical memory, allow...
متن کاملImproving the Performance of Morton Layout by Array Alignment and Loop Unrolling: Reducing the Price of Naivety
Hierarchically-blocked non-linear storage layouts, such as the Morton ordering, have been proposed as a compromise between row-major and columnmajor for two-dimensional arrays. Morton layout offers some spatial locality whether traversed row-wise or column-wise. The goal of this paper is to make this an attractive compromise, offering close to the performance of row-major traversal of row-major...
متن کامل