GetAccVal (ISASI)
Applicability
Product |
Supported |
|---|---|
√ |
|
√ |
|
x |
|
x |
|
x |
|
x |
Function
Obtains the computation result of the ReduceSum API (API for computing the first n data elements of a tensor, where n is the count parameter passed to the API).
Prototype
1 2 | template <typename T> __aicore__ inline T GetAccVal() |
Parameters
Parameter |
Description |
|---|---|
T |
Data type of the ReduceSum instruction. The value can be half or float. |
Returns
Computation result of the ReduceSum API (API for computing the first n data elements of a tensor, where n is the count parameter passed to the API).
Restrictions
None
Example
1 2 3 4 5 | AscendC::LocalTensor<float> src; AscendC::LocalTensor<float> work; AscendC::LocalTensor<float> dst; AscendC::ReduceSum(dst, src, work, 128); float res = AscendC::GetAccVal<float>(); |
Parent topic: Reduction Computation