Raw numerical data physical memory addresses aligning
조회 수: 2 (최근 30일)
이전 댓글 표시
I'm currently writing c++ mex function. I'd like to utilize some SIMD instructions.
- Is it safe to assume, that the pointer to the raw numeric data (the result on mxGetData() ) is aligned ?
- Is it 16-byte (SSE-like) or 32-byte (AVX-like) alignment?
- Does it depend on the CPU capabilities, Matlab version or anything else?
- Is there any document about this subject?
Matlab makes some use of SSE as well, so, most probably, each array must be aligned. And my initial experiments do confirm, that all raw-data pointers are 32-byte aligned... But it would be nice to have an "official confirmation" and/or notices about the possible caveats.
댓글 수: 0
답변 (1개)
Jan
2015년 10월 10일
편집: Jan
2015년 10월 18일
Since at least R2008b I've never observed an array, which is not aligned at 16 bytes. My Mex functions stop with an error otherwise and no user reported such an error yet. This concerns 32 and 64 bit versions of Matlab and Windows.
I agree that an official statement is required.
[EDITED] "Aligned at 32 bits" -> "Aligned at 16 bytes"
I've used SSE statements only, so I did not check for 32 byte alignment.
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!