|
picceler
|
Namespaces | |
| namespace | utils |
Classes | |
| struct | AssignmentNode |
| AST node for assignment statements. More... | |
| struct | ASTNode |
| Abstract Syntax Tree (AST) node base class. More... | |
| struct | BrightnessToAffine |
| struct | CallNode |
| AST node for function calls. More... | |
| class | CLIOptions |
| Struct to hold command-line options for the compiler. More... | |
| struct | CompileError |
| Struct to hold compilation error information. More... | |
| class | Compiler |
| Compiler class that orchestrates the compilation process. More... | |
| struct | CropToAffine |
| struct | ElementWiseBinaryOpToAffine |
| struct | FilterToConvolutionPattern |
| struct | ImageAccessHelper |
| Helper class to generate LLVM IR for accessing fields of the Image struct via an opaque pointer. Assumes the following C++ struct layout: struct Image { uint32_t _width; // Offset 0 uint32_t _height; // Offset 4 unsigned char *_data; // Offset 8 };. More... | |
| struct | InvertToAffine |
| class | IRPassManager |
| Wrapper around MLIR PassManager to manage and run passes. More... | |
| struct | KernelData |
| struct | KernelNode |
| AST node for kernel definitions. More... | |
| struct | KernelToMemref |
| class | Lexer |
| Lexical analyzer for the picceler programming language. More... | |
| struct | LoadImageToCall |
| Pattern to lower LoadImageOp to a function call. More... | |
| class | MLIRGen |
| MLIR code generator that converts AST nodes to MLIR constructs. This offers the initial IR generation from the AST. More... | |
| struct | ModuleNode |
| AST node for the entire module. More... | |
| struct | NeighbourhoodOpsToAffine |
| struct | NumberNode |
| AST node for numeric literals. More... | |
| class | Parser |
| The Parser class that converts tokens into an AST. More... | |
| struct | PassLogger |
| Custom struct to log pass execution using spdlog. This struct implements the PassInstrumentation interface to hook into the pass execution lifecycle. More... | |
| struct | PiccelerFiltersToConvPass |
| A pass that converts high-level image filter operations (like sharpen, blur, edge detect) into convolution operations with constant kernels. More... | |
| struct | PiccelerKernelToMemrefPass |
| A pass that converts KernelConstOp operations, which represent constant convolution kernels, into MemRef operations that allocate memory for the kernel and store the constant values into it. More... | |
| struct | PiccelerOpsToFuncCallsPass |
| A pass that converts image operations (like load, show, save) into function calls. More... | |
| struct | PiccelerToAffinePass |
| A pass that converts Picceler operations to the Affine dialect. This is the crucial step where we lower from our high-level image processing operations to a more explicit representation that can be further lowered to LLVM IR. Each Picceler operation is matched and rewritten into one or more Affine loops that perform the equivalent computation. This pass also handles type conversions and ensures that necessary runtime functions (like piccelerCreateImage) are declared. More... | |
| struct | PiccelerToLLVMIRPass |
| A pass that helps convert last pieces of Picceler IR to LLVM IR. More... | |
| struct | ReadNumberToCall |
| struct | ReadStringToCall |
| struct | RotateToAffine |
| struct | SaveImageToCall |
| Pattern to lower SaveImageOp to a function call. More... | |
| struct | ShowImageToCall |
| Pattern to lower ShowImageOp to a function call. More... | |
| struct | StringConstConverter |
| struct | StringNode |
| AST node for string literals. More... | |
| struct | Token |
| Represents a token produced by the lexer. More... | |
| struct | VariableNode |
| AST node for variable references. More... | |
Typedefs | |
| template<typename T> | |
| using | Result = std::expected<T, CompileError> |
| A type alias for the result of a compilation operation. | |
Functions | |
| std::ostream & | operator<< (std::ostream &os, const Token &token) |
| Outputs a token to the given output stream. | |
| mlir::Value | createFloatConstant (mlir::OpBuilder &builder, mlir::Location loc, double value) |
| Common utility function to create a constant float value in MLIR. | |
| mlir::Value | createIntConstant (mlir::OpBuilder &builder, mlir::Location loc, int64_t value) |
| Common utility function to create a constant int value in MLIR. | |
| mlir::Value | coerceValueToInt64 (mlir::OpBuilder &builder, mlir::Location loc, mlir::Value value, llvm::StringRef opName, llvm::StringRef argName) |
| Coerces a given MLIR value to a 64-bit integer if possible, with special handling for constants. | |
| Result< std::pair< mlir::Value, mlir::Value > > | getKernelNeighborhoodSize (mlir::OpBuilder &builder, mlir::Location loc, mlir::Value kernelOperand) |
| mlir::FailureOr< KernelData > | calculateSharpenKernel (SharpenOp op, SharpenOpAdaptor adaptor) |
| mlir::FailureOr< KernelData > | calculateBoxBlurKernel (BoxBlurOp op, BoxBlurOpAdaptor adaptor) |
| mlir::FailureOr< KernelData > | calculateGaussianKernel (GaussianBlurOp op, GaussianBlurOpAdaptor adaptor) |
| mlir::FailureOr< KernelData > | calculateEdgeDetectKernel (EdgeDetectOp op, EdgeDetectOpAdaptor adaptor) |
| mlir::FailureOr< KernelData > | calculateEmbossKernel (EmbossOp op, EmbossOpAdaptor adaptor) |
| mlir::func::FuncOp | ensureRuntimeFunc (mlir::ModuleOp module, mlir::StringRef name, llvm::ArrayRef< mlir::Type > inputs, llvm::ArrayRef< mlir::Type > results, mlir::PatternRewriter &rewriter, mlir::Location loc) |
| Ensures that a runtime function is declared in the module. If the function does not exist, it is created. | |
The following functions create instances of the various passes used in the compilation process. | |
Each function corresponds to a specific pass that transforms the IR in a particular way. | |
| std::unique_ptr< mlir::Pass > | createPiccelerKernelToMemrefPass () |
| std::unique_ptr< mlir::Pass > | createPiccelerOpsToFuncCallsPass () |
| std::unique_ptr< mlir::Pass > | createPiccelerToAffinePass () |
| std::unique_ptr< mlir::Pass > | createPiccelerToLLVMIRPass () |
| std::unique_ptr< mlir::Pass > | createPiccelerFiltersToConvPass () |
| using picceler::Result = std::expected<T, CompileError> |
A type alias for the result of a compilation operation.
| T | The type of the successful result. |
| mlir::FailureOr< KernelData > picceler::calculateBoxBlurKernel | ( | BoxBlurOp | op, |
| BoxBlurOpAdaptor | adaptor ) |
| mlir::FailureOr< KernelData > picceler::calculateEdgeDetectKernel | ( | EdgeDetectOp | op, |
| EdgeDetectOpAdaptor | adaptor ) |
| mlir::FailureOr< KernelData > picceler::calculateEmbossKernel | ( | EmbossOp | op, |
| EmbossOpAdaptor | adaptor ) |
| mlir::FailureOr< KernelData > picceler::calculateGaussianKernel | ( | GaussianBlurOp | op, |
| GaussianBlurOpAdaptor | adaptor ) |
| mlir::FailureOr< KernelData > picceler::calculateSharpenKernel | ( | SharpenOp | op, |
| SharpenOpAdaptor | adaptor ) |
| mlir::Value picceler::coerceValueToInt64 | ( | mlir::OpBuilder & | builder, |
| mlir::Location | loc, | ||
| mlir::Value | value, | ||
| llvm::StringRef | opName, | ||
| llvm::StringRef | argName ) |
Coerces a given MLIR value to a 64-bit integer if possible, with special handling for constants.
| builder | The MLIR OpBuilder to use for creating new operations if coercion is needed. |
| loc | The location to use for any new operations created during coercion. |
| value | The MLIR value to coerce. |
| opName | The name of the operation for error reporting purposes. |
| argName | The name of the argument for error reporting purposes. |
| std::runtime_error | if the value cannot be coerced to a 64-bit integer, or if a floating-point constant is not a whole number or is out of range. |
| mlir::Value picceler::createFloatConstant | ( | mlir::OpBuilder & | builder, |
| mlir::Location | loc, | ||
| double | value ) |
Common utility function to create a constant float value in MLIR.
| builder | The MLIR OpBuilder to use for creating the operation. |
| loc | The MLIR Location to associate with the operation. |
| value | The double value to create as a constant. |
| mlir::Value picceler::createIntConstant | ( | mlir::OpBuilder & | builder, |
| mlir::Location | loc, | ||
| int64_t | value ) |
Common utility function to create a constant int value in MLIR.
| builder | The MLIR OpBuilder to use for creating the operation. |
| loc | The MLIR Location to associate with the operation. |
| value | The int64_t value to create as a constant. |
| std::unique_ptr< mlir::Pass > picceler::createPiccelerFiltersToConvPass | ( | ) |
| std::unique_ptr< mlir::Pass > picceler::createPiccelerKernelToMemrefPass | ( | ) |
| std::unique_ptr< mlir::Pass > picceler::createPiccelerOpsToFuncCallsPass | ( | ) |
| std::unique_ptr< mlir::Pass > picceler::createPiccelerToAffinePass | ( | ) |
| std::unique_ptr< mlir::Pass > picceler::createPiccelerToLLVMIRPass | ( | ) |
| mlir::func::FuncOp picceler::ensureRuntimeFunc | ( | mlir::ModuleOp | module, |
| mlir::StringRef | name, | ||
| llvm::ArrayRef< mlir::Type > | inputs, | ||
| llvm::ArrayRef< mlir::Type > | results, | ||
| mlir::PatternRewriter & | rewriter, | ||
| mlir::Location | loc ) |
Ensures that a runtime function is declared in the module. If the function does not exist, it is created.
| module | The MLIR module to check. |
| name | The name of the function. |
| inputs | The input types of the function. |
| results | The result types of the function. |
| rewriter | The pattern rewriter to use for creating the function. |
| loc | The location to use for the function. |
| Result< std::pair< mlir::Value, mlir::Value > > picceler::getKernelNeighborhoodSize | ( | mlir::OpBuilder & | builder, |
| mlir::Location | loc, | ||
| mlir::Value | kernelOperand ) |
| std::ostream & picceler::operator<< | ( | std::ostream & | os, |
| const Token & | token ) |
Outputs a token to the given output stream.
| os | The output stream. |
| token | The token to output. |