diff options
author | 2012-06-15 20:57:11 +0100 | |
---|---|---|
committer | 2012-06-15 20:57:11 +0100 | |
commit | eb2b6fda659fda09be89e4360eada2f123a3c80c (patch) | |
tree | ddeda8f0517761bad9047a83f284c6d8724e2fb3 /Source/Core/Util.cs | |
parent | b9e4d44651671f03ce9a1ce5a6801a1ee517be21 (diff) |
GPUVerify: implement is-a-constant analysis
This analysis is used to generate race checking invariants for
arbitrary (thread-level) constant offsets, in place of invariant
generators for four specific constants (thread-id, global-id, 2D
thread-id and 2D global-id) which are subsumed by the new analysis.
The main motivation is to be able to recognise offsets used by
word level accesses into byte arrays, which are formed from linear
combinations of thread IDs and constants.
This change allows us to remove the 2D and global size analyses,
resulting in a 536-line net reduction in total code size.
Diffstat (limited to 'Source/Core/Util.cs')
-rw-r--r-- | Source/Core/Util.cs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/Core/Util.cs b/Source/Core/Util.cs index f45e2995..a8e12f63 100644 --- a/Source/Core/Util.cs +++ b/Source/Core/Util.cs @@ -61,6 +61,11 @@ namespace Microsoft.Boogie { {
foreach (var e in coll) fn(e);
}
+
+ public static IEnumerable<Tuple<TSource1, TSource2>> Zip<TSource1, TSource2>(this IEnumerable<TSource1> source1, IEnumerable<TSource2> source2)
+ {
+ return source1.Zip(source2, (e1, e2) => new Tuple<TSource1, TSource2>(e1, e2));
+ }
}
public class TokenTextWriter : IDisposable {
|