14 #include <pybind11/detail/common.h>
15 #include <pybind11/pybind11.h>
27 m.doc() =
"MLIR GPU Dialect";
32 auto mlirGPUAsyncTokenType =
35 mlirGPUAsyncTokenType.def_classmethod(
37 [](py::object cls, MlirContext ctx) {
40 "Gets an instance of AsyncTokenType in the same context", py::arg(
"cls"),
41 py::arg(
"ctx") = py::none());
50 [](py::object cls, MlirAttribute target, uint32_t format,
51 py::bytes
object, std::optional<MlirAttribute> mlirObjectProps,
52 std::optional<MlirAttribute> mlirKernelsAttr) {
53 py::buffer_info info(py::buffer(
object).request());
58 mlirObjectProps.has_value() ? *mlirObjectProps
59 : MlirAttribute{nullptr},
60 mlirKernelsAttr.has_value() ? *mlirKernelsAttr
61 : MlirAttribute{nullptr}));
63 "cls"_a,
"target"_a,
"format"_a,
"object"_a,
64 "properties"_a = py::none(),
"kernels"_a = py::none(),
65 "Gets a gpu.object from parameters.")
66 .def_property_readonly(
69 .def_property_readonly(
72 .def_property_readonly(
74 [](MlirAttribute
self) {
76 return py::bytes(stringRef.
data, stringRef.
length);
78 .def_property_readonly(
"properties",
79 [](MlirAttribute
self) {
83 return py::none().cast<py::object>();
85 .def_property_readonly(
"kernels", [](MlirAttribute
self) {
88 return py::none().cast<py::object>();
PYBIND11_MODULE(_mlirDialectsGPU, m)
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 MlirAttribute mlirGPUObjectAttrGetKernels(MlirAttribute mlirObjectAttr)
MLIR_CAPI_EXPORTED MlirAttribute mlirGPUObjectAttrGetWithKernels(MlirContext mlirCtx, MlirAttribute target, uint32_t format, MlirStringRef objectStrRef, MlirAttribute mlirObjectProps, MlirAttribute mlirKernelsAttr)
MLIR_CAPI_EXPORTED bool mlirGPUObjectAttrHasKernels(MlirAttribute mlirObjectAttr)
MLIR_CAPI_EXPORTED MlirType mlirGPUAsyncTokenTypeGet(MlirContext ctx)
MLIR_CAPI_EXPORTED bool mlirTypeIsAGPUAsyncTokenType(MlirType type)
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 ...
Creates a custom subclass of mlir.ir.Type, implementing a casting constructor and type checking metho...
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.