* Setup a virtual machine module with given device. * * @param dev DLDevice the device. * @returns The created virtual machime.
(dev: DLDevice)
| 1176 | * @returns The created virtual machime. |
| 1177 | */ |
| 1178 | createVirtualMachine(dev: DLDevice): VirtualMachine { |
| 1179 | const mod = this.ctx.detachFromCurrentScope( |
| 1180 | this.systemLib().getFunction("vm_load_executable")() |
| 1181 | ); |
| 1182 | return this.ctx.attachToCurrentScope( |
| 1183 | new VirtualMachine(mod, dev) |
| 1184 | ); |
| 1185 | } |
| 1186 | |
| 1187 | //----------------------------------------------- |
| 1188 | // Native Tensor Cache Support |
no test coverage detected