示例#1
0
 private static void CollectStatistics(WorkUnit work, RewriterTaskFactory factory)
 {
     for (int chunkSize = MinChunkSize; chunkSize <= MemorySize; chunkSize *= 16)
     {
         Console.Out.WriteLine("    {0}, chunk size {1}", factory.Name, chunkSize);
         long sum         = 0;
         long totClusters = 0;
         for (int rep = 0; rep < CReps; ++rep)
         {
             var sc = new ChunkScanner(work, chunkSize);
             var(msec, clusters) = sc.DoIt(factory);
             sum         += msec;
             totClusters += clusters;
             Console.Out.Write(" {0,7}", msec);
             Console.Out.Flush();
             GC.Collect();
         }
         var avg      = sum / (double)CReps;
         var perInstr = sum * 1000.0 / totClusters;
         Console.Out.WriteLine(", avg: {0:0.000} msec; {1:0.000} usec/rtl cluster {2,6} clusters;", avg, perInstr, totClusters);
     }
 }
示例#2
0
 public ShingleTask(WorkUnit work, int iStart, int iEnd)
     : base(work, iStart, iEnd)
 {
     rewriters = new Dictionary <int, IEnumerator <RtlInstructionCluster> >();
 }
示例#3
0
 public LinearTask(WorkUnit workUnit, int iStart, int iEnd) : base(workUnit, iStart, iEnd)
 {
 }
示例#4
0
 protected RewriterTask(WorkUnit workUnit, int i, int v)
 {
     this.workUnit = workUnit;
     this.iStart   = i;
     this.iEnd     = v;
 }
示例#5
0
 public abstract RewriterTask Create(WorkUnit workUnit, int iStart, int iEnd);
示例#6
0
 public LinearShingleTask(WorkUnit work, int iStart, int iEnd)
     : base(work, iStart, iEnd)
 {
     visited = new bool[iEnd - iStart];
 }
示例#7
0
 public override RewriterTask Create(WorkUnit workUnit, int iStart, int iEnd)
 {
     return(new ShingleTask(workUnit, iStart, iEnd));
 }
示例#8
0
 public ChunkScanner(WorkUnit workUnit, int chunkSize)
 {
     this.workUnit  = workUnit;
     this.chunkSize = chunkSize;
 }