Questions tagged [icc]

ICC is Intel's C++ compiler, actually a group of C/C++ compilers that are available for Windows, Linux, and MacOS. This tag should be for questions about using ICC, and you should consider including the [C++] and possibly an Operating System specific tag as well.

The Intel C++ Compiler (ICC) compiles code for 64-bit applications for Windows, Linux, and MacOS. 32-bit applications are only supported on MacOS prior to compiler version 19.0. It can be used with Microsoft Visual Studio (on Windows), Eclipse/CDE (on Linux), or XCode (on MacOS).

The generated code is optimized to run specifically on Intel CPUs. This can sometimes be non-optimal on CPUs from other companies.

Intel's ICC documentation.

743 questions
18
votes
5 answers

C preprocessor __TIMESTAMP__ in ISO 8601:2004

How can I have a __TIMESTAMP__ replacement in ISO 8601:2004? __TIMESTAMP__ Sat Jul 6 02:50:06 2013 vs __TIMESTAMP_ISO__ 2013-07-06T00:50:06Z
Cetin Sert
  • 4,497
  • 5
  • 38
  • 76
17
votes
2 answers

Does ICC satisfy C99 specs for multiplication of complex numbers?

Consider this simple code: #include complex float f(complex float x) { return x*x; } If you compile it with -O3 -march=core-avx2 -fp-model strict using the Intel Compiler you get: f: vmovsldup xmm1, xmm0 …
Simd
  • 19,447
  • 42
  • 136
  • 271
17
votes
1 answer

How to generate a Visual Studio project that uses the Intel Compiler using cmake under Windows

I'm developing a cross-platform (Linux/Windows) application in C. I've gotten tired of maintaining both a usable Makefile and the Visual Studio solution/projects so I wanted to transition to cmake. I'm using the Intel Compiler on both…
niking
  • 500
  • 4
  • 11
16
votes
3 answers

How do I examine the contents of an std::vector in gdb, using the icc compiler?

I want to examine the contents of a std::vector in gdb but I don't have access to _M_impl because I'm using icc, not gcc, how do I do it? Let's say it's a std::vector for the sake of simplicity. There is a very nice answer here but this doesn't work…
Brett Hall
  • 275
  • 1
  • 4
  • 8
16
votes
1 answer

128-bit integers supporting +, -, *, /, and % in the Intel C Compiler?

GCC and Clang have the __int128_t and __uint128_t extensions for 128-bit integer arithmetic. I was hopeful that __m128i would give something similar for the Intel C Compiler, but (if it's even possible) it looks to me like I'd have to write explicit…
Douglas B. Staple
  • 10,510
  • 8
  • 31
  • 58
15
votes
1 answer

Different compiler behavior for expression: auto p {make_pointer()};

Which is the correct behaviour for the following program? // example.cpp #include #include struct Foo { void Bar() const { std::cout << "Foo::Bar()" << std::endl; } }; std::shared_ptr MakeFoo() { return…
Escualo
  • 40,844
  • 23
  • 87
  • 135
14
votes
0 answers

How to generate non-temporal instructions?

Intel's compiler has a pragma that can be used to generate non-temporal stores. For example, I can write void square(const double* x, double* y, int n) { #pragma vector nontemporal for (int i=0; i
Ryan Burn
  • 2,126
  • 1
  • 14
  • 35
14
votes
5 answers

What's the usecase of gcc's used attribute?

#include // xyz will be emitted with -flto (or if it is static) even when // the function is unused __attribute__((__used__)) void xyz() { printf("Hello World!\n"); } int main() { return 0; } What do I need this for? Is there any…
Thomas
  • 3,074
  • 1
  • 25
  • 39
13
votes
2 answers

Intel 2015 compiler bug, RAII destruction not correct, is this a bug or am I doing something wrong?

I've got a test case where I have a class with 3 subobjects (A, B and C), and the 2nd subobject B throws an exception during construction. As I understand C++, the compiler should rewind the construction of the big class and destroy the 1st object…
Mark Lakata
  • 19,989
  • 5
  • 106
  • 123
13
votes
1 answer

Intel C++ compiler bug in member function overload resolution involving "using" alias?

#include template struct Bar { }; template using Baz = Bar; struct Foo { template void NoAlias(Bar) { } template void…
eold
  • 5,972
  • 11
  • 56
  • 75
12
votes
4 answers

puzzled by compiler warning that suggests compound assignment of int8_t promotes to int

I can usually understand the reason behind a compiler warning, but this one seems just plain wrong. #include uint8_t myfunc(uint8_t x,uint8_t y) { x |= y; return x; } The intel compiler with -Wall complains: conversion from…
Mark Borgerding
  • 8,117
  • 4
  • 30
  • 51
12
votes
2 answers

Is the Intel C++ Compiler (19.0) now only using the Clang front-end (i.e. already abandoned EDG)?

In 16.0, the Intel C++ Compiler provided two compilers (one based on EDG, another based on Clang). From the 16.0 documentation: Using the Command Line To invoke the compiler from the command line, use a command similar to the following: For C…
Zeson
  • 121
  • 4
12
votes
1 answer

Deleted Function in std::pair when using a unique_ptr inside a map

I have a piece of C++ code for which I am not sure whether it is correct or not. Consider the following code. #include #include #include using namespace std; int main(int argc, char* argv[]) { vector
H. Rittich
  • 814
  • 7
  • 15
12
votes
2 answers

Why does icc fail to handle compile-time branch hints in a reasonable way?

A developer can use the __builtin_expect builtin to help the compiler understand in which direction a branch is likely to go. In the future, we may get a standard attribute for this purpose, but as of today at least all of clang, icc and gcc…
BeeOnRope
  • 60,350
  • 16
  • 207
  • 386
12
votes
1 answer

is there an inverse instruction to the movemask instruction in intel avx2?

The movemask instruction(s) take an __m256i and return an int32 where each bit (either the first 4, 8 or all 32 bits depending on the input vector element type) is the most significant bit of the corresponding vector element. I would like to do the…
orm
  • 2,835
  • 2
  • 22
  • 35
1
2
3
49 50