summaryrefslogtreecommitdiff
path: root/Source/GPUVerify
diff options
context:
space:
mode:
authorGravatar Peter Collingbourne <peter@pcc.me.uk>2012-05-25 22:00:18 +0100
committerGravatar Peter Collingbourne <peter@pcc.me.uk>2012-05-25 22:00:18 +0100
commitebbd18c6c6429b4daeb0891f7450160cc629bd0c (patch)
treee2890d0eedebf2d09ef9e3aef898103eda1a0531 /Source/GPUVerify
parent29fe39a5fad6699a405ebafa1c0818c71aaf5800 (diff)
GPUVerify: in unstructured mode, disable uniformity analysis and return conservative results
Diffstat (limited to 'Source/GPUVerify')
-rw-r--r--Source/GPUVerify/UniformityAnalyser.cs21
1 files changed, 21 insertions, 0 deletions
diff --git a/Source/GPUVerify/UniformityAnalyser.cs b/Source/GPUVerify/UniformityAnalyser.cs
index c910e64d..bd0e3f74 100644
--- a/Source/GPUVerify/UniformityAnalyser.cs
+++ b/Source/GPUVerify/UniformityAnalyser.cs
@@ -41,6 +41,9 @@ namespace GPUVerify
internal void Analyse()
{
+ if (CommandLineOptions.Unstructured)
+ return;
+
foreach (Declaration D in verifier.Program.TopLevelDeclarations)
{
if(D is Implementation)
@@ -283,6 +286,9 @@ namespace GPUVerify
internal bool IsUniform(string procedureName)
{
+ if (CommandLineOptions.Unstructured)
+ return false;
+
if (!uniformityInfo.ContainsKey(procedureName))
{
return false;
@@ -292,6 +298,9 @@ namespace GPUVerify
internal bool IsUniform(string procedureName, Expr expr)
{
+ if (CommandLineOptions.Unstructured)
+ return false;
+
UniformExpressionAnalysisVisitor visitor = new UniformExpressionAnalysisVisitor(uniformityInfo[procedureName].Value);
visitor.VisitExpr(expr);
return visitor.IsUniform();
@@ -299,6 +308,9 @@ namespace GPUVerify
internal bool IsUniform(string procedureName, string v)
{
+ if (CommandLineOptions.Unstructured)
+ return false;
+
if (!uniformityInfo.ContainsKey(procedureName))
{
return false;
@@ -363,11 +375,17 @@ namespace GPUVerify
internal string GetInParameter(string procName, int i)
{
+ if (CommandLineOptions.Unstructured)
+ return null;
+
return inParameters[procName][i];
}
internal string GetOutParameter(string procName, int i)
{
+ if (CommandLineOptions.Unstructured)
+ return null;
+
return outParameters[procName][i];
}
@@ -388,6 +406,9 @@ namespace GPUVerify
internal bool IsUniform(string proc, WhileCmd wc)
{
+ if (CommandLineOptions.Unstructured)
+ return false;
+
return !nonUniformLoops[proc].Contains(GetLoopId(wc));
}