- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have seen the "__assume()" statement used in Intel examples, such as "__assume(n1%16==0)" used in the recommendations in the article at https://software.intel.com/en-us/articles/data-alignment-to-assist-vectorization
I have not been able to find any discussion of this function in the compiler documentation. I can find a description of "__assume_aligned()", but not for "__assume()". This may be because the search function for the compiler documentation ignores leading punctuation. So searching for "assume_aligned" returns useful results, while searching for "__assume" returns any page that contains the word "assume" -- 71 matches in the Intel version 16 compiler docs. The web-browser-based documentation portal is too slow to look through that many results one at a time, so if anyone knows if there is documentation for this statement, I would appreciate a pointer!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is a Microsoft invention (although we support it on Linux too):
See documentation at:
https://msdn.microsoft.com/en-us/library/1b3fsfxw.aspx
Judy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks!
Not many answers there, but at least some ideas that I can play with....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The Microsoft web page just says that the argument to the __assume() statement can be "any statement that is assumed to evaluate to true". The only example provided -- "__assume(0)" means that the compiler can assume that this code will never be reached.
The Intel web page gives only one example -- "__assume (n1%16==0)", and uses it as a way to provide information about the alignment of array references with constant offsets.
I guess I was hoping for some documentation of what types of statements the compiler might be likely to take advantage of. Since there does not appear to be any such documentation, I will __assume() that this is not a feature of the compiler that is likely to be useful....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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