From: Francis Russell Date: Tue, 7 Feb 2012 19:14:14 +0000 (+0000) Subject: Add trivial SpatialRestriction consumer. X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=4596547bc2e758418d3b82854ea5570e7804012a;p=francis%2Fofc.git Add trivial SpatialRestriction consumer. --- diff --git a/src/ofc/generators/onetep/LoopTree.scala b/src/ofc/generators/onetep/LoopTree.scala index f6b71d0..7c218d2 100644 --- a/src/ofc/generators/onetep/LoopTree.scala +++ b/src/ofc/generators/onetep/LoopTree.scala @@ -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 => diff --git a/src/ofc/generators/onetep/SpatialRestriction.scala b/src/ofc/generators/onetep/SpatialRestriction.scala index 89df1f2..3f5fe00 100644 --- a/src/ofc/generators/onetep/SpatialRestriction.scala +++ b/src/ofc/generators/onetep/SpatialRestriction.scala @@ -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 }