Study note
Memory layout of multi-dimensional arrays
Properties
- Type
- Blogs
- Status
- 待读
- Domain
- Systems
- Category
- 内存管理与虚拟内存
- Source
- eli.thegreenplace.net
- Vault note
library/articles/systems/Memory-layout-of-multi-dimensional-arrays-157896be5620bc5d.md
Summary
Eli Bendersky 的文章系统解释多维数组如何映射到线性内存,比较 row-major 与 column-major,推广到 N 维数组 offset 计算,并用 NumPy 与 C/C++ 访问模式示例说明内存布局、cache locality、vectorization 和遍历顺序对性能的影响。
Highlights
适合作为 CUDA/tensor/matrix 性能学习的前置基础,能把 `row * ncols + col`、N 维 index flatten、连续访问、cache 和 SIMD 这些概念一次讲清楚。
Notes
多维数组 row-major / column-major 内存布局与性能影响。
Comments
Loading comments...