Files
concrete/docs/dev/api/concrete.compiler.compilation_feedback.md
Benoit Chevallier-Mames e352eff1b3 docs(compiler): adding API doc
2024-03-13 14:52:46 +01:00

4.6 KiB

module concrete.compiler.compilation_feedback

Compilation feedback.


function tag_from_location

tag_from_location(location)

Extract tag of the operation from its location.


class CompilationFeedback

CompilationFeedback is a set of hint computed by the compiler engine.

method __init__

__init__(compilation_feedback: CompilationFeedback)

Wrap the native Cpp object.

Args:

  • compilation_feeback (_CompilationFeedback): object to wrap

Raises:

  • TypeError: if compilation_feedback is not of type _CompilationFeedback

method count

count(operations: Set[PrimitiveOperation])  int

Count the amount of specified operations in the program.

Args: operations (Set[PrimitiveOperation]): set of operations used to filter the statistics

Returns: int: number of specified operations in the program


method count_per_parameter

count_per_parameter(
    operations: Set[PrimitiveOperation],
    key_types: Set[KeyType],
    client_parameters: ClientParameters
)  Dict[Parameter, int]

Count the amount of specified operations in the program and group by parameters.

Args: operations (Set[PrimitiveOperation]): set of operations used to filter the statistics

key_types (Set[KeyType]): set of key types used to filter the statistics

client_parameters (ClientParameters): client parameters required for grouping by parameters

Returns: Dict[Parameter, int]: number of specified operations per parameter in the program


method count_per_tag

count_per_tag(operations: Set[PrimitiveOperation])  Dict[str, int]

Count the amount of specified operations in the program and group by tags.

Args: operations (Set[PrimitiveOperation]): set of operations used to filter the statistics

Returns: Dict[str, int]: number of specified operations per tag in the program


method count_per_tag_per_parameter

count_per_tag_per_parameter(
    operations: Set[PrimitiveOperation],
    key_types: Set[KeyType],
    client_parameters: ClientParameters
)  Dict[str, Dict[Parameter, int]]

Count the amount of specified operations in the program and group by tags and parameters.

Args: operations (Set[PrimitiveOperation]): set of operations used to filter the statistics

key_types (Set[KeyType]): set of key types used to filter the statistics

client_parameters (ClientParameters): client parameters required for grouping by parameters

Returns: Dict[str, Dict[Parameter, int]]: number of specified operations per tag per parameter in the program