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

Method SimpleVM

runtime/test/common/common.cpp:172–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170
171public:
172 SimpleVM() {
173 cb_model = new CombineModel;
174 cb_model->nr_device_model = 1;
175 cb_model->device_models = new DeviceModel*;
176 cb_model->device_models[0] = new DeviceModel;
177 cb_model->active_device_model_idx = 0;
178 cb_model->host_dev.device_type = TinyNN_BARE_METAL;
179 init_device(&(cb_model->host_dev));
180 DeviceModel* model = cb_model->device_models[0];
181 model->device.device_type = TinyNN_BARE_METAL;
182 init_device(&model->device);
183 model->opt = create_runtime_opt(&model->device);
184 vm_attach(cb_model);
185 }
186 VM* getvm() { return (VM*)(cb_model->vm); }
187 ~SimpleVM() {
188 auto vm = getvm();

Callers

nothing calls this directly

Calls 3

init_deviceFunction · 0.85
create_runtime_optFunction · 0.85
vm_attachFunction · 0.85

Tested by

no test coverage detected