qat.frontend.custom module

class CustomFrontend(model, pipeline=None)

Bases: BaseFrontend

Frontend that uses a custom pipeline to compile the input to an IR. While it is not equipped with a specific parser, it allows the user to specify custom compilation requirements via a pipeline.

Parameters:
check_and_return_source(src)

Custom frontends are too flexible to have any type checking, so just return the source file.

emit(src, res_mgr=None, met_mgr=None, compiler_config=None)

Compiles an input QatInput down to QatIR with the custom pipeline and emits it. :type _sphinx_paramlinks_qat.frontend.custom.CustomFrontend.emit.src: Union[str, bytes, InstructionBuilder] :param _sphinx_paramlinks_qat.frontend.custom.CustomFrontend.emit.src: The high-level input. :type _sphinx_paramlinks_qat.frontend.custom.CustomFrontend.emit.res_mgr: Optional[ResultManager] :param _sphinx_paramlinks_qat.frontend.custom.CustomFrontend.emit.res_mgr: Collection of analysis results with caching and aggregation

capabilities, defaults to None.

Parameters:
  • met_mgr (Optional[MetricsManager]) – Stores useful intermediary metrics that are generated during compilation, defaults to None.

  • compiler_config (Optional[CompilerConfig]) – Compiler settings, defaults to None.

Returns:

An intermediate representation as an InstructionBuilder which holds a list of instructions to be executed on the QPU.