picceler
Loading...
Searching...
No Matches
picceler::ImageAccessHelper Struct Reference

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>

Public Member Functions

 ImageAccessHelper (mlir::Value ptr, mlir::OpBuilder &b, mlir::Location l)
mlir::Value getFieldAddr (int32_t index)
mlir::Value getWidth ()
mlir::Value getHeight ()
mlir::Value getDataPtr ()

Static Public Member Functions

static mlir::Type getImageStructType (mlir::MLIRContext *ctx)

Public Attributes

mlir::Value structPtr
mlir::OpBuilder & builder
mlir::Location loc

Detailed Description

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 };.

Constructor & Destructor Documentation

◆ ImageAccessHelper()

picceler::ImageAccessHelper::ImageAccessHelper ( mlir::Value ptr,
mlir::OpBuilder & b,
mlir::Location l )

Member Function Documentation

◆ getDataPtr()

mlir::Value picceler::ImageAccessHelper::getDataPtr ( )

◆ getFieldAddr()

mlir::Value picceler::ImageAccessHelper::getFieldAddr ( int32_t index)

Internal helper to create the GEP (Address calculation) for a field index.

◆ getHeight()

mlir::Value picceler::ImageAccessHelper::getHeight ( )

◆ 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 }

◆ getWidth()

mlir::Value picceler::ImageAccessHelper::getWidth ( )

Member Data Documentation

◆ 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: