MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / registerModule

Function registerModule

test/api/APIUnitTest.cpp:406–417  ·  view source on GitHub ↗

Helper function to register AST module.

Source from the content-addressed store, hash-verified

404
405// Helper function to register AST module.
406WasmEdge_ModuleInstanceContext *
407registerModule(const WasmEdge_ConfigureContext *Conf,
408 WasmEdge_StoreContext *Store,
409 const WasmEdge_ASTModuleContext *Mod, std::string_view Name) {
410 WasmEdge_ExecutorContext *ExecCxt = WasmEdge_ExecutorCreate(Conf, nullptr);
411 WasmEdge_String ModName =
412 WasmEdge_StringWrap(Name.data(), static_cast<uint32_t>(Name.length()));
413 WasmEdge_ModuleInstanceContext *ResMod = nullptr;
414 WasmEdge_ExecutorRegister(ExecCxt, &ResMod, Store, Mod, ModName);
415 WasmEdge_ExecutorDelete(ExecCxt);
416 return ResMod;
417}
418
419// Helper function to register existing host module.
420bool registerModule(const WasmEdge_ConfigureContext *Conf,

Callers 15

TESTFunction · 0.85
MultiHeadAttentionMethod · 0.85
registerLayerMethod · 0.85
AttentionMethod · 0.85
MLPMethod · 0.85
TransformerBlockMethod · 0.85
TransformerMethod · 0.85
AttentionMethod · 0.85
MLPMethod · 0.85
TransformerBlockMethod · 0.85
TransformerMethod · 0.85
MultiHeadAttentionMethod · 0.85

Calls 4

WasmEdge_ExecutorCreateFunction · 0.85
WasmEdge_ExecutorDeleteFunction · 0.85
WasmEdge_ResultOKFunction · 0.85
dataMethod · 0.45

Tested by

no test coverage detected