Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

_Pragma("vector always") errors

meldaproduction
Beginner
591 Views

_Pragma("vector always") causes compilation errors with the newest ICC. I'm not explicitly enabling C++11 or anything.

0 Kudos
6 Replies
TimP
Honored Contributor III
591 Views

According to MSDN, __pragma (double leading underscore) is a Microsoft specific equivalent of #pragma for use within a macro definition.  I haven't seen any evidence they support it for the purpose of replacing ICL #pragma vector always; my experience has been that MSVC++ ignores ICL pragmas.  So you'd have to explain further why you would try to merge Intel and Microsoft-specific pragmas.

Even the interoperability of __restrict between ICL and MSVC++ is limited in ways I don't fully understand.  I suppose ICL would follow linux practice on extensions which don't have equivalent MSVC++ support.  It's annoying enough that alignment attributes aren't portable between Windows and linux compilation.

0 Kudos
meldaproduction
Beginner
591 Views

Nope, apparently _Pragma (single underscore) is part of the standard. I enabled C++11 and it seems to work now (whether it does something, that I don't know :D ).

http://stackoverflow.com/questions/3030099/pragma-in-define-macro

0 Kudos
KitturGanesh
Employee
590 Views

Hi,
I tried on a small test case on Linux with ICC and it works fine:

void vec_always(int *a, int *b, int m) {
int i;
 _Pragma("vector always")
//#pragma vector always
for(i = 0; i <= m; i++)
   a[32*i] = b[99*i];
}

Need to find out how it works with ICL and confirm as well from the product team and let you know
_Kittur

0 Kudos
KitturGanesh
Employee
591 Views

Hi,
The same is true for ICL as well. Let me know if you still has any further questions/clarifications?
_Kittur 

0 Kudos
meldaproduction
Beginner
591 Views

It's fine, it seems that enabling C++11 does the trick, perhaps some eariler version would do the trick as well.

0 Kudos
KitturGanesh
Employee
591 Views

I agree, that's correct. Thanks for confirming the same.

_Kittur 

0 Kudos
Reply