自动向量化和/Qvec-report:1和2 [英] Autovectorization and /Qvec-report:1 and 2
问题描述
我有几个c ++项目,我试图找出项目中哪些循环是自动矢量化的,哪些不是自动循环的.我设置了/Qvec-report:1命令行开关,以便获得有关自动循环化了哪些循环的报告.
I have several c++ projects and I am trying to find out which loops in the projects are autovectorized and which aren't. I set the /Qvec-report:1 command line switch so I can get a report of which loops are autovectorized.
这样做在我的C ++项目中均未列出任何清单.
Doing so produced no listing in either of my C++ projects.
然后我切换到/Qvec-report:2
I then switched to /Qvec-report:2
这确实产生了一些关于未自动向量化的循环的报告,但未产生我项目中所有循环的报告,也未产生任何被自动向量化的循环的报告.
This did produce some reports about several loops that were not autovectorized, but it did not produce a report for all the loops in my project, no did it produce a report for any loops that were autovectorized.
我尝试了以下博客示例,网址为http://blogs.msdn.com/b/nativeconcurrency/archive/2012/05/01/auto-vectorizer-in-visual-studio-11-rules-for- loop-header.aspx
I tried several examples off of the blog here http://blogs.msdn.com/b/nativeconcurrency/archive/2012/05/01/auto-vectorizer-in-visual-studio-11-rules-for-loop-header.aspx
他们没有以任何一种方式生成报告.
and they produced no reports one way or the other.
谁能告诉我发生了什么事?
Can anyone tell me what's going on?
推荐答案
如果Qvec-report:1不吐出任何东西,而Qvec-report:2有输出,则意味着您的代码中没有循环可以向量化(1个报告仅成功,而2个报告成功和不成功,因此(2)-(1)=(2)表示所有对象均不可向量化). 不看循环就很难说出循环到底是什么,而且自动矢量化器本身也很脆弱(OTOH,auto-vec是一个难题,至今尚未解决……).您使用的是fp:precise吗?这会阻止auto-vec正常工作,因为 FP数学不是关联的,因此不能保证op汇总后结果的一致性.
If Qvec-report:1 spits out nothing and Qvec-report:2 has output, it means that no loops in your code could be vectorized (1 reports only successful, whereas 2 reports both successful and unsuccessful, so (2) - (1) = (2) means that all are not vectorizable). It is difficult to say what is up with the loops without looking at them, and the auto-vectorizer is reasonably frail itself (OTOH, auto-vec is a hard and as of yet unsolved problem so...). Are you using fp:precise? That prevents auto-vec from working since FP math is not associative, so it cannot guarantee consistency of results post aggregation of ops.
这篇关于自动向量化和/Qvec-report:1和2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!