QuietNaN
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
x |
|
x |
|
x |
|
x |
|
x |
|
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
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
1float value = AscendC::NumericLimits<float>::QuietNaN();
- Vector API
1AscendC::NumericLimits<float>::QuietNaN(dstLocal, 256); // Return a quiet NaN value for 256 elements of float.