Asum
Applicable Products
Hardware Model |
Supported or Not |
|---|---|
Not supported |
|
Not supported |
|
Not supported |
|
Supported |
|
Supported |
Function Description
API function:
- asdBlasMakeAsumPlan: initializes the Asum operator configuration corresponding to the handle.
- asdBlasSasum: sums up the absolute values of all input elements.
- asdBlasScasum: sums up the absolute values of all input elements. The input elements are complex numbers.
Formula:
Function Prototype
- AspbStatus asdBlasMakeAsumPlan(asdBlasHandle handle)
- AspbStatus asdBlasSasum(asdBlasHandle handle, const int64_t n, aclTensor *x, const int64_t incx, aclTensor *result)
- AspbStatus asdBlasScasum(asdBlasHandle handle, const int64_t n, aclTensor *x, const int64_t incx, aclTensor *result)
Parameter Description
- asdBlasMakeAsumPlan
Parameter
Input/Output
Type
Description
handle
Input
asdBlasHandle
Asum operator handle.
- asdBlasSasum & asdBlasScasum
Parameter
Input/Output
Type
Description
handle
Input
asdBlasHandle
asum operator handle.
n
Input
const int64_t
Total number of elements.
x
Input
aclTensor *
x in the formula, which is a tensor on the device. The data format can be ND, and the shape is [n].
- For Sasum, the supported data type is FLOAT32.
- For Scasum, the supported data type is COMPLEX64.
incx
Input
const int64_t
Memory address increment between the consecutive elements (currently, the offset is 1).
result
Output
aclTensor *
result in the formula, which is a tensor on the device. The supported data type is FLOAT32. It contains only one element. The data format supports ND, and the shape is [1].
Return Value Description
For details about the return values, see Return Value.
Constraints
- asdBlasMakeAsumPlan: none.
- asdBlasSasum
- The input element count n currently supports the range [1, 6.71e+06].
- The input shape of the operator is [n], and the output shape is [1].
- The operator does not support the calculation for three or more dimensions.
- asdBlasScasum
- The input element count n currently supports the range [1, 6.71e+06].
- The input shape of the operator is [n], and the output shape is [1].
- The operator does not support the calculation for three or more dimensions.
Calling Example
For details about the operator calling example, see Asum.

