Visual C 中的 SSE2 选项 (x64)
我已将 x64 配置添加到我的 C++ 项目中以编译我的应用程序的 64 位版本。 一切看起来都很好,但编译器给出了以下警告:
`cl : Command line warning D9002 : ignoring unknown option '/arch:SSE2'`
是否有 SSE2 优化真的不适用于 64 位项目?
I've added x64 configuration to my C++ project to compile 64-bit version of my app. Everything looks fine, but compiler gives the following warning:
`cl : Command line warning D9002 : ignoring unknown option '/arch:SSE2'`
Is there SSE2 optimization really not available for 64-bit projects?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
似乎所有 64 位处理器都有 SSE2。 由于编译器选项始终默认打开,因此无需手动打开它。
来自维基百科:
Seems to be all 64-bit processors has SSE2. Since compiler option always switched on by default no need to switch it on manually.
From Wikipedia:
编译器选项 /arch:AVX 不适用于旧 CPU,因此您需要确保您的 CPU 支持它。 当我不得不为不支持的旧 Xeon CPU 重新编译 1.12 张量流包时,我遇到了这个问题。
我已经打开了上面发布的 /arch:SSE2 (如 Kirill),但遇到了完全相同的问题。 Microsoft 编译器发出警告 (INFO),表明此选项将被忽略。
根据 Microsoft 文档,我的理解是此选项仅在 x86 上可用,这对我来说也没有意义。
然而 MSDN 上说:
并且 SSE 无论如何都在 x64 上使用。 因此我现在删除了该选项。
The compiler option /arch:AVX will not work on old CPUs hence you need to ensure your CPU supports it. I ran into this issues when I had to re-compile the 1.12 tensorflow package for my old Xeon CPU which does not support.
I have switched on /arch:SSE2 (as Kirill) posted above but getting exactly same issue. The Microsoft compiler issues a warning (INFO) that this option will be ignored.
From the Microsoft documentation my understanding is that this option is only available on x86 and that does not make sense to me either.
However on MSDN says:
and that SSE is used on x64 anyways. Hence I just removed the option now.
我理解如果您选择 SSE2 会出现的警告,尽管它仍然很愚蠢。 但是,如果您选择 /arch:AVX,您仍然会收到警告。 我确信 SP1 会修复这个问题。 它只是有点垃圾邮件和烦恼。
I understand the warning appearing if you choose SSE2, althought its still silly. However you still get the warning if you select /arch:AVX. I'm sure it'll get fixed with SP1. Its just a bit spammy and an annoyance.