16 using namespace nanobind::literals;
27 m.doc() =
"MLIR GPU Dialect";
32 auto mlirGPUAsyncTokenType =
35 mlirGPUAsyncTokenType.def_classmethod(
37 [](nb::object cls, MlirContext ctx) {
40 "Gets an instance of AsyncTokenType in the same context", nb::arg(
"cls"),
41 nb::arg(
"ctx").none() = nb::none());
50 [](nb::object cls, MlirAttribute target, uint32_t format,
51 nb::bytes
object, std::optional<MlirAttribute> mlirObjectProps,
52 std::optional<MlirAttribute> mlirKernelsAttr) {
54 static_cast<char *
>(
const_cast<void *
>(
object.data())),
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.none() = nb::none(),
"kernels"_a.none() = nb::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 nb::bytes(stringRef.
data, stringRef.
length);
78 .def_property_readonly(
"properties",
79 [](MlirAttribute
self) -> nb::object {
85 .def_property_readonly(
"kernels", [](MlirAttribute
self) -> nb::object {
NB_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.