文章目录
- Vector优化 – stride跳跃
Vector优化 – stride跳跃
This distance between memory locations that separates the elements to be gathered into a single register is called the stride. A stride of one unit is called a unit-stride. This is equivalent to sequential memory access.
将要收集到单个寄存器中的元素分开的内存位置之间的距离称为步幅。一个单位的步幅称为单位步幅。这相当于顺序内存访问。
The position in memory of adjacent elements in a vector may not be sequential. A vector processor can handle strides greater than one, called non-unit strides, using only vector load and vector store operations with stride capability. Thus vectors are able to access nonsequential memory locations and reshape them to a dense structure.
vector中相邻元素在内存中的位置可能不是连续的。 vector处理器可以处理大于 1 的步幅(称为非单位步幅) ,仅使用具有步幅功能的vector加载和vector存储操作。因此,向量能够访问非连续的内存位置并将它们重塑为密集的结构。
Caches inherently deal with unit stride data; increasing block size can help reduce miss rates for data with unit stride, but i