MCPcopy Create free account
hub / github.com/MegEngine/MegCC / GlobalCtx

Method GlobalCtx

compiler/lib/CodeGen/GlobalCtx.cpp:26–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24class GlobalCtx {
25public:
26 GlobalCtx() {
27 reg_ptr = std::make_unique<mlir::DialectRegistry>();
28 reg_ptr->insert<
29 StandardOpsDialect, tensor::TensorDialect, tosa::TosaDialect,
30 linalg::LinalgDialect, bufferization::BufferizationDialect>();
31
32 ctx_ptr = std::make_unique<mlir::MLIRContext>(*reg_ptr);
33 ctx_ptr->loadDialect<
34 StandardOpsDialect, tosa::TosaDialect, linalg::LinalgDialect,
35 bufferization::BufferizationDialect>();
36
37 registerLLVMDialectTranslation(*ctx_ptr);
38 }
39 mlir::MLIRContext* get_ctx() { return ctx_ptr.get(); }
40
41private:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected