Open Deep Learning API
Loading...
Searching...
No Matches
Typedefs | Enumerations | Functions
odla_device.h File Reference

Go to the source code of this file.

Typedefs

typedef struct _odla_vendor * odla_vendor
 Vendor object. More...
 
typedef struct _odla_device * odla_device
 Device object. More...
 
typedef struct _odla_device_config * odla_device_config
 Device configuration object. More...
 
typedef struct _odla_device_config_item * odla_device_config_item
 Device configuration item object. More...
 

Enumerations

enum  odla_vendor_name {
  ODLA_VENDOR_DEFAULT , ODLA_VENDOR_ALIBABA , ODLA_VENDOR_ARM , ODLA_VENDOR_CAMBRICON ,
  ODLA_VENDOR_GRAPHCORE , ODLA_VENDOR_HABANA , ODLA_VENDOR_INTEL , ODLA_VENDOR_NVIDIA ,
  ODLA_VENDOR_QUALCOMM
}
 Supported vendors. More...
 
enum  odla_vendor_info { OVI_DESCRIPTION , OVI_FEATURE_SET }
 Vendor info. More...
 
enum  odla_device_name {
  ODLA_DEVICE_DEFAULT , ODLA_DEVICE_ALIBABA_HANGUANG , ODLA_DEVICE_ARM_CORTEX_M , ODLA_DEVICE_CAMBRICON_MLU220 ,
  ODLA_DEVICE_CAMBRICON_MLU270 , ODLA_DEVICE_GRAPHCORE_IPU , ODLA_DEVICE_HABANA_GAUDI , ODLA_DEVICE_HABANA_GOYA ,
  ODLA_DEVICE_INTEL_X86 , ODLA_DEVICE_INTEL_DNNL , ODLA_DEVICE_NVIDIA_GPU , ODLA_DEVICE_NVIDIA_TENSORRT ,
  ODLA_DEVICE_QUALCOMM_AIC100
}
 Supported devices. More...
 
enum  odla_device_info {
  ODLA_DEVICE_INFO_ODLA_LIB_VERSION , ODLA_DEVICE_INFO_DEV_COUNT , ODLA_DEVICE_INFO_DEV_INDEX , ODLA_DEVICE_INFO_DEV_TYPE ,
  ODLA_DEVICE_INFO_DEV_UUID , ODLA_DEVICE_INFO_PROCESSOR_UTIL , ODLA_DEVICE_INFO_MEMORY_UTIL , ODLA_DEVICE_INFO_TOTAL_MEMORY ,
  ODLA_DEVICE_INFO_USED_MEMORY , ODLA_DEVICE_INFO_POWER_USAGE , ODLA_DEVICE_INFO_POWER_LIMIT , ODLA_DEVICE_INFO_DRIVER_VERSION ,
  ODLA_DEVICE_INFO_SDK_VERSION
}
 Device info enum. More...
 

Functions

ODLA_API_EXPORT odla_status ODLA_API_CALL odla_GetVendor (const odla_vendor_name vendor_name, odla_vendor *vendor)
 Get the vendor object. More...
 
ODLA_API_EXPORT odla_status ODLA_API_CALL odla_GetVendorInfo (const odla_vendor vendor, const odla_vendor_info info_name, const odla_size_t allocated_info_value_size, odla_void *info_value, odla_size_t *retrieved_info_value_size)
 Get the vendor info. More...
 
ODLA_API_EXPORT odla_status ODLA_API_CALL odla_AllocateDevice (odla_vendor vendor, odla_device_name device_name, odla_int32 device_idx, odla_device *device)
 Allocate a device. More...
 
ODLA_API_EXPORT odla_status ODLA_API_CALL odla_GetDeviceInfo (odla_device device, odla_device_info info_type, odla_scalar_value *info_value)
 Get the device info. More...
 
ODLA_API_EXPORT odla_status ODLA_API_CALL odla_InitDevice (odla_device device, const odla_device_config config)
 Initialize an allocated device. More...
 
ODLA_API_EXPORT odla_status ODLA_API_CALL odla_SetCurrentDevice (odla_device device)
 Set an allocated device as the current device. More...
 
ODLA_API_EXPORT odla_status ODLA_API_CALL odla_DestroyDevice (odla_device device)
 Destroy an allocated device. More...
 
ODLA_API_EXPORT odla_status ODLA_API_CALL odla_CreateDeviceConfig (odla_device_config *device_config)
 Create a device config object. More...
 
ODLA_API_EXPORT odla_status ODLA_API_CALL odla_SetDeviceConfigItem (odla_device_config device_config, odla_device_config_item device_config_item,...)
 Set the device config with a property item. More...
 
