函数:reduce_async
产品支持情况
|
产品 |
是否支持 |
|---|---|
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
|
|
x |
|
|
x |
功能说明
执行Reduce操作,包括SUM、MIN、MAX等。
本接口是异步接口,调用接口成功仅表示任务下发成功,不表示任务执行成功。调用该接口后,需调用同步等待接口(例如,synchronize_stream)确保任务已执行完成,否则可能会导致训练或推理等业务异常、Device断链掉卡等未知情况。
函数原型
- C函数原型
aclError aclrtReduceAsync(void *dst, const void *src, uint64_t count, aclrtReduceKind kind, aclDataType type, aclrtStream stream, void *reserve)
- python函数
1ret = acl.rt.reduce_async(dst, src, count, kind, type, stream, reserve)
参数说明
|
参数名 |
说明 |
|---|---|
|
dst |
int,目的内存地址指针。 |
|
src |
int,源内存地址指针。 |
|
count |
int,源内存大小,单位为Byte。 |
|
kind |
|
|
type |
int,数据类型。 |
|
stream |
int,指定Stream。如果使用默认Stream,此处设置为0。 |
|
reserve |
int,预留参数。当前固定传NULL。 |
返回值说明
|
返回值 |
说明 |
|---|---|
|
ret |
int,错误码,返回0表示成功,返回其它值表示失败。 |
约束说明
dts、src必须跟stream所在的Device是同一个设备。