Function: reduce_async
Applicability
Product |
Supported (√/x) |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Function Usage
Performs a Reduce operation, including SUM, MIN, and MAX.
This API is asynchronous. The API call delivers a task rather than executes a task. After this API is called, you need to call a synchronization API (for example, synchronize_stream) to ensure that the task is complete. Otherwise, service exceptions (such as training or inference exception) or unknown situations (such as device link or card disconnection) may occur.
Prototype
- C Prototype
aclError aclrtReduceAsync(void *dst, const void *src, uint64_t count, aclrtReduceKind kind, aclDataType type, aclrtStream stream, void *reserve)
- Python Function
1ret = acl.rt.reduce_async(dst, src, count, kind, type, stream, reserve)
Parameter Description
Parameter |
Description |
|---|---|
dst |
Int, pointer to the destination memory address. |
src |
Int, pointer to the source memory address. |
count |
Int, size of the source memory, in bytes. |
kind |
Int, operation type. For details, see aclrtReduceKind. |
type |
Int, data type. The The The The The For details, see aclDataType. |
stream |
Int, stream. If the default stream is used, set the parameter to 0. |
reserve |
Int, reserved parameter. Currently, the value is fixed to NULL. |
Return Value Description
Return Value |
Description |
|---|---|
ret |
Int, error code: 0 on success; else, failure. |
Restrictions
dts and src must be on the same device as stream.