TimeloopFE
Loading...
Searching...
No Matches
timeloopfe.v4.processors.constraint_macro.ConstraintMacroProcessor Class Reference

Defines constraint macros to be used for simplifying constraint specification. More...

Inheritance diagram for timeloopfe.v4.processors.constraint_macro.ConstraintMacroProcessor:
Collaboration diagram for timeloopfe.v4.processors.constraint_macro.ConstraintMacroProcessor:

Public Member Functions

 __init__ (self, *args, **kwargs)
 
 declare_attrs (self)
 Initialize the attributes that the processor is responsible for.
 
Dict[str, int] get_unconstrained_dims (self, Specification spec)
 
Dict[str, int] get_constrained_dims (self, Factors factors, Specification spec)
 
 process (self, Specification spec)
 Process the specification.
 
- Public Member Functions inherited from timeloopfe.common.processor.Processor
 pre_parse_process (self, "Specification" spec)
 Process the specification before parsing.
 
 get_index (self, type processor_type, "Specification" spec)
 Get the index of the processor in the list of processors.
 
 must_run_after (self, type other, "Specification" spec, bool ok_if_not_found=False)
 Ensure that this processor runs after another processor.
 
 add_attr (self, Node target, *args, **kwargs)
 

Additional Inherited Members

- Public Attributes inherited from timeloopfe.common.processor.Processor
 logger = logging.getLogger(self.__class__.__name__)
 
 spec = spec
 
- Protected Attributes inherited from timeloopfe.common.processor.Processor
bool _initialized = True
 

Detailed Description

Defines constraint macros to be used for simplifying constraint specification.

Iteration constraint macros:

  • factors_only: Only the listed factors are allowed. Other factors are set to 1. e.g. factors_only: "A=5" -> factors: A=5, B=1, C=1, ...
  • no_iteration_over_dataspaces: Takes a list of dataspaces. Iteration over all factors of these dataspaces is disabled. e.g. no_iteration_over_dataspaces: ["Weights"] -> factors: R=1 S=1 C=1 M=1 if the factors in weights are RSCM
  • must_iterate_over_dataspaces: Takes a list of dataspaces. Must iterate over the union of factors of these dataspaces.
  • maximize_dims: Takes a list of lists of dimensions. Each list of dimensions is maximized. e.g. maximize_dims: [ [R, S], [C, M] ] -> find the largest factors of R and S that we can fit, then find the largest factors of C and M that we can fit. In a spatial constraint, this uses the fanout of the leaf. In a temporal constraint, this uses a maximize_dims_capacity directive.

Dataspace constraint macros:

  • keep_only: Only the listed dataspaces are kept. All other dataspaces are bypassed.
  • bypass_only: Only the listed dataspaces are bypassed. All other dataspaces are kept.

Constructor & Destructor Documentation

◆ __init__()

timeloopfe.v4.processors.constraint_macro.ConstraintMacroProcessor.__init__ ( self,
* args,
** kwargs )

Member Function Documentation

◆ declare_attrs()

timeloopfe.v4.processors.constraint_macro.ConstraintMacroProcessor.declare_attrs ( self)

Initialize the attributes that the processor is responsible for.

!

Note
This method is called before process() is called. See the SimpleProcessor for an example.

Reimplemented from timeloopfe.common.processor.Processor.

◆ get_constrained_dims()

Dict[str, int] timeloopfe.v4.processors.constraint_macro.ConstraintMacroProcessor.get_constrained_dims ( self,
Factors factors,
Specification spec )

◆ get_unconstrained_dims()

Dict[str, int] timeloopfe.v4.processors.constraint_macro.ConstraintMacroProcessor.get_unconstrained_dims ( self,
Specification spec )

◆ process()

timeloopfe.v4.processors.constraint_macro.ConstraintMacroProcessor.process ( self,
Specification spec )

Process the specification.

Reimplemented from timeloopfe.common.processor.Processor.


The documentation for this class was generated from the following file: