From 4596547bc2e758418d3b82854ea5570e7804012a Mon Sep 17 00:00:00 2001 From: Francis Russell Date: Tue, 7 Feb 2012 19:14:14 +0000 Subject: [PATCH] Add trivial SpatialRestriction consumer. --- src/ofc/generators/onetep/LoopTree.scala | 2 +- src/ofc/generators/onetep/SpatialRestriction.scala | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) 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 } -- 2.47.3