]> git.unchartedbackwaters.co.uk Git - francis/ofc.git/commitdiff
Add trivial SpatialRestriction consumer.
authorFrancis Russell <francis@unchartedbackwaters.co.uk>
Tue, 7 Feb 2012 19:14:14 +0000 (19:14 +0000)
committerFrancis Russell <francis@unchartedbackwaters.co.uk>
Tue, 7 Feb 2012 19:14:14 +0000 (19:14 +0000)
src/ofc/generators/onetep/LoopTree.scala
src/ofc/generators/onetep/SpatialRestriction.scala

index f6b71d042aabd79caa893b5433ede437bf5764cc..7c218d29c3951e6c65da814e3f8a5768a0fdaf87 100644 (file)
@@ -53,7 +53,7 @@ class LoopNest(sortedIndices: List[Index]) {
     val fragmentsInfo = new FragmentsInfo(consumer, transform, producer)
     spaceFragmentsInfo += (space -> fragmentsInfo)
 
-    val consumerIndices = getSortedIndices((for (op <- operands; index <- op.getIndices) yield index).toSet)
+    val consumerIndices = getSortedIndices((for (op <- operands; index <- op.getInternalIndices) yield index).toSet)
     consumer match {
       case Some(fragment) => base.addFragment(consumerIndices, fragment)
       case None =>
index 89df1f2e2de003f25bdbe41037def38d33de60ad..3f5fe00ab3501df63997df93a7874057ac09e75b 100644 (file)
@@ -18,7 +18,11 @@ class SpatialRestriction(op: IterationSpace) extends IterationSpace {
   def getDiscreteIndices = op.getDiscreteIndices
   def getExternalIndices = Set()
 
-  def getConsumerGenerator = None
+  def getConsumerGenerator = Some(new ConsumerGenerator {
+    def generate(names: NameManager, indices: Map[Index,String], values : Map[IterationSpace, String]) : String = {
+      "!SpatialRestriction consumer."
+    }
+  })
   def getTransformGenerator = None
   def getProducerGenerator = None
 }