Intel C++ compiler as an alternative to Microsoft's?

后端 未结 8 1920
梦如初夏
梦如初夏 2021-01-31 03:30

Is anyone here using the Intel C++ compiler instead of Microsoft\'s Visual c++ compiler?

I would be very interested to hear your experience about integration, performan

相关标签:
8条回答
  • 2021-01-31 04:10

    I've been using the Intel C++ compiler since the first Release of Intel Parallel Studio, and so far I haven't felt the temptation to go back. Here's an outline of dis/advantages as well as (some obvious) observations.

    Advantages

    • Parallelization (vectorization, OpenMP, SSE) is unmatched in other compilers.
    • Toolset is simply awesome. I'm talking about the profiling, of course.
    • Inclusion of optimized libraries such as Threading Building Blocks (okay, so Microsoft replicated TBB with PPL), Math Kernel Library (standard routines, and some implementations have MPI (!!!) support), Integrated Performance Primitives, etc. What's great also is that these libraries are constantly evolving.

    Disadvantages

    • Speed-up is Intel-only. Well duh! It doesn't worry me, however, because on the server side all I have to do is choose Intel machines. I have no problem with that, some people might.
    • You can't really do OSS or anything like that on this, because the project file format is different. Yes, you can have both VS and IPS file formats, but that's just weird. You'll get lost in synchronising project options whenever you make a change. Intel's compiler has twice the number of options, by the way.
    • The compiler is a lot more finicky. It is far too easy to set incompatible project settings that will give you a cryptic compilation error instead of a nice meaningful explanation.
    • It costs additional money on top of Visual Studio.

    Neutrals

    • I think that the performance argument is not a strong one anymore, because plenty of libraries such as Thrust or Microsoft AMP let you use GPGPU which will outgun your cpu anyway.
    • I recommend anyone interested to get a trial and try out some code, including the libraries. (And yes, the libraries are nice, but C-style interfaces can drive you insane.)
    0 讨论(0)
  • 2021-01-31 04:16

    The Intel compiler is one of the most advanced C++ compiler available, it has a number of advantages over for instance the Microsoft Visual C++ compiler, and one major drawback. The advantages include:

    • Very good SIMD support, as far as I've been able to find out, it is the compiler that has the best support for SIMD instructions.

    • Supports both automatic parallelization (multi core optimzations), as well as manual (through OpenMP), and does both very well.

    • Support CPU dispatching, this is really important, since it allows the compiler to target the processor for optimized instructions when the program runs. As far as I can tell this is the only C++ compiler available that does this, unless G++ has introduced this in their yet.

    • It is often shipped with optimized libraries, such as math and image libraries.

    However it has one major drawback, the dispatcher as mentioned above, only works on Intel CPU's, this means that advanced optimizations will be left out on AMD cpu's. There is a workaround for this, but it is still a major problem with the compiler.

    To work around the dispatcher problem, it is possible to replace the dispatcher code produced with a version working on AMD processors, one can for instance use Agner Fog's asmlib library which replaces the compiler generated dispatcher function. Much more information about the dispatching problem, and more detailed technical explanations of some of the topics can be found in the Optimizing software in C++ paper - also from Anger (which is really worth reading).

    On a personal note I have used the Intel c++ Compiler with Visual Studio 2005 where it worked flawlessly, I didn't experience any problems with microsoft specific language extensions, it seemed to understand those I used, but perhaps the ones mentioned by John Knoeller were different from the ones I had in my projects.

    While I like the Intel compiler, I'm currently working with the microsoft C++ compiler, simply because of the financial extra investment the Intel compiler requires. I would only use the Intel compiler as an alternative to Microsofts or the GNU compiler, if performance were critical to my project and I had a the financial part in order ;)

    0 讨论(0)
  • 2021-01-31 04:17

    I've had only one experience with this compiler, compiling STLPort. It took MSVC around 5 minutes to compile it and ICC was compiling for more than an hour. It seems that their template compilation is very slow. Other than this I've heard only good things about it.

    Here's something interesting:

    Intel's compiler can produce different versions of pieces of code, with each version being optimised for a specific processor and/or instruction set (SSE2, SSE3, etc.). The system detects which CPU it's running on and chooses the optimal code path accordingly; the CPU dispatcher, as it's called.

    "However, the Intel CPU dispatcher does not only check which instruction set is supported by the CPU, it also checks the vendor ID string," Fog details, "If the vendor string says 'GenuineIntel' then it uses the optimal code path. If the CPU is not from Intel then, in most cases, it will run the slowest possible version of the code, even if the CPU is fully compatible with a better version."

    OSnews article here

    0 讨论(0)
  • 2021-01-31 04:17

    I tried using Intel C++ at my previous job. IIRC, it did indeed generate more efficient code at the expense of compilation time. We didn't put it to production use though, for reasons I can't remember.

    One important difference compared to MSVC is that the Intel compiler supports C99.

    0 讨论(0)
  • 2021-01-31 04:30

    I'm not using Intel C++ compiler at work / personal (I wish I would).

    I would use it because it has:

    • Excellent inline assembler support. Intel C++ supports both Intel and AT&T (GCC) assembler syntaxes, for x86 and x64 platforms. Visual C++ can handle only Intel assembly syntax and only for x86.

    • Support for SSE3, SSSE3, and SSE4 instruction sets. Visual C++ has support for SSE and SSE2.

    • Is based on EDG C++, which has a complete ISO/IEC 14882:2003 standard implementation. That means you can use / learn every C++ feature.

    0 讨论(0)
  • 2021-01-31 04:30

    Anecdotally, I've found that the Intel compiler crashes more frequently than Visual C++. Its diagnostics are a bit more thorough and clearly written than VC's. Thus, it's possible that the compiler will give diagnostics that weren't given with VC, or will crash where VC didn't, making your conversion more expensive.

    However, I do believe that Intel's compiler allows you to link with Microsoft runtimes like the CRT, easing the transition cost.

    If you are interoperating with managed code you should probably stick with Microsoft's compiler.

    Recent Intel compilers achieve significantly better performance on floating-point heavy benchmarks, and are similar to Visual C++ on integer heavy benchmarks. However, it varies dramatically based on the program and whether or not you are using link-time code generation or profile-guided optimization. If performance is critical for you, you'll need to benchmark your application before making a choice. I'd only say that if you are doing scientific computing, it's probably worth the time to investigate.

    Intel allows you a month-long free trial of its compiler, so you can try these things out for yourself.

    0 讨论(0)
提交回复
热议问题