ODLA_API_EXPORT odla_status ODLA_API_CALL odla_DestroyDeviceConfig (odla_device_config device_config)
 Destroy a device config object. More...
 

Detailed Description

This file defines the ODLA device related APIs.

Definition in file odla_device.h.

Typedef Documentation

◆ odla_device

typedef struct _odla_device* odla_device

Device object.

Definition at line 98 of file odla_device.h.

◆ odla_device_config

typedef struct _odla_device_config* odla_device_config

Device configuration object.

Definition at line 101 of file odla_device.h.

◆ odla_device_config_item

typedef struct _odla_device_config_item* odla_device_config_item

Device configuration item object.

Definition at line 104 of file odla_device.h.

◆ odla_vendor

typedef struct _odla_vendor* odla_vendor

Vendor object.

Definition at line 95 of file odla_device.h.

Enumeration Type Documentation

◆ odla_device_info

Device info enum.

Enumerator
ODLA_DEVICE_INFO_ODLA_LIB_VERSION 

Version of ODLA library (string)

ODLA_DEVICE_INFO_DEV_COUNT 

Number of total devices (int32)

ODLA_DEVICE_INFO_DEV_INDEX 

Device index of current device (int32)

ODLA_DEVICE_INFO_DEV_TYPE 

Name/model of device (string)

ODLA_DEVICE_INFO_DEV_UUID 

Raw UUID of device (16-byte string)

ODLA_DEVICE_INFO_PROCESSOR_UTIL 

Current processor utilization in [0, 1] (float32)

ODLA_DEVICE_INFO_MEMORY_UTIL 

Current memory utilization in [0, 1] (float32)

ODLA_DEVICE_INFO_TOTAL_MEMORY 

Size of device memory (int64)

ODLA_DEVICE_INFO_USED_MEMORY 

Size of used device memory (int64)

ODLA_DEVICE_INFO_POWER_USAGE 

Current power usage in watt (float)

ODLA_DEVICE_INFO_POWER_LIMIT 

Power limit in watt (float)

ODLA_DEVICE_INFO_DRIVER_VERSION 

Version of driver (string)

ODLA_DEVICE_INFO_SDK_VERSION 

Version of SDK (string)

Definition at line 76 of file odla_device.h.

