GetAccVal (ISASI)

Applicability

Product

Supported/Unsupported

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

x

Atlas inference product's AI Core

x

Atlas inference product's Vector Core

x

Atlas training products

x

Function Usage

Obtains the computation result of the ReduceSum API (the API for computing the first n pieces of data in a tensor, where n is the count parameter of the API).

Prototype

1
2
template <typename T>
__aicore__ inline T GetAccVal()

Parameters

Table 1 Template parameters

Parameter

Description

T

Data type of the ReduceSum instruction. The value can be half or float.

Returns

Computation result of the ReduceSum API (the API for computing the first n data elements of a tensor, where n is the count parameter of this API).

Constraints

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::GetAccVal<float>();