Cal
Applicable Products
Hardware Model |
Supported or Not |
|---|---|
Not supported |
|
Not supported |
|
Not supported |
|
Supported |
|
Supported |
Function Description
API function:
- asdBlasMakeCalPlan: initializes the Cal operator configuration corresponding to the handle.
- asdBlasSscal: performs scaling on a real-numbered vector. That is, each element in the vector is multiplied by a real-number alpha.
- asdBlasCsscal: performs scaling on a complex-number vector. That is, each element in the vector is multiplied by a real-number alpha.
- asdBlasCscal: performs scaling on a complex-number vector. That is, each element in the vector is multiplied by a complex-number alpha.
Formula:
- asdBlasSscal formula:
- asdBlasCsscal formula:
- asdBlasCscal formula:
Function Prototype
- AspbStatus asdBlasMakeCalPlan(asdBlasHandle handle)
- AspbStatus asdBlasSscal(asdBlasHandle handle, const int64_t n, const float &alpha, aclTensor *x, const int64_t incx)
- AspbStatus asdBlasCsscal(asdBlasHandle handle, const int64_t n, const float &alpha, aclTensor *x, const int64_t incx)
- AspbStatus asdBlasCscal(asdBlasHandle handle, const int64_t n, const std::complex<float> &alpha, aclTensor *x,const int64_t incx)
Parameter Description
- asdBlasMakeCalPlan
Parameter
Input/Output
Type
Description
handle
Input
asdBlasHandle
cal operator handle.
- asdBlasSscal & asdBlasCsscal & asdBlasCscal
Parameter
Input/Output
Type
Description
handle
Input
asdBlasHandle
sscal operator handle.
n
Input
const int64_t
Total number of elements.
alpha
Input
const float &
The scalar factor alpha applied to the vector.
x
Input/Output
aclTensor *
x in the formula, which is a tensor on the device. The data type can be FLOAT32, the data format can be ND, and the shape is [n].
incx
Input
const int64_t
Memory address increment between the consecutive elements (currently, the offset is 1).
Return Value Description
For details about the return values, see Return Value.
Constraints
- asdBlasMakeCalPlan: none.
- asdBlasSscal
- The input element count currently supports the range [1, 6.71e+06].
- The input shape of the operator is [n], and the output shape is [n].
- The operator does not support the calculation for three or more dimensions.
- asdBlasCsscal
- The input element count currently supports the range [1, 6.71e+06].
- The input shape of the operator is [n], and the output shape is [n].
- The operator does not support the calculation for three or more dimensions.
- asdBlasCscal
- The input element count currently supports the range [1, 6.71e+06].
- The input shape of the operator is [n], and the output shape is [n].
- The operator does not support the calculation for three or more dimensions.
Calling Example
For details about the operator calling example, see Cal.