ICC -XCORE -AVX2是否强迫AVX512在Xeon Gold上进行的不利用,如果-O3开启?

发布于 2025-02-13 07:29:41 字数 235 浏览 2 评论 0原文

根据标题,

下的ICC -O3 -XCORE -AVX2 PROGRAM在ICC -O3 -XCORE -AVX2 PROGRAM上编译的程序

将在ICC -O3 -XCore -avx2 Program.cpp

生成Xeon Gold 61xx上生成AVX512指令

吗?我们的汇编分析似乎没有找到一个,但这并不保证。

谢谢!

As per the title,

Will programs compiled with the intel compiler under

icc -O3 -xCORE-AVX2 program.cpp

Generate AVX512 instructions on a Xeon Gold 61XX?

Our assembler analysis doesn't seem to find one, but that is no guarantee.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

沉溺在你眼里的海 2025-02-20 07:29:41

在ICC Classic中,不,您可以在不告诉编译器启用编译器的情况下使用内在的任何说明。 (与GCC或Clang不同,您必须启用指令集以使用其内在设备,例如基于LLVM的Intel Oneapi编译器。)

,但编译器不会发出Interinsics以外的AVX-512指令((或Inline ASM),不启用-March = Skylake-AVX512-March =本机 (aka -XHOST)或类似的选项,暗示-mavx512f。或pragma或__属性__((目标(“ string”)))以启用单个功能的AVX-512。

对于所有主要的X86编译器来说都是如此,默认情况下,AVX-512不在。

使用-O3 -March =本机如果要对正在运行的机器进行优化的代码,就像使用GCC或Clang一样。


在ICC Classic中,您还可以使用_ALLOW_CPU_FEATURES(_FEATURE_AVX512F | _FEATURE_BMI)使用_ALLOD_CPU_FEATURES使用某些指令集使用某些指令集; Gen。请参阅文档

也相关: /avx intinisics 回复:GCC/Clang vs. MSVC与ICC。

In ICC classic, no, you can use intrinsics for any instruction without telling the compiler to enable it. (Unlike GCC or clang where you have to enable instruction sets to use their intrinsics, like the LLVM-based Intel OneAPI compiler.)

But the compiler won't emit AVX-512 instructions other than from intrinsics (or inline asm), without enabling a -march=skylake-avx512 or -march=native (aka -xHOST) or similar option that implies -mavx512f. Or a pragma or __attribute__((target("string"))) to enable AVX-512 for a single function.

This is true for all the major x86 compilers, AVX-512 is not on by default.

Use -O3 -march=native if you want to make code optimized for the machine you're running on, just like with GCC or clang.


In ICC classic, you can also let the compiler use certain instruction-sets on a per-function basis, with _allow_cpu_features(_FEATURE_AVX512F|_FEATURE_BMI); which works more like a pragma, affecting compile-time code-gen. See the docs.

Also related: The Effect of Architecture When Using SSE / AVX Intrinisics re: gcc/clang vs. MSVC vs. ICC.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文