MSVC 2017是否支持自动CPU分派? [英] Does MSVC 2017 support automatic CPU dispatch?
问题描述
我在一些站点上读到,当使用SSE2体系结构并检测AVX支持运行时时,MSVC实际上可以发出AVX指令.是真的吗?
I read on a few sites that MSVC can actually emit say AVX instructions, when SSE2 architecture is used and detect the AVX support runtime. Is it true?
我测试了肯定会从AVX/AVX2支持中受益的各种循环,但是当在调试器中运行时,我真的找不到任何AVX指令.
I tested various loops that would definitely benefit from AVX/AVX2 support, but when run in debugger I couldn't really find any AVX instructions.
使用/arch:AVX时,它会发出AVX指令,但是它当然会在不支持它的CPU上崩溃(经过测试),因此也没有运行时检测.我可以使用AVX内在函数,并且可以从中成功创建AVX指令.有什么想法吗?
When /arch:AVX is used, then it emits AVX instructions, but it of course crashes on CPUs that doesn't support it (tested), so no runtime detection either. I could use AVX intrinsics though and it would successfully create AVX instructions from them. Any ideas?
推荐答案
我已经与VC ++团队联系,答案是否".问题下的注释中链接的错误报告仅显示正常的错误,而不显示自动调度代码生成器中的错误.
I've contacted the VC++ team, and the answer is "no". The bug reports linked in the comments under the question show only normal bugs, rather than bugs in the auto-dispatch code generator.
因此,如果指定了/arch:SSE2(默认情况下),则VC ++只能自动调度为SSE4.这是当前受支持的唯一形式的自动调度.换句话说,VC ++无法自动调度到AVX/AVX2.
So if /arch:SSE2 is specified (by default), VC++ can only auto-dispatch to SSE4. This is the only form of auto-dispatching that is currently supported. In other words, VC++ cannot auto-dispatch to AVX/AVX2.
这篇关于MSVC 2017是否支持自动CPU分派?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!