picceler
Loading...
Searching...
No Matches
image_access_helper.h
Go to the documentation of this file.
1#pragma once
2
3#include "mlir/IR/Builders.h"
4#include "mlir/IR/Location.h"
5#include "mlir/IR/Value.h"
6
7namespace picceler {
8
20public:
21 ImageAccessHelper(mlir::Value ptr, mlir::OpBuilder &b, mlir::Location l);
22
30 static mlir::Type getImageStructType(mlir::MLIRContext *ctx);
31
38 mlir::Value getFieldAddr(int32_t index);
39
44 mlir::Value getWidth();
45
50 mlir::Value getHeight();
51
56 mlir::Value getDataPtr();
57
58private:
59 mlir::Value _structPtr; // !llvm.ptr (Opaque pointer to the Image struct)
60 mlir::OpBuilder &_builder;
61 mlir::Location _loc;
62};
63
64} // namespace picceler
mlir::Value getWidth()
Gets the value of the width field.
Definition image_access_helper.cpp:31
ImageAccessHelper(mlir::Value ptr, mlir::OpBuilder &b, mlir::Location l)
Definition image_access_helper.cpp:5
static mlir::Type getImageStructType(mlir::MLIRContext *ctx)
Defines the logical layout of the C++ struct for GEP offset calculations. struct Image { i32,...
Definition image_access_helper.cpp:8
mlir::Value getDataPtr()
Gets the value of the data pointer field.
Definition image_access_helper.cpp:41
mlir::Value getHeight()
Gets the value of the height field.
Definition image_access_helper.cpp:36
mlir::Value getFieldAddr(int32_t index)
Internal helper to create the GEP (Address calculation) for a field index. The expected value of inde...
Definition image_access_helper.cpp:14
Definition ast.h:11