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...
#include <image_access_helper.h>
|
| | ImageAccessHelper (mlir::Value ptr, mlir::OpBuilder &b, mlir::Location l) |
| mlir::Value | getFieldAddr (int32_t index) |
| | Internal helper to create the GEP (Address calculation) for a field index. The expected value of index is 0 for width, 1 for height, and 2 for data pointer.
|
| mlir::Value | getWidth () |
| | Gets the value of the width field.
|
| mlir::Value | getHeight () |
| | Gets the value of the height field.
|
| mlir::Value | getDataPtr () |
| | Gets the value of the data pointer field.
|
|
| static mlir::Type | getImageStructType (mlir::MLIRContext *ctx) |
| | Defines the logical layout of the C++ struct for GEP offset calculations. struct Image { i32, i32, ptr }.
|
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 };.
◆ ImageAccessHelper()
| picceler::ImageAccessHelper::ImageAccessHelper |
( |
mlir::Value | ptr, |
|
|
mlir::OpBuilder & | b, |
|
|
mlir::Location | l ) |
◆ getDataPtr()
| mlir::Value picceler::ImageAccessHelper::getDataPtr |
( |
| ) |
|
Gets the value of the data pointer field.
- Returns
- MLIR value representing the data pointer.
◆ getFieldAddr()
| mlir::Value picceler::ImageAccessHelper::getFieldAddr |
( |
int32_t | index | ) |
|
Internal helper to create the GEP (Address calculation) for a field index. The expected value of index is 0 for width, 1 for height, and 2 for data pointer.
- Parameters
-
| index | The index of the field for which to calculate the address. |
- Returns
- MLIR value representing the address of the field.
◆ getHeight()
| mlir::Value picceler::ImageAccessHelper::getHeight |
( |
| ) |
|
Gets the value of the height field.
- Returns
- MLIR value representing the height.
◆ getImageStructType()
| mlir::Type picceler::ImageAccessHelper::getImageStructType |
( |
mlir::MLIRContext * | ctx | ) |
|
|
static |
Defines the logical layout of the C++ struct for GEP offset calculations. struct Image { i32, i32, ptr }.
- Parameters
-
| ctx | MLIR context for type creation. |
- Returns
- MLIR type representing the struct layout for GEP indexing.
◆ getWidth()
| mlir::Value picceler::ImageAccessHelper::getWidth |
( |
| ) |
|
Gets the value of the width field.
- Returns
- MLIR value representing the width.
◆ builder
| mlir::OpBuilder& picceler::ImageAccessHelper::builder |
◆ loc
| mlir::Location picceler::ImageAccessHelper::loc |
◆ structPtr
| mlir::Value picceler::ImageAccessHelper::structPtr |
The documentation for this struct was generated from the following files: