- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- 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
for (int k = 0; k < NUMROWS*NUMCOLS; k++)
{
c
}
for (int k = 0; k < NUMROWS*NUMCOLS; k++)
{
a
}
- 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
In a typical context, your pointers may have to be declared short * restrict, with the -restrict compile option set. In addition, the compiler misses some opportunities to vectorizer short, when it does OK with int, but that shouldn't be associated with dependency diagnostic. Also, compilers since10.0 require #pragma ivdep in some situations where 9.1 could vectorize without it.
- 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
Next time please try to post complete code example, preferrably as attachment. Thank you.
#includevoid test(unsigned char *a, short *b, short *c, short *d, int n) { for (int k = 0; k < n; k++) { c = __max(c , b ); } for (int k = 0; k < n; k++) { a = b > d ; } }
With Intel Compiler 11.0.026 beta the first loop is auto-vectorized. Second loop cannot be auto-vectorized because of unsupported data type. It could be vectorized with very little effort on your side by changing a[] to short * (that is if memory is not a concern), and afterwards the compiler will even fuse the loops.
Alternate solution which requires a bit more work on your side is to write the second loop using intrinsics or inline assembler.
That second loop is an interesting example where compiler should do much better I will submit a feature request to the Premier Support on your behalf.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page