14 #include <pybind11/detail/common.h>
15 #include <pybind11/pybind11.h>
27 m.doc() =
"MLIR GPU Dialect";
36 [](py::object cls, MlirAttribute target, uint32_t format,
37 py::bytes
object, std::optional<MlirAttribute> mlirObjectProps) {
38 py::buffer_info info(py::buffer(
object).request());
43 mlirObjectProps.has_value() ? *mlirObjectProps
44 : MlirAttribute{nullptr}));
46 "cls"_a,
"target"_a,
"format"_a,
"object"_a,
47 "properties"_a = py::none(),
"Gets a gpu.object from parameters.")
48 .def_property_readonly(
51 .def_property_readonly(
54 .def_property_readonly(
56 [](MlirAttribute
self) {
58 return py::bytes(stringRef.
data, stringRef.
length);
60 .def_property_readonly(
"properties", [](MlirAttribute
self) {
63 return py::none().cast<py::object>();
PYBIND11_MODULE(_mlirDialectsGPU, m)
MLIR_CAPI_EXPORTED MlirAttribute mlirGPUObjectAttrGet(MlirContext mlirCtx, MlirAttribute target, uint32_t format, MlirStringRef objectStrRef, MlirAttribute mlirObjectProps)
MLIR_CAPI_EXPORTED bool mlirAttributeIsAGPUObjectAttr(MlirAttribute attr)
MLIR_CAPI_EXPORTED MlirAttribute mlirGPUObjectAttrGetTarget(MlirAttribute mlirObjectAttr)
MLIR_CAPI_EXPORTED MlirAttribute mlirGPUObjectAttrGetProperties(MlirAttribute mlirObjectAttr)
MLIR_CAPI_EXPORTED bool mlirGPUObjectAttrHasProperties(MlirAttribute mlirObjectAttr)
MLIR_CAPI_EXPORTED uint32_t mlirGPUObjectAttrGetFormat(MlirAttribute mlirObjectAttr)
MLIR_CAPI_EXPORTED MlirStringRef mlirGPUObjectAttrGetObject(MlirAttribute mlirObjectAttr)
Creates a custom subclass of mlir.ir.Attribute, implementing a casting constructor and type checking ...
pure_subclass & def_classmethod(const char *name, Func &&f, const Extra &...extra)
MLIR_CAPI_EXPORTED MlirContext mlirAttributeGetContext(MlirAttribute attribute)
Gets the context that an attribute was created with.
static MlirStringRef mlirStringRefCreate(const char *str, size_t length)
Constructs a string reference from the pointer and length.
Include the generated interface declarations.
A pointer to a sized fragment of a string, not necessarily null-terminated.
const char * data
Pointer to the first symbol.
size_t length
Length of the fragment.