|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.dms.kjc.sir.EmptyStreamVisitor
at.dms.kjc.sir.statespace.LinearReplacer
at.dms.kjc.sir.statespace.LinearDirectReplacer
public class LinearDirectReplacer
A LinearDirectReplacer replaces the contents of the work functions for linear filters (as determined by the linear filter analyzer) with an appropriate direct implementation (eg a bunch of push statements with the specified combination of input values.
Eg a filter that had linear form [1; 2; 3]+4 would get a work function:
work { push(3*peek(0) + 2*peek(1) + 1*peek(2) + 4); }It also can replace splitjoins and pipelines with linear representations with a single filter that computes the same function.
Field Summary |
---|
Fields inherited from interface at.dms.kjc.Constants |
---|
CMP_VERSION, JAV_CLASS, JAV_CLONE, JAV_CLONEABLE, JAV_CONSTRUCTOR, JAV_ERROR, JAV_EXCEPTION, JAV_INIT, JAV_LENGTH, JAV_NAME_SEPARATOR, JAV_OBJECT, JAV_OUTER_THIS, JAV_RUNTIME, JAV_RUNTIME_EXCEPTION, JAV_STATIC_INIT, JAV_STRING, JAV_STRINGBUFFER, JAV_THIS, JAV_THROWABLE, OPE_BAND, OPE_BNOT, OPE_BOR, OPE_BSR, OPE_BXOR, OPE_EQ, OPE_GE, OPE_GT, OPE_LE, OPE_LNOT, OPE_LT, OPE_MINUS, OPE_NE, OPE_PERCENT, OPE_PLUS, OPE_POSTDEC, OPE_POSTINC, OPE_PREDEC, OPE_PREINC, OPE_SIMPLE, OPE_SL, OPE_SLASH, OPE_SR, OPE_STAR, TID_ARRAY, TID_BIT, TID_BOOLEAN, TID_BYTE, TID_CHAR, TID_CLASS, TID_DOUBLE, TID_FLOAT, TID_INT, TID_LONG, TID_SHORT, TID_VECTOR, TID_VOID, VECTOR_EMPTY |
Constructor Summary | |
---|---|
protected |
LinearDirectReplacer(LinearAnalyzer lfa,
at.dms.kjc.sir.statespace.LinearDirectReplacer.LinearReplaceCalculator costs)
|
Method Summary | |
---|---|
static void |
doReplace(LinearAnalyzer lfa,
SIRStream str)
Start the process of replacement on str using the Linearity information in lfa. |
protected SIRFilter |
makeEfficientImplementation(SIRStream oldStream,
LinearFilterRepresentation linearRep)
Creates a filter that has a work function that directly implements the linear representation that is passed in. |
Vector |
makeInitPushStatementVector(LinearFilterRepresentation representation,
CType inputType,
CType outputType)
Generate a Vector of JExpressionStatements which wrap SIRPushExpressions that implement (directly) the matrix multiplication represented by the linear representation. |
Vector |
makePushStatementVector(LinearFilterRepresentation representation,
CType inputType,
CType outputType)
Generate a Vector of JExpressionStatements which wrap SIRPushExpressions that implement (directly) the matrix multiplication represented by the linear representation. |
boolean |
makeReplacement(SIRStream self)
Visit a pipeline, splitjoin or filter, replacing them with a new filter that directly implements the linear representation. |
Methods inherited from class at.dms.kjc.sir.EmptyStreamVisitor |
---|
postVisitStream, preVisitStream, visitPhasedFilter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected LinearDirectReplacer(LinearAnalyzer lfa, at.dms.kjc.sir.statespace.LinearDirectReplacer.LinearReplaceCalculator costs)
Method Detail |
---|
public static void doReplace(LinearAnalyzer lfa, SIRStream str)
public boolean makeReplacement(SIRStream self)
makeReplacement
in class LinearReplacer
protected SIRFilter makeEfficientImplementation(SIRStream oldStream, LinearFilterRepresentation linearRep)
public Vector makePushStatementVector(LinearFilterRepresentation representation, CType inputType, CType outputType)
public Vector makeInitPushStatementVector(LinearFilterRepresentation representation, CType inputType, CType outputType)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |