3.256. __nv_norm

double @__nv_norm(i32 %dim, double const* %a)

Calculate the square root of the sum of squares of any number of coordinates.

Calculate the length of a vector p, dimension of which is passed as an argument without undue overflow or underflow.

Note

For accuracy information, see the CUDA C++ Programming Guide, Mathematical Functions Appendix, Double-Precision Floating-Point Functions section.

Returns

Returns the length of the dim-D vector \(\sqrt{\sum_{i=1}^{dim} p_i^2}\). If the correct value would overflow, returns \(+\infty\). If the correct value would underflow, returns 0. If two of the input arguments is 0, returns remaining argument