icc

Intel C++ Compiler warning 167 when non-const argument is passed as const parameter [duplicate]

怎甘沉沦 提交于 2019-12-04 09:29:36
This question already has an answer here: Why isn't it legal to convert “pointer to pointer to non-const” to a “pointer to pointer to const” 5 answers I have a large codebase that recently moved from Microsoft's compiler to the Intel C++ Compiler. Our team's goal is compilation without warnings in the mainline. Since the switch, one instance of warning 167 has confounded me. If I compile the following code: int foo(const int pp_stuff[2][2]) { return 0; } int foo2(const int pp_stuff[][2]) { return 0; } int main(void) { int stuff[2][2] = {{1,2},{3,4}}; foo(stuff); foo2(stuff); return 0; } The

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

女生的网名这么多〃 提交于 2019-12-04 02:55:52
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 platforms. I've downloaded cmake 3.0 on Windows and cmake 2.8 on Linux (it's the one in ubuntu 12.04 repositories). On Linux everything went smooth and the Makefiles were generated successfully. It was a simple matter of running: CC=icc CXX=icc cmake .. . On Windows, however, no matter what command I try I cannot use the Intel Compiler. The output vcxproj is

Does ICC satisfy C99 specs for multiplication of complex numbers?

早过忘川 提交于 2019-12-04 00:25:56
Consider this simple code: #include <complex.h> 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 #3.12 vmovshdup xmm2, xmm0 #3.12 vshufps xmm3, xmm0, xmm0, 177 #3.12 vmulps xmm4, xmm1, xmm0 #3.12 vmulps xmm5, xmm2, xmm3 #3.12 vaddsubps xmm0, xmm4, xmm5 #3.12 ret This is much simpler code than you get from both gcc and clang and also much simpler than the code you will find online for multiplying complex numbers. It doesn't, for example appear explicitly to deal with complex

Crash with icc: can the compiler invent writes where none existed in the abstract machine?

≡放荡痞女 提交于 2019-12-03 15:46:45
问题 Consider the following simple program: #include <cstring> #include <cstdio> #include <cstdlib> void replace(char *str, size_t len) { for (size_t i = 0; i < len; i++) { if (str[i] == '/') { str[i] = '_'; } } } const char *global_str = "the quick brown fox jumps over the lazy dog"; int main(int argc, char **argv) { const char *str = argc > 1 ? argv[1] : global_str; replace(const_cast<char *>(str), std::strlen(str)); puts(str); return EXIT_SUCCESS; } It takes an (optional) string on the command

Intel C++ Compiler is extremely slow to compile recursive decltype returns

我与影子孤独终老i 提交于 2019-12-03 13:33:10
I'm writing a template for expressions parametrised by an arbitrary number of char labels. Given an argument list, a factory function returns an expression of different types depending on whether there are two arguments of the same types or whether they are unique. A concrete example: suppose that A is a "labelable" object with its operator() overloaded to produce an ?Expression<...> . Let a, b, ... be declared as labels LabelName<'a'>, LabelName<'b'>, ... . Then A(a,b,c,d) would produce a UniqueExpression<'a','b','c','d'> , whereas A(a,c,b,c) would produce a RepeatedExpression<'a','c','b','c'

CUDA 5.5 &amp; Intel C/C++ Compiler on Linux

匿名 (未验证) 提交于 2019-12-03 09:14:57
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: icc -v icc version 12.1.5 NVIDIA states, that Intel ICC 12.1 is supported ( http://docs.nvidia.com/cuda/cuda-samples/index.html#linux-platforms-supported ), but even after having downgraded to Intel ICC 12.1.5 (installed as part of the Intel Composer XE 2011 SP1 Update 3), I am still running into this issue: nvcc -ccbin=icc src/test.cu -o test /usr/local/cuda-5.5/bin//..//include/host_config.h(72): catastrophic error: #error directive: -- unsupported ICC configuration! Only ICC 12.1 on Linux x86_64 is supported! #error -- unsupported ICC

Color profile detection in JPEG

匿名 (未验证) 提交于 2019-12-03 08:54:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I would like to be able to detect the presence of a color profile in JPEG. To be clear: I'm not interested in actually carrying out the color corrections or doing anything else with them. I did some investigation, but I could not find any definite source of information. Here is what I know so far: There is a color profile information in the XMP block . The XMP block is in a 0xFFE1 JPEG section (the same as EXIF). The marked of this section is followed by the http://ns.adobe.com/xap/1.0/ string. However, when I stripped this section,

Can cython be compiled with icc?

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to build cython from source with icc compiler on Ubuntu 14.04 as my python is compiled with Intel icc compiler. When I tried to install cython using pip3 install cython and then ran cython I got following error Traceback (most recent call last): File "/usr/local/bin/cython", line 9, in <module> load_entry_point('Cython==0.24', 'console_scripts', 'cython')() File "/usr/lib/python3/dist-packages/pkg_resources.py", line 351, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/lib/python3/dist

Does gcc, icc, or Microsoft's C/C++ compiler support or know anything about NUMA?

牧云@^-^@ 提交于 2019-12-03 07:28:27
问题 If I have a multi-processor board that has cache-coherent non-uniform memory access ( NUMA ), i.e. separate "northbridges" with separate RAM for each processor, does any compiler know how to automatically spread the data across the different memory systems such that processes working on local threads are mostly retrieving their data from the RAM associated with the processor the thread is running on? I have a setup where 1 GB is attached to processor 0, 1 GB is attached to processor 1, et c.

Pass lambda expression to lambda argument c++11

吃可爱长大的小学妹 提交于 2019-12-03 06:59:39
问题 I would like to do something like this: int main() { auto f = [/*some variables*/](/*take lambda function*/) {/*something with lambda function*/}; f([/*other variables*/](/*variables to be decided by f()*/) {/*something with variables*/}); } I know that it is possible to pass a lambda to a function, as well as to a lambda. The following works: int main() { int x=0; int y=0; auto f = [x,y](double (func)(int)) -> double {func(0); return 0.0;}; f([](int i) -> double {return 0.0;}); } But the