Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
7678 Discussions

One question of use -xCORE-AVX512 in icx/icpx

empty
Novice
735 Views

When I use icx/icpx and -xCORE-AVX512 flag to compile program, there is not the way I understood it.  The source code : https://godbolt.org/z/sK1hfn5a8  .  When I not use -xCORE-AVX512 flag to compile the program it would generate four version of 'memset' function: 

memset@GLIBC_2.2.5, 
__intel_memset, 
__intel_avx_rep_memset,
__intel_mic_avx512f_memset.
 
And when I use -xCORE-AVX512 flag to compile program, it just generate one version of 'memset' function: __intel_avx_rep_memset.  My understand about -xCORE-AVX512 is it would enable to generate AVX512  Instruction (https://software.intel.com/content/dam/develop/external/us/en/documents/oneapi_dpcpp_cpp_compiler.pd...   But when I use the flag it not use AVX512 instruction in fact. What is the reason of the difference between my understanding and the actual phenomenon?  
Labels (1)
0 Kudos
6 Replies
VidyalathaB_Intel
Moderator
704 Views

Hi,


Thanks for reaching out to us.


>> My understand about -xCORE-AVX512 is it would enable to generate AVX512 Instruction. But when I use the flag it not use AVX512 instruction in fact.


You need to add an additional option along with -xCORE-AVX512.


-xCore-AVX512 -qopt-zmm-usage=high

 

By using this special new flag [Q/q]opt-zmm-usage=high (which should be used in conjunction with -xCORE-AVX512), you'll get full AVX-512 ISA with 512-bits-wide operands.


So try compiling the code with -xCore-AVX512 -qopt-zmm-usage=high, you could see an AVX512 instruction gets generated <__intel_mic_avx512f_memset>


Hope this answers your question.


For more details, please refer 

https://software.intel.com/content/www/us/en/develop/articles/tuning-simd-vectorization-when-targeti...


Regards,

Vidya.


empty
Novice
676 Views

Thanks for your reply. 

 

And I have another question. Can I use -xCore-AVX512 option on icpx which my CPU is Haswell microarchitecture?  Will there be any problem?

VidyalathaB_Intel
Moderator
660 Views

Hi,

>> Can I use -xCore-AVX512 option on icpx which my CPU is Haswell microarchitecture?

You can use that option if your system supports AVX512 registers. You can get the information by using the below command.

lscpu

Please find the below screenshot to get detailed information

 

VidyalathaB_Intel_1-1630577474606.png

 

 

Regards,

Vidya.

 

Viet_H_Intel
Moderator
646 Views

Can I use -xCore-AVX512 option on icpx which my CPU is Haswell microarchitecture? Will there be any problem?


Yes, there will be a problem. You won't be able to run the binary built with -xCORE-AVX512 on Haswell.


VidyalathaB_Intel
Moderator
568 Views

Hi,

Reminder:

Has the information provided helped? If yes, could you please confirm whether we can close this thread from our end?

Regards,

Vidya.


VidyalathaB_Intel
Moderator
500 Views

Hi,


We assume that your issue is resolved. If you need any additional information, please post a new question as this thread will no longer be monitored.


Have a Good day!


Regards,

Vidya.


Reply