Deeploy.TilingExtension.CodeTransformationPasses.TilingVariableReplacement.TilingVariableReplacementUpdate
- class Deeploy.TilingExtension.CodeTransformationPasses.TilingVariableReplacement.TilingVariableReplacementUpdate(targetMemLevel: str, tileIdxVar: str = 'TILING_I')
Bases:
CodeTransformationPass,IntrospectiveCodeTransformationMixIn,TilingHoistingMixInMethods
- __init__(targetMemLevel: str, tileIdxVar: str = 'TILING_I')
__init__(targetMemLevel[, tileIdxVar])apply(ctxt, executionBlock, name[, verbose])Apply the CodeTransformation to an ExecutionBlock
dereferenceVars(template, varNames)Dereference the specified variables in the given template.
extractDynamicReferences(ctxt[, ...])Extract all dynamic references from the given execution block.
indexVars(template, varNames, index)Index the specified variables in the given template.
Attributes
parseTreeDictprefix- apply(ctxt: NetworkContext, executionBlock: ExecutionBlock, name: str, verbose: CodeGenVerbosity = CodeGenVerbosity(tilingProfiling=None, untiledProfiling=None)) Tuple[NetworkContext, ExecutionBlock]
Apply the CodeTransformation to an ExecutionBlock
- Parameters:
ctxt (NetworkContext) – Current NetworkContext
executionBlock (ExecutionBlock) – ExecutionBlock whose code you’d like to transform
name (str) – Graph node name of the operator being targetted
verbose (CodeGenVerbosity) – Control the verbosity of code generation
- Returns:
Updated NetworkContext and ExecutionBlock
- Return type:
Tuple[NetworkContext, ExecutionBlock]
- static dereferenceVars(template: Template, varNames: List[str]) None
Dereference the specified variables in the given template.
This function modifies the provided template in place by dereferencing the variables listed in varNames. The template is modified in place.
- Parameters:
template (Template) – The template object to be modified.
varNames (list of str) – List of variable names to dereference within the template.
- extractDynamicReferences(ctxt: NetworkContext, executionBlock: ExecutionBlock = None, unrollStructs=False, includeGlobalReferences=False)
Extract all dynamic references from the given execution block.
- Parameters:
ctxt (NetworkContext) – The network context.
executionBlock (ExecutionBlock, optional) – The execution block.
unrollStructs (bool, optional) – Whether to unroll structs.
includeGlobalReferences (bool, optional) – Whether to include global references.
- Returns:
A list of dynamic references.
- Return type:
List[str]
- static indexVars(template: Template, varNames: List[str], index: str) None
Index the specified variables in the given template.
Modifies the template in place by indexing the specified variable names.
- Parameters:
template (Template) – The template to modify.
varNames (List[str]) – The variable names to index.
index (str) – The index to use.