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