MLIR Passes v1.0
Loading...
Searching...
No Matches
Examples.hpp File Reference

Go to the source code of this file.

Macros

#define CUDAQ_PREFIX_FUNCTION   "__nvqpp__mlirgen__"
 Macro defining the prefix of each quantum kernel generated by QUAKE MLIR. This macro is used to identify MLIR/Quake quantum kernels.
 

Functions

std::unique_ptr< mlir::Pass > mqss::opt::createCustomExamplePass ()
 Example custom MLIR pass.
 
std::unique_ptr< mlir::Pass > mqss::opt::createPrintQuakeGatesPass (llvm::raw_string_ostream &ostream)
 Example MLIR pass that traverses a given MLIR/Quake.
 

Detailed Description

Header file that defines the signature for each MLIR/Quake defined into the Munich Quantum Software Stack (MQSS).

This header must be included to use the collection of example passes that are part of the MQSS.

Function Documentation

◆ createCustomExamplePass()

std::unique_ptr< mlir::Pass > mqss::opt::createCustomExamplePass ( )

Example custom MLIR pass.

This method constructs an mlir::Pass of the type CustomExamplePass. This pass operates on any given MLIR/Quake module and replaces all Hadamard gates into a quantum circuit by S gates.

Returns
An mlir::Pass object containing the definition of the CustomExamplePass. This mlir::Pass object has to be passed to an mlir::PassManager to transform any given MLIR module.

◆ createPrintQuakeGatesPass()

std::unique_ptr< mlir::Pass > mqss::opt::createPrintQuakeGatesPass ( llvm::raw_string_ostream & ostream)

Example MLIR pass that traverses a given MLIR/Quake.

This method constructs an mlir::Pass of the type PrintQuakeGatesPas. This pass operates on any MLIR/Quake module and visit each operation dumping its name and type into the parameter ostream.

Parameters
[out]ostreamA raw stream object that stores information about any given MLIR module.
Returns
An mlir::Pass object containing the definition of the PrintQuakeGatesPas. This mlir::Pass object has to be passed to an mlir::PassManager to take effect on any given MLIR module.