18using namespace nanobind::literals;
42 "Gets an instance of AsyncTokenType in the same context",
43 nb::arg(
"context").none() = nb::none());
61 std::optional<PyDictAttribute> mlirObjectProps,
62 std::optional<PyAttribute> mlirKernelsAttr,
65 static_cast<char *
>(
const_cast<void *
>(
object.data())),
71 mlirObjectProps.has_value() ? *mlirObjectProps
72 : MlirAttribute{nullptr},
73 mlirKernelsAttr.has_value() ? *mlirKernelsAttr
74 : MlirAttribute{nullptr}));
76 "target"_a,
"format"_a,
"object"_a,
"properties"_a = nb::none(),
77 "kernels"_a = nb::none(),
"context"_a = nb::none(),
78 "Gets a gpu.object from parameters.");
84 c.def_prop_ro(
"format", [](
const ObjectAttr &self) {
87 c.def_prop_ro(
"object", [](
const ObjectAttr &self) {
89 return nb::bytes(stringRef.
data, stringRef.
length);
92 "properties", [](
ObjectAttr &self) -> std::optional<PyDictAttribute> {
98 c.def_prop_ro(
"kernels",
100 -> std::optional<nb::typed<nb::object, PyAttribute>> {
119 m.doc() =
"MLIR GPU Dialect";
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 MlirStringRef mlirGPUObjectAttrGetName(void)
MLIR_CAPI_EXPORTED MlirStringRef mlirGPUAsyncTokenTypeGetName(void)
MLIR_CAPI_EXPORTED bool mlirTypeIsAGPUAsyncTokenType(MlirType type)
MLIR_CAPI_EXPORTED uint32_t mlirGPUObjectAttrGetFormat(MlirAttribute mlirObjectAttr)
MLIR_CAPI_EXPORTED MlirStringRef mlirGPUObjectAttrGetObject(MlirAttribute mlirObjectAttr)
MlirContext mlirAttributeGetContext(MlirAttribute attribute)
ReferrentTy * get() const
PyMlirContextRef & getContext()
Accesses the context reference.
Used in function arguments when None should resolve to the current context manager set instance.
PyAttribute(PyMlirContextRef contextRef, MlirAttribute attr)
static void bind(nanobind::module_ &m, PyType_Slot *slots=nullptr)
nanobind::class_< ObjectAttr, PyAttribute > ClassTy
PyConcreteAttribute()=default
bool(*)(MlirAttribute) IsAFunctionTy
nanobind::class_< AsyncTokenType, PyType > ClassTy
static void bind(nanobind::module_ &m)
bool(*)(MlirType) IsAFunctionTy
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.
static const MlirStringRef name
static void bindDerived(ClassTy &c)
static constexpr IsAFunctionTy isaFunction
static constexpr const char * pyClassName
static constexpr const char * pyClassName
static const MlirStringRef name
static void bindDerived(ClassTy &c)
static constexpr IsAFunctionTy isaFunction