at.dms.kjc.spacetime
Class GreedyLayout

java.lang.Object
  extended by at.dms.kjc.spacetime.GreedyLayout
All Implemented Interfaces:
Layout<RawTile>

public class GreedyLayout
extends Object
implements Layout<RawTile>

This class calculates the assignment of filters to tiles using a greedy bin packing heuristic. At each step, assign the current filter in question to the tile with the least amount of work assigned to it.

Author:
mgordon

Constructor Summary
GreedyLayout(SpaceTimeSchedule spaceTime, RawChip chip)
          Create a new GreedyLayout object that is ready for the packing to begin.
 
Method Summary
 HashMap<SliceNode,RawTile> getAssignment()
           
 int[] getBinWeights()
           
 RawTile getComputeNode(SliceNode node)
          Get the ComputeNode for a Slice
 int maxBinWeight()
           
 void run()
          Calcuate the assignment of filters to tiles.
 void setComputeNode(SliceNode node, RawTile tile)
          Set the ComputeNode for a Slice
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GreedyLayout

public GreedyLayout(SpaceTimeSchedule spaceTime,
                    RawChip chip)
Create a new GreedyLayout object that is ready for the packing to begin.

Parameters:
spaceTime -
chip -
Method Detail

getAssignment

public HashMap<SliceNode,RawTile> getAssignment()

getComputeNode

public RawTile getComputeNode(SliceNode node)
Description copied from interface: Layout
Get the ComputeNode for a Slice

Specified by:
getComputeNode in interface Layout<RawTile>
Parameters:
node - : the SliceNode to look up.
Returns:
the ComputeNode that should execute the SliceNode.

setComputeNode

public void setComputeNode(SliceNode node,
                           RawTile tile)
Description copied from interface: Layout
Set the ComputeNode for a Slice

Specified by:
setComputeNode in interface Layout<RawTile>
Parameters:
node - the SliceNode to associate with ...
tile - the ComputeNode where the SliceNode should execute.

run

public void run()
Calcuate the assignment of filters to tiles.

Specified by:
run in interface Layout<RawTile>

getBinWeights

public int[] getBinWeights()

maxBinWeight

public int maxBinWeight()