|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectat.dms.kjc.backendSupport.BackEndFactory<ComputeNodesType,ComputeNodeType,CodeStoreType,ComputeNodeSelectorArgType>
ComputeNodesType - Instantiate to type of a collection of ComputeNodes.ComputeNodeType - Instantiate to type of an individual ComputeNodeCodeStoreType - Instantiate to type of a ComputeCodeStore.ComputeNodeSelectorArgType - Instantiate to base type of array of extra arguments to
getComputeNode. (Necessary for overriding method with reasonable
types.)public abstract class BackEndFactory<ComputeNodesType extends ComputeNodesI<?>,ComputeNodeType extends ComputeNode<?>,CodeStoreType extends ComputeCodeStore<?>,ComputeNodeSelectorArgType>
Factor out parts of back end that need matching types. A BackEndFactory should generate the parts needed for a back end.
BackEndAbsFactory| Field Summary | |
|---|---|
protected Layout<ComputeNodeType> |
layout
|
| Constructor Summary | |
|---|---|
BackEndFactory()
|
|
| Method Summary | ||
|---|---|---|
abstract
|
getBackEndMain()
|
|
abstract Channel |
getChannel(Edge e)
Back end needs to generate subclasses of channel. |
|
abstract Channel |
getChannel(SliceNode src,
SliceNode dst)
Back end needs to generate subclasses of channel. |
|
Collection<Channel> |
getChannels()
Back end needs to accumulate channels to pass to the code emitter. |
|
abstract CodeStoreHelper |
getCodeStoreHelper(SliceNode node)
Select a CodeStoreHelper subclass given a SliceNode. |
|
abstract CodeStoreType |
getComputeCodeStore(ComputeNodeType parent)
|
|
abstract ComputeNodeType |
getComputeNode(ComputeNodeSelectorArgType specifier)
Get a specified compute node. |
|
abstract ComputeNodesType |
getComputeNodes()
|
|
Layout<ComputeNodeType> |
getLayout()
Get saved copy of Layout. |
|
abstract void |
processFilterSliceNode(FilterSliceNode filter,
SchedulingPhase whichPhase,
ComputeNodesType computeNodes)
Process a filter slice node: find the correct ProcElement(s) and add code and buffers. |
|
abstract void |
processFilterSlices(Slice slice,
SchedulingPhase whichPhase,
ComputeNodesType computeNodes)
Process all filter slice nodes in a Slice (just one in a SimpleSlice): find the correct ProcElement(s) and add filter code. |
|
abstract void |
processInputSliceNode(InputSliceNode input,
SchedulingPhase whichPhase,
ComputeNodesType computeNodes)
Process an input slice node: find the correct ProcElement(s) and add joiner code, and buffers. |
|
abstract void |
processOutputSliceNode(OutputSliceNode output,
SchedulingPhase whichPhase,
ComputeNodesType computeNodes)
Process an output slice node: find the correct ProcElement(s) and add splitter code, and buffers. |
|
void |
setLayout(Layout<ComputeNodeType> layout)
Keep a copy of the Layout: the mapping from SliceNode to
ComputeNode. |
|
boolean |
sliceHasDownstreamChannel(Slice s)
|
|
boolean |
sliceHasUpstreamChannel(Slice s)
|
|
boolean |
sliceNeedsJoinerCode(Slice s)
Slice needs code for a joiner if it has input from more than one source. |
|
boolean |
sliceNeedsJoinerWorkFunction(Slice s)
Slice needs work function for a joiner. |
|
boolean |
sliceNeedsPeekBuffer(Slice s)
Does slice need a peek buffer before first filter? Really depends on where input is coming from: filter on this ComputeNode? Joiner on this ComputeNode?, Filter on another Compute Node? If so is there shared memory? ... |
|
boolean |
sliceNeedsPokeBuffer(Slice s)
Does slice need a buffer between its final filter and its splitter? |
|
boolean |
sliceNeedsSplitterCode(Slice s)
Slice needs code for a splitter if it has output on more than one edge. |
|
boolean |
sliceNeedsSplitterWorkFunction(Slice s)
Haven't yet found a situation where we need to buffer output to splitter but may well: perhaps if prework pushes different number of items from what work pushes? |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Layout<ComputeNodeType extends ComputeNode<?>> layout
| Constructor Detail |
|---|
public BackEndFactory()
| Method Detail |
|---|
public abstract <T extends BackEndScaffold> T getBackEndMain()
... - needs same parameterization as this so as to be able to refer to this.
Channels and
ComputeCodeStores for the ComputeNodes.
public abstract void processInputSliceNode(InputSliceNode input,
SchedulingPhase whichPhase,
ComputeNodesType computeNodes)
input - the InputSliceNodewhichPhase - INIT / PRIMEPUMP / STEADYcomputeNodes - the available compute nodes.
public abstract void processFilterSlices(Slice slice,
SchedulingPhase whichPhase,
ComputeNodesType computeNodes)
slice - Slice containing filterswhichPhase - INIT / PRIMEPUMP / STEADYcomputeNodes - the available compute nodes.
public abstract void processFilterSliceNode(FilterSliceNode filter,
SchedulingPhase whichPhase,
ComputeNodesType computeNodes)
filter - the FilterSliceNode.whichPhase - INIT / PRIMEPUMP / STEADYcomputeNodes - the available compute nodes.
public abstract void processOutputSliceNode(OutputSliceNode output,
SchedulingPhase whichPhase,
ComputeNodesType computeNodes)
output - the OutputSliceNode.whichPhase - INIT / PRIMEPUMP / STEADYcomputeNodes - the available compute nodes.public abstract ComputeNodesType getComputeNodes()
public abstract CodeStoreType getComputeCodeStore(ComputeNodeType parent)
ComputeCodeStore.public abstract ComputeNodeType getComputeNode(ComputeNodeSelectorArgType specifier)
specifier - Different instantiations will have different number of
arguments to specify which node, so a specifier (String, int, array[int]...) here.
public void setLayout(Layout<ComputeNodeType> layout)
Layout: the mapping from SliceNode to
ComputeNode.
layout - public Layout<ComputeNodeType> getLayout()
Layout.
public Collection<Channel> getChannels()
public abstract Channel getChannel(Edge e)
e - the edge.
public abstract Channel getChannel(SliceNode src,
SliceNode dst)
src - dst -
public abstract CodeStoreHelper getCodeStoreHelper(SliceNode node)
node - the SliceNode.
public boolean sliceNeedsPokeBuffer(Slice s)
public boolean sliceNeedsPeekBuffer(Slice s)
s - a Slice
public boolean sliceHasUpstreamChannel(Slice s)
public boolean sliceHasDownstreamChannel(Slice s)
public boolean sliceNeedsJoinerCode(Slice s)
s - Slice
public boolean sliceNeedsJoinerWorkFunction(Slice s)
sliceNeedsJoinerCode(Slice) since
there may need to be code generated for a joiner, but the work function may be
rolled into the code for a filter.
s - Slice
public boolean sliceNeedsSplitterCode(Slice s)
s -
public boolean sliceNeedsSplitterWorkFunction(Slice s)
s -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||