QuietNaN

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

x

Atlas A2 training product/Atlas A2 inference product

x

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

Returns a quiet NaN value of a specified data type (the most significant bit of the floating-point mantissa is 1).

For the Atlas 350 Accelerator Card, the supported data types are half, bfloat16_t, and float.

Prototype

  • Scalar API, which returns a scalar.
    constexpr __aicore__ static inline T QuietNaN()
  • Vector API, which assigns a quiet NaN value to the first count elements of dstLocal.
    __aicore__ static inline void QuietNaN(const LocalTensor<T>& dstLocal, uint32_t count)

Parameters

Table 1 Parameters

Parameter

Input/Output

Description

dstLocal

Output

Destination operand.

Parameter of the LocalTensor type. TPosition can be VECIN, VECCALC, or VECOUT.

The start address of LocalTensor must be 32-byte aligned.

count

Input

Number of elements of the input data.

Returns

The scalar API returns a quiet NaN value of the corresponding data type.

The vector API has no return value.

Restrictions

None

Example

  • Scalar API
    1
    float value = AscendC::NumericLimits<float>::QuietNaN();
    
  • Vector API
    1
    AscendC::NumericLimits<float>::QuietNaN(dstLocal, 256); // Return a quiet NaN value for 256 elements of float.