nndeploy.device.device

Classes

Architecture(*args, **kwargs)

Device(*args, **kwargs)

DeviceInfo()

Event(device_or_type)

Stream(device_or_type[, stream])

class nndeploy.device.device.DeviceInfo[源代码]

基类:DeviceInfo

__init__(self: nndeploy._nndeploy_internal.device.DeviceInfo) None[源代码]
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.

check_device(device_id: int = 0, library_path: str = '')[源代码]
enable_device(device_id: int = 0, library_path: str = '')[源代码]
disable_device()[源代码]
get_device(device_id: int)[源代码]
get_device_info(library_path: str = '')[源代码]
get_device_type_code()[源代码]
insert_device(device_id: int, device: Device)[源代码]
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.

get_data_format_by_shape(shape)[源代码]
to_buffer_desc(desc, config)[源代码]
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()

deallocate(ptr)[源代码]
allocate_pinned(size_or_desc)[源代码]

Allocate pinned memory that must be freed using deallocate_pinned() :param size_or_desc: int for allocation size, or BufferDesc for buffer descriptor

返回:

Memory pointer that must be freed using deallocate_pinned()

deallocate_pinned(ptr)[源代码]
copy(src, dst, size, stream=None)[源代码]
download(src, dst, size, stream=None)[源代码]
upload(src, dst, size, stream=None)[源代码]
copy_buffer(src, dst, stream=None)[源代码]
download_buffer(src, dst, stream=None)[源代码]
upload_buffer(src, dst, stream=None)[源代码]
get_context()[源代码]
create_stream(stream=None)[源代码]
create_event()[源代码]
create_events(events)[源代码]
get_device_type()[源代码]
init()[源代码]
deinit()[源代码]
class nndeploy.device.device.Stream(device_or_type, stream=None)[源代码]

基类:object

__init__(device_or_type, stream=None)[源代码]
get_device_type()[源代码]
get_device()[源代码]
synchronize()[源代码]
record_event(event)[源代码]
wait_event(event)[源代码]
on_execution_context_setup()[源代码]
on_execution_context_teardown()[源代码]
get_native_stream()[源代码]
class nndeploy.device.device.Event(device_or_type)[源代码]

基类:object

__init__(device_or_type)[源代码]
get_device_type()[源代码]
get_device()[源代码]
query_done()[源代码]
synchronize()[源代码]
get_native_event()[源代码]