函数:set_stream_res_limit
产品支持情况
产品 |
是否支持 |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
功能说明
设置指定Stream的Device资源限制。
本接口应在调用acl.rt.set_device接口之后且在执行算子之前使用。如果对同一Stream进行多次设置,将以最后一次设置为准。
调用本接口设置指定Stream的Device资源限制后,需配合调用acl.rt.use_stream_res_in_current_thread接口,设置在当前线程中使用指定Stream上的Device资源限制。
函数原型
- C函数原型
aclError aclrtSetStreamResLimit(aclrtStream stream, aclrtDevResLimitType type, uint32_t value)
- python函数
1ret = acl.rt.set_stream_res_limit(stream, type , value)
参数说明
参数名 |
说明 |
|---|---|
stream |
int,指定Stream, 若传入0,则表示默认Stream。 |
type |
int,资源类型,当前支持Cube Core、Vector Core,具体请参见新增数据结构aclrtDevResLimitType。 |
value |
int,资源限制的大小。 |
返回值说明
返回值 |
说明 |
|---|---|
ret |
int,返回0表示成功,返回其他值表示失败。 |
父主题: 运行时配置