In recent years, modern CPU architecture has got fancier to meet today's demands. Due to various physical constraints, it is a lot more difficult to attain higher processor speed. Many Intel processors now support a technology called Single Instruction, Multiple Data (SIMD). By utilizing Streaming SIMD Extension (SSE) and Advanced Vector Extensions (AVX) registers, several mathematical operations can be executed within a single CPU cycle.Â
That is nice, but one of the pre-requisites of utilizing these fancy CPU instructions is to make sure that the data is located in a contiguous memory block in the first place. That brings us to our topic here. How do we orient our data in a contiguous memory block? You may find the solution in this section.