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

C++ Standard Template Library

postaquestion
Beginner
324 Views

I am working on a C++ application on Clovertown; the C++ code uses StandardTemplate Library. I don't see any single core performance improvement compared to g++ although I use the highest lever optimization flags: -O3 -xT -msse3 -no-prec-div -ipo.

Is there any optimized Standard Template Library (STL) available for the Intel compiler?

Thank you.

0 Kudos
2 Replies
TimP
Honored Contributor III
324 Views

For compatibility, Intel C++ "inherits" STL from the installed compiler (g++, for linux). Dinkumware STL may perform better with certain applications. The inherited STL is the "safe" choice, as shown by the apparent lack of surprises in your case.

Intel Threaded Building Blocks provide threaded C++ classes for use where OpenMP is inconvenient.

Major gains with Intel C are most likely to come with vectorizable and auto-parallelizablecode.

For vectorization, you should start with the report generated by -vec_report2, to see if you can do anything to promote auto-vectorization. In my limited experience of STL optimization, I think the scope for auto-vectorization may be limited to iterators such as inner_product() and transform() (which tends to need liberal use of restrict/__restrict__).

Likewise, for the -parallel option, there are additional diagnostic reports available.You might find candidates for parallelization with this option, then find better ways, such as OpenMP and TBB.

0 Kudos
TimP
Honored Contributor III
324 Views

When comparing icpc and g++, don't forget (as I almost did):

g++ -fstrict-aliasing is set by default. Your Intel options are equivalent to -fno-strict-aliasing. If you have written correct code, such that you don't need to disable aliasing optimizations, you should set icpc option -ansi_alias

0 Kudos
Reply