norm4df
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
x |
|
x |
|
x |
|
x |
|
x |
|
x |
Function Usage
Obtains the square root of the sum of squares of the input data a, b, c, and d (a2 + b2 + c2 + d2).

Prototype
1 | inline float norm4df(float a, float b, float c, float d) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
a |
Input |
Source operand. |
b |
Input |
Source operand. |
c |
Input |
Source operand. |
d |
Input |
Source operand. |
Returns
Square root of a2 + b2 + c2 + d2.
- If the square root of a2 + b2 + c2 + d2 exceeds the maximum range of float, the return value is inf.
- If any one or more of a, b, c, and d are ±inf, the return value is inf.
- If one or more of a, b, c, and d are nan and not ±inf, the return value is nan.
Restrictions
For SIMT programming, this API is not supported.
Header File to Be Included
To use this API, the simt_api/math_functions.h header file must be included.
1 | #include "simt_api/math_functions.h" |
Examples
For SIMD and SIMT programming:
1 2 3 4 5 | __simt_vf__ __launch_bounds__(1024) inline void KernelNorm4d(__gm__ float* dst, __gm__ float* a, __gm__ float* b, __gm__ float* c, __gm__ float* d) { int idx = threadIdx.x + blockIdx.x * blockDim.x; dst[idx] = norm4df(a[idx], b[idx], c[idx], d[idx]); } |
Parent topic: Mathematical Functions