9 #ifndef MLIR_BINDINGS_PYTHON_GLOBALS_H 10 #define MLIR_BINDINGS_PYTHON_GLOBALS_H 17 #include "llvm/ADT/Optional.h" 18 #include "llvm/ADT/StringRef.h" 19 #include "llvm/ADT/StringSet.h" 32 assert(instance &&
"PyGlobals is null");
39 return dialectSearchPrefixes;
42 dialectSearchPrefixes.swap(newValues);
65 pybind11::object pyClass);
71 pybind11::object pyClass,
72 pybind11::object rawOpViewClass);
87 std::vector<std::string> dialectSearchPrefixes;
89 llvm::StringMap<pybind11::object> dialectClassMap;
91 llvm::StringMap<pybind11::object> operationClassMap;
94 llvm::StringMap<pybind11::object> rawOpViewClassMap;
104 llvm::StringMap<pybind11::object> rawOpViewClassMapCache;
110 #endif // MLIR_BINDINGS_PYTHON_GLOBALS_H Include the generated interface declarations.
Globals that are always accessible once the extension has been initialized.
void setDialectSearchPrefixes(std::vector< std::string > newValues)
void loadDialectModule(llvm::StringRef dialectNamespace)
Loads a python module corresponding to the given dialect namespace.
void clearImportCache()
Clears positive and negative caches regarding what implementations are available. ...
void registerOperationImpl(const std::string &operationName, pybind11::object pyClass, pybind11::object rawOpViewClass)
Adds a concrete implementation operation class.
std::vector< std::string > & getDialectSearchPrefixes()
Get and set the list of parent modules to search for dialect implementation classes.
llvm::Optional< pybind11::object > lookupDialectClass(const std::string &dialectNamespace)
Looks up a registered dialect class by namespace.
pybind11::object registerDialectDecorator(pybind11::object pyClass)
Decorator for registering a custom Dialect class.
llvm::Optional< pybind11::object > lookupRawOpViewClass(llvm::StringRef operationName)
Looks up a registered raw OpView class by operation name.
void registerDialectImpl(const std::string &dialectNamespace, pybind11::object pyClass)
Adds a concrete implementation dialect class.