GetReduceRepeatSumSpr(ISASI)

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

x

Atlas inference product AI Core

x

Atlas inference product Vector Core

x

Atlas training product

x

Function Usage

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 GetReduceRepeatSumSpr()

Parameters

Table 1 Parameters in the template

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

Examples

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::GetReduceRepeatSumSpr<float>(); // Return the sum of the first 128 numbers.