* Constructor * @param mod The underlying module, need to be detached. * @param device The main device ro run VM on.
(mod: Module, device: DLDevice)
| 786 | * @param device The main device ro run VM on. |
| 787 | */ |
| 788 | constructor(mod: Module, device: DLDevice) { |
| 789 | this.mod = mod; |
| 790 | this.mod.getFunction("vm_initialization")( |
| 791 | new Scalar(device.deviceType, "int"), |
| 792 | new Scalar(device.deviceId, "int"), |
| 793 | new Scalar(VMAllocatorKind.POOLED_ALLOCATOR, "int"), |
| 794 | // explicitly specify host device type |
| 795 | new Scalar(DeviceStrToEnum.cpu, "int"), |
| 796 | new Scalar(0, "int"), |
| 797 | new Scalar(VMAllocatorKind.POOLED_ALLOCATOR, "int"), |
| 798 | ); |
| 799 | } |
| 800 | |
| 801 | dispose(): void { |
| 802 | this.mod.dispose(); |
nothing calls this directly
no test coverage detected