dsmi_get_logicid_from_phyid
Prototype
int dsmi_get_logicid_from_phyid(unsigned int phyid, unsigned int *logicid)
Description
Obtains the the Ascend AI Processor logical ID from a physical ID.
In a container, logical ID refers to the logical ID of a device. On a physical machine, both logical ID and physical ID refer to the device ID.
For the Ascend 310 AI Processor, this API supports mini modules (EP) and standard PCIe cards.
Parameters
Parameter |
Input/Output |
Description |
---|---|---|
phyid |
Input |
Physical ID The value range is [0, device_count – 1], where device_count is obtained from the dsmi_get_device_count call. |
logicid |
Output |
Logical ID, that is, the slot_id |
Returns
Type |
Description |
---|---|
int |
0 on success; else, failure |
Restrictions
None
Example
... int ret = 0; unsigned int phyid = 0; unsigned int logicid =0; ret = dsmi_get_logicid_from_phyid(phyid,&logicid); ...