- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I can't figure out the correct answer: bits or bytes? I first thought "bytes", because obviously one cannot align memory chunks bit-wise. But the MKL Reference Manual gives an example of MKL_malloc(...,128) (page 3274) and 128 bits==16 bytes, which is exactly what's advised in the User's Guide. So what?
Thanks in advance.
I can't figure out the correct answer: bits or bytes? I first thought "bytes", because obviously one cannot align memory chunks bit-wise. But the MKL Reference Manual gives an example of MKL_malloc(...,128) (page 3274) and 128 bits==16 bytes, which is exactly what's advised in the User's Guide. So what?
Thanks in advance.
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Bytes.
Thanks for noticing this inconsistency.
Dima
Thanks for noticing this inconsistency.
Dima
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Good! So, why does the Reference Manual example use 128-byte alignment? I haven't noticed this "magic number" to be mentioned elsewhere...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is an example demonstrating usage of MKL_malloc. Nothing particular about this number, except demonstrating that a 2-power alignment is expected. Aligning on cache-line boundary (64 bytes) would be more reasonable I admit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'd like to add that sometimes page-boundary alignmentof data gives performace improvents in comparison with cache-line boundary.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there a way to get those numbers at compile time or run time? (Compiler intrinsic, system call...)

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page