使用 __AVX512F__ 在 Visual Studio 编译代码

huangapple go评论58阅读模式
英文:

Usage of __AVX512F__ in Visual Studio for compiling code

问题

我想使用 __AVX512F__ 来编译代码的特定部分。

#ifndef __AVX512F__
    #undef flag1
#endif

要使用该标志,我右键单击了我的 Visual Studio 项目,并启用了增强指令集。即使我使用的是 AVX512 机器,flag1 仍然被取消定义。然后我尝试在右键单击项目文件后,在预处理器指令中设置标志 __AVX512F__。但这也没有起作用。

我需要做其他什么才能使其工作?我是不是漏掉了什么?

英文:

I want to use __AVX512F__ to compile specific parts of the code.

   #ifndef __AVX512F__
       #undef flag1
   #endif

To use the flag I right clicked on my visual studio project and set the enable enhanced instruction set. Even though I was using an AVX512 machine the flag1 was still getting undefined. I then also tried to set the flag __AVX512F__ in preprocessor directives after right clicking my proj file. But that also didnt work.

Should I do anything else to make this work and am I missing something here?

答案1

得分: 1

谢谢大家。AVX512F 似乎是在机器配置无关的情况下设置的(如果编译器支持 AVX512 并且启用了增强指令集:高级矢量扩展 512(/arch:AVX512))。要使用这些标志并使用基于我所需的这些标志定义的标志,我需要在解决方案中的所有那些项目文件上设置该选项。

英文:

Thanks All. The AVX512F seems to be set irrespective of the machine configuration(processor supporting AVX512) if the compiler supports AVX512 and Enable Enhanced Instruction Set :Advanced Vector Extensions 512 (/arch:AVX512) is set. To use the flags and use those flags defined based on I needed to set that option across all those project files in the solution

huangapple
  • 本文由 发表于 2023年3月7日 10:37:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/75657581.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定