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

Is icc 2017 could change no simd code to simd code automatic

sun_c_
Beginner
520 Views

My company bought parallel studio xe 2017 composer edition for cpp last month. I build image process module with new icc. we last use icc bought in 2011. As the same using i3 cpu, I find  CPU occupancy is lower than before.  With new icc, the cpu occupancy of cpu1 could reduce 24%, cpu2 could reduce about 15%,cpu0 and cpu3 without any change. We only use cpu1 and cpu2 for image processing.

Is new icc could change no simd code to sse2 or avx to optimize the image processing speed?

Thanks.

0 Kudos
1 Solution
SergeyKostrov
Valued Contributor II
520 Views
>>Is new icc could change no simd code to sse2 or avx to optimize the image processing speed? It depends on what CPU used to build an executable. If /QxHost command line option is used then the highest ISA will be selected. Also, take into account that if /fast is used then it enables /QxHOST /O3 /Qipo /Qprec-div- options.

View solution in original post

0 Kudos
3 Replies
SergeyKostrov
Valued Contributor II
521 Views
>>Is new icc could change no simd code to sse2 or avx to optimize the image processing speed? It depends on what CPU used to build an executable. If /QxHost command line option is used then the highest ISA will be selected. Also, take into account that if /fast is used then it enables /QxHOST /O3 /Qipo /Qprec-div- options.
0 Kudos
sun_c_
Beginner
520 Views

Thanks,I will read Intel® C++ Compiler 17.0 Developer Guide and Reference for more info.

Another question, If I use Intel® C++ Compiler 17.0,  when highest ISA is selected, don't I  need to write SIMD c++ code or assembly code to speed  image processing?

Thanks.

 

0 Kudos
jimdempseyatthecove
Honored Contributor III
520 Views

The modern C++ compilers are capable of converting "traditional" array[] indexed code into using SIMD instructions provided the access patterns are amicable to vectorization.

for(int i=0; i<N; ++i)
   Diff = imageA - imageB;

The above is easily vectorizable by the compiler. There are many cases where it is not (non-unit strides, referencing array elements produced by prior iteration are a few). The compiler has options to produce reports on vectorization and/or lack thereof. Try these options with your existing code. You may be surprised.

Jim Dempsey

0 Kudos
Reply