icc

Column-major array storage in C compilers

◇◆丶佛笑我妖孽 提交于 2019-12-10 10:55:43
问题 Are there any C compilers that have extensions to store an array in column-major order instead of the standard row-major order? 回答1: Short answer is "No". Long answer is that storing an array in column-major order would break the one-to-one correspondence between array index operations and pointer arithmetics, and the way an N-dimension array is sliced into N-1 dimension arrays. Consider a 10x20 array stored in column-major order. This means that cells in adjacent columns would be next to

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

旧时模样 提交于 2019-12-10 01:02:59
问题 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 SSE2 function calls in order to use __m128i , instead of using "built-in" operators like + , - , * , / , and % . I was hoping to do something like this (this doesn't work): #if defined(__INTEL_COMPILER) && defined(__SSE2__) #include "xmmintrin.h"

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

天大地大妈咪最大 提交于 2019-12-09 14:45:48
问题 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

C++ memory alignment question

空扰寡人 提交于 2019-12-09 13:11:07
问题 A line of code is worth a thousand words :) Here is my problem: /* Platform specific 16-byte alignment macro switch. On Visual C++ it would substitute __declspec(align(16)). On GCC it substitutes __attribute__((aligned (16))). */ #define ALIGN_16 ... struct ALIGN_16 A {...}; A* ptr = new A; A* ptr2 = new A[20]; assert(size_t(ptr) % 16 == 0); for (int i=0; i<20; ++i) assert(size_t(ptr2+i) % 16 == 0); assert(sizeof(A) % 16 == 0); Can I expect that all assertions pass on platforms with SSE

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

此生再无相见时 提交于 2019-12-09 12:01:32
问题 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

how to turn on icc/icpc warnings?

笑着哭i 提交于 2019-12-09 10:10:21
问题 I installed Intel Compiler composer_xe_2013_sp1.3.174 on Linux. I am confused about the icc warnings. Feed icc with a simple program main.c as below: int main(int argc, char **argv) { int a = 1; unsigned int b = -22; if (b = a) { } } I compiled the file with the command: icc -Wall main.c . Surprisingly, the command works silently without any warnings. Do I have to turn on the warnings switch on icc? Thanks 回答1: The Intel compiler doesn't really have good presets for warnings the way that gcc

Building Boost Libraries With Intel Compiler

﹥>﹥吖頭↗ 提交于 2019-12-09 00:52:24
问题 I have installed Intel Parallel Studio XE 2013 in addition to Visual Studio 2012 on a 32bit Windows 7 machine. I have tried to build Boost 1.53 with Intel compiler by following the instructions in the link. I have this error: .\boost/config/select_stdlib_config.hpp(18): catastrophic error: cannot open source file "cstddef" Is there anyone else who had the same problem? I would welcome any advice to link standard libraries of ICC to boost build process. Thanks in advance. 回答1: After an

Struggling with alignas syntax

耗尽温柔 提交于 2019-12-08 17:09:22
问题 I am trying to use alignas for pointers that are class members, and frankly I am not sure where I supposed to put it. For instance: class A { private: int n; alignas(64) double* ptr; public: A(const int num) : n(num), ptr(new double[num]) {} }; which I hoped would ensure the data for ptr was aligned on a 64-byte block. Using the Intel compiler, it doesn't. Can anyone point me in the right direction please? 回答1: Using the alignas(N) keyword on a member of a class causes this member to be

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

醉酒当歌 提交于 2019-12-08 15:43:05
问题 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 support the non-standard __builtin_expect instead. However, icc seems to generate oddly terrible code when you use it 1 . That is, code that is uses the builtin is strictly worse than the code without it, regardless of which direction the prediction is

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

点点圈 提交于 2019-12-08 07:01:08
问题 For my current project, I need to use CUDA and the Intel C/C++ compilers in the same project. (I rely on the SSYEV implementation of Intel's MKL, which takes roughly 10 times as long when using GCC+MKL instead of ICC+MKL (~3ms from GCC, ~300µs from ICC). 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