76 {
odla_device_info
Device info enum.
Definition: odla_device.h:76
@ ODLA_DEVICE_INFO_POWER_LIMIT
Power limit in watt (float)
Definition: odla_device.h:89
@ ODLA_DEVICE_INFO_DEV_INDEX
Device index of current device (int32)
Definition: odla_device.h:79
@ ODLA_DEVICE_INFO_DEV_COUNT
Number of total devices (int32)
Definition: odla_device.h:78
@ ODLA_DEVICE_INFO_ODLA_LIB_VERSION
Version of ODLA library (string)
Definition: odla_device.h:77
@ ODLA_DEVICE_INFO_MEMORY_UTIL
Definition: odla_device.h:84
@ ODLA_DEVICE_INFO_DEV_UUID
Raw UUID of device (16-byte string)
Definition: odla_device.h:81
@ ODLA_DEVICE_INFO_SDK_VERSION
Version of SDK (string)
Definition: odla_device.h:91
@ ODLA_DEVICE_INFO_USED_MEMORY
Size of used device memory (int64)
Definition: odla_device.h:87
@ ODLA_DEVICE_INFO_TOTAL_MEMORY
Size of device memory (int64)
Definition: odla_device.h:86
@ ODLA_DEVICE_INFO_DRIVER_VERSION
Version of driver (string)
Definition: odla_device.h:90
@ ODLA_DEVICE_INFO_POWER_USAGE
Current power usage in watt (float)
Definition: odla_device.h:88
@ ODLA_DEVICE_INFO_PROCESSOR_UTIL
Definition: odla_device.h:82
@ ODLA_DEVICE_INFO_DEV_TYPE
Name/model of device (string)
Definition: odla_device.h:80

◆ odla_device_name

Supported devices.

Definition at line 51 of file odla_device.h.

51 {
52 ODLA_DEVICE_DEFAULT,
53 // Alibaba
54 ODLA_DEVICE_ALIBABA_HANGUANG,
55 // ARM
56 ODLA_DEVICE_ARM_CORTEX_M,
57 // Cambricon
58 ODLA_DEVICE_CAMBRICON_MLU220,
59 ODLA_DEVICE_CAMBRICON_MLU270,
60 // GraphCore
61 ODLA_DEVICE_GRAPHCORE_IPU,
62 // Intel Habana
63 ODLA_DEVICE_HABANA_GAUDI,
64 ODLA_DEVICE_HABANA_GOYA,
65 // Intel CPU
66 ODLA_DEVICE_INTEL_X86,
67 ODLA_DEVICE_INTEL_DNNL,
68 // NVidia
69 ODLA_DEVICE_NVIDIA_GPU,
70 ODLA_DEVICE_NVIDIA_TENSORRT,
71 // Qualcomm
72 ODLA_DEVICE_QUALCOMM_AIC100,
odla_device_name
Supported devices.
Definition: odla_device.h:51

◆ odla_vendor_info

Vendor info.

Definition at line 45 of file odla_device.h.

45 {
46 OVI_DESCRIPTION,
47 OVI_FEATURE_SET,
odla_vendor_info
Vendor info.
Definition: odla_device.h:45

◆ odla_vendor_name

Supported vendors.

Definition at line 32 of file odla_device.h.

32 {
33 ODLA_VENDOR_DEFAULT,
34 ODLA_VENDOR_ALIBABA,
35 ODLA_VENDOR_ARM,
36 ODLA_VENDOR_CAMBRICON,
37 ODLA_VENDOR_GRAPHCORE,
38 ODLA_VENDOR_HABANA,
39 ODLA_VENDOR_INTEL,
40 ODLA_VENDOR_NVIDIA,
41 ODLA_VENDOR_QUALCOMM,
odla_vendor_name
Supported vendors.
Definition: odla_device.h:32

Function Documentation

◆ odla_AllocateDevice()

ODLA_API_EXPORT odla_status ODLA_API_CALL odla_AllocateDevice ( odla_vendor  vendor,
odla_device_name  device_name,
odla_int32  device_idx,
odla_device device 
)

Allocate a device.

Parameters
vendorthe vendor object (can be NULL)
device_namethe device name
devicethe pointer to the allocated device object
Returns
odla_status

◆ odla_CreateDeviceConfig()

ODLA_API_EXPORT odla_status ODLA_API_CALL odla_CreateDeviceConfig ( odla_device_config device_config)

Create a device config object.

Parameters
device_configthe pointer to the created config object
Returns
odla_status

◆ odla_DestroyDevice()

ODLA_API_EXPORT odla_status ODLA_API_CALL odla_DestroyDevice ( odla_device  device)

Destroy an allocated device.

Parameters
devicethe device object
Returns
odla_status

◆ odla_DestroyDeviceConfig()

ODLA_API_EXPORT odla_status ODLA_API_CALL odla_DestroyDeviceConfig ( odla_device_config  device_config)

Destroy a device config object.

Parameters
device_configthe config object
Returns
odla_status

◆ odla_GetDeviceInfo()

ODLA_API_EXPORT odla_status ODLA_API_CALL odla_GetDeviceInfo ( odla_device  device,
odla_device_info  info_type,
odla_scalar_value info_value 
)

Get the device info.

Parameters
devicethe device object
info_namethe querying info name
allocated_info_value_sizethe allocated info_value size
info_valuethe pointer to the info_value
retrieved_info_value_sizethe retrieved info_value size
Returns
odla_status

◆ odla_GetVendor()

ODLA_API_EXPORT odla_status ODLA_API_CALL odla_GetVendor ( const odla_vendor_name  vendor_name,
odla_vendor vendor 
)

Get the vendor object.

Parameters
vendor_namethe vendor name
vendorthe pointer to the accessed device object
Returns
odla_status

◆ odla_GetVendorInfo()

ODLA_API_EXPORT odla_status ODLA_API_CALL odla_GetVendorInfo ( const odla_vendor  vendor,
const odla_vendor_info  info_name,
const odla_size_t  allocated_info_value_size,
odla_void info_value,
odla_size_t retrieved_info_value_size 
)

Get the vendor info.

Parameters
vendorthe vendor object
info_namethe querying info name
allocated_info_value_sizethe allocated info_value size
info_valuethe pointer to the info_value
retrieved_info_value_sizethe retrieved info_value size
Returns
odla_status

◆ odla_InitDevice()

ODLA_API_EXPORT odla_status ODLA_API_CALL odla_InitDevice ( odla_device  device,
const odla_device_config  config 
)

Initialize an allocated device.

Parameters
devicethe device object
configthe device configuration object
Returns
odla_status

◆ odla_SetCurrentDevice()

ODLA_API_EXPORT odla_status ODLA_API_CALL odla_SetCurrentDevice ( odla_device  device)

Set an allocated device as the current device.

Parameters
devicethe device object
Returns
odla_status

◆ odla_SetDeviceConfigItem()

ODLA_API_EXPORT odla_status ODLA_API_CALL odla_SetDeviceConfigItem ( odla_device_config  device_config,
odla_device_config_item  device_config_item,
  ... 
)

Set the device config with a property item.

Parameters
device_configthe device config object
device_config_itemthe item
variadic
Returns
odla_status