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

Function vm_attach

runtime/src/vm.c:23–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21}
22
23TinyNNStatus vm_attach(CombineModel* model) {
24 void* vm = tinynn_malloc(sizeof(VM));
25 vm_reset((VM*)vm);
26 model->vm = vm;
27 VM* vm_r = (VM*)vm;
28 vm_r->model = model;
29 return TinyNN_SUCCESS;
30}
31TinyNNStatus vm_detach(CombineModel* model) {
32 FREE(model->vm);
33 return TinyNN_SUCCESS;

Callers 3

SimpleVMMethod · 0.85
TESTFunction · 0.85
LITE_make_networkFunction · 0.85

Calls 2

tinynn_mallocFunction · 0.85
vm_resetFunction · 0.85

Tested by 2

SimpleVMMethod · 0.68
TESTFunction · 0.68