memory alignment with mkl_malloc

六月ゝ 毕业季﹏ 提交于 2019-12-12 19:16:05

问题


This question might just show that I haven't understand something important in C:

The Intel Math Kernel library provides a way to set the memory alignment when allocating memory. On the other hand I pass arrays to mkl lapack routines just by reference. So how does the lapack routine know about the alignment of the array? It has to, since the memory alignment determines at which memory address is a particular array value, correct?


回答1:


The routine does not need to know about alignment. Alignment only determines the starting address of the array (which coincides with the address of the first element), the address of the rest of the elements is determined by the starting address and element size.



来源:https://stackoverflow.com/questions/6705307/memory-alignment-with-mkl-malloc

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!