函数:get_res_in_current_thread
产品支持情况
产品 |
是否支持 |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
功能说明
获取当前线程可使用的Device资源。
获取时,按照如下优先级返回value:Stream级别的Device资源限制(调用acl.rt.set_stream_res_limit接口设置)>当前进程的Device资源限制(调用acl.rt.set_device_res_limit接口设置) >昇腾AI处理器硬件默认的资源限制。
函数原型
- C函数原型
aclError aclrtGetResInCurrentThread(aclrtDevResLimitType type, uint32_t *value)
- python函数
1value, ret = acl.rt.get_res_in_current_thread(type)
参数说明
参数名 |
说明 |
|---|---|
type |
int,资源类型,当前支持Cube Core、Vector Core,具体请参见新增数据结构aclrtDevResLimitType。 |
返回值说明
返回值 |
说明 |
|---|---|
value |
int,当前线程资源限制的大小。 |
ret |
int,返回0表示成功,返回其他值表示失败。 |
父主题: 运行时配置