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

valarray..what about Boost?

shachris23
New Contributor I
379 Views

This question is regarding Intel C++ Compiler 11.0 in general.

One of the new features listed is:

* Improved valarray option

Templates of array operations that enable low level hardware features to enhance application performance. No source code change required to use!

Question is: Is valarray the only template array supported that will make use of hardware features, or other well-known template array like Boost.array and multi-array supported as well?

0 Kudos
1 Solution
JenniferJ
Moderator
379 Views
Valarry uses IPP libraries for performance reason.
The change to source code is very limited with "#include " or "" etc.
The header file is located under "C:Program FilesIntelCompiler11.0�xxcppperf_headersc++" so you need to add it to your include dir list.
Jennifer

View solution in original post

0 Kudos
3 Replies
JenniferJ
Moderator
380 Views
Valarry uses IPP libraries for performance reason.
The change to source code is very limited with "#include " or "" etc.
The header file is located under "C:Program FilesIntelCompiler11.0�xxcppperf_headersc++" so you need to add it to your include dir list.
Jennifer

0 Kudos
shachris23
New Contributor I
379 Views
Valarry uses IPP libraries for performance reason.
The change to source code is very limited with "#include " or "" etc.
The header file is located under "C:Program FilesIntelCompiler11.0�xxcppperf_headersc++" so you need to add it to your include dir list.
Jennifer

Thanks for your response. I looked through the header and now understand that the only thing different is Intel's valarray makes use of Intel-specific math functions.

So to sum up, you would only get added performance if your code does operation on the valarray itself (i.e. *,-,+,/,tan,cos, etc)...

However, the valarray class itself doesnt help with other issues (like aligning data on cache line, or helps the ICC optimize your code)

My original question had more to do with if by using Intel valarry it would actually help the compiler optimize code better, but I guess it doesnt. I think using keyword restrict, and aligning data will probably help more.

0 Kudos
shachris23
New Contributor I
379 Views
Quoting - shachris23

Thanks for your response. I looked through the header and now understand that the only thing different is Intel's valarray makes use of Intel-specific math functions.

So to sum up, you would only get added performance if your code does operation on the valarray itself (i.e. *,-,+,/,tan,cos, etc)...

However, the valarray class itself doesnt help with other issues (like aligning data on cache line, or helps the ICC optimize your code)

My original question had more to do with if by using Intel valarry it would actually help the compiler optimize code better, but I guess it doesnt. I think using keyword restrict, and aligning data will probably help more.

As a note, this is taken straight out from the ICC ref man for other people's future reference:

Building Applications Using Intel Performance Headers

Building Applications Using Intel Performance Headers

The Intel compiler provides a high performance implementation of specialized valarray operations for the C++ standard valarray container.

The standard C++ valarray template consists of array or vector operations for high performance computing; these operations are designed to exploit high performance hardware features such as parallelism and achieve performance benefits. The Intel implementation of valarray, which requires installation of Intel Integrated Performance Primitives (IPP), consists of a replacement header that provides a specialized high performance implementation for the following operators and types:

operator

valarrays of Type

abs, acos, asin, atan, atan2, cos, cosh, exp, log, log10, pow, sin, sinh, sqrt, tan, tanh

float, double

addition, subtraction, division, multiplication

float,double

bitwise or, and, xor

(all unsigned) char, short, int

min, max, sum

signed or short/signed int, float, double

0 Kudos
Reply