nndeploy.device.device¶
Classes
|
|
|
|
|
|
|
- class nndeploy.device.device.DeviceInfo[源代码]¶
基类:
DeviceInfo- property device_type¶
- property is_support_fp16¶
- property device_type_¶
- property is_support_fp16_¶
- class nndeploy.device.device.Architecture(*args, **kwargs)[源代码]¶
基类:
object- __init__(*args, **kwargs)[源代码]¶
Constructs an Architecture object.
The constructor can be called in the following ways: 1. str: Constructs an Architecture from a string. eg: “cpu”, “ascendcl”, etc. 2. DeviceTypeCode: Constructs an Architecture from a DeviceTypeCode enum value. 3. _C.base.DeviceTypeCode: Constructs an Architecture from a DeviceTypeCode enum value.
- class nndeploy.device.device.Device(*args, **kwargs)[源代码]¶
基类:
object- __init__(*args, **kwargs)[源代码]¶
Constructs a Device object.
The constructor can be called in the following ways: 1. Device(device_name_and_id): Constructs a Device from a string in the format “device_name:device_id” (e.g., “cuda:0”). 2. Device(device_name, device_id): Constructs a Device from a string device name and an integer device ID. 3. Device(device_type_code): Constructs a Device from a DeviceTypeCode enum value. The device ID defaults to 0. 4. Device(device_type_code, device_id): Constructs a Device from a DeviceTypeCode enum value and an integer device ID. 5. Device(): Constructs a default Device with DeviceTypeCode.cpu and device ID 0.
- allocate(size_or_desc)[源代码]¶
Allocate memory that must be freed using deallocate() :param size_or_desc: int for allocation size, or BufferDesc for buffer descriptor
- 返回:
Memory pointer that must be freed using deallocate()