Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这个问题可能只是表明我不了解 C 中的重要内容:
Intel Math Kernel 库提供了一种在分配内存时设置内存对齐的方法。另一方面,我只是通过引用将数组传递给 mkl lapack 例程。那么 lapack 例程是如何知道数组的对齐的呢?它必须,因为内存对齐决定了哪个内存地址是一个特定的数组值,对吗?
例程不需要知道对齐。对齐只决定数组的起始地址(与第一个元素的地址重合),其余元素的地址由起始地址和元素大小决定。