dcmi_get_device_phyid_from_logicid接口原型
函数原型
int dcmi_get_device_phyid_from_logicid(unsigned int logicid, unsigned int *phyid)
功能说明
根据设备逻辑ID获取物理ID。
参数说明
参数名称 |
输入/输出 |
类型 |
描述 |
---|---|---|---|
logicid |
输入 |
unsigned int |
NPU设备逻辑ID,当前实际支持的ID通过dcmi_get_device_logic_id接口获取。 |
phyid |
输出 |
unsigned int |
NPU设备物理ID。 |
返回值
类型 |
描述 |
---|---|
int |
处理结果:
|
异常处理
无。
约束说明
Linux物理机 |
Linux物理机容器 |
|
root用户 |
运行用户组(非root用户) |
root用户 |
Y |
Y |
Y |
调用示例
… int ret; int card_id = 0; int chip_id = 0; int logic_id = 0; unsigned int phy_id = 0; ret = dcmi_get_device_logic_id(&logic_id, card_id, chip_id); if (ret != DCMI_OK) { printf("dcmi_get_device_logic_idfailed. err is %d\n", ret); return ret; } ret = dcmi_get_device_phyid_from_logicid((unsigned int)logic_id, &phy_id); if (ret != DCMI_OK) { printf("dcmi_get_device_phyid_from_logicidfailed. err is %d\n", ret); } return ret; …
父主题: 设备管理接口