MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / hypot

Method hypot

samples/common/half.h:1864–1873  ·  view source on GitHub ↗

Hypotenuse implementation. \param x first argument \param y second argument \return function value stored in single-preicision

Source from the content-addressed store, hash-verified

1862 /// \param y second argument
1863 /// \return function value stored in single-preicision
1864 static expr hypot(float x, float y)
1865 {
1866#if HALF_ENABLE_CPP11_CMATH
1867 return expr(std::hypot(x, y));
1868#else
1869 return expr((builtin_isinf(x) || builtin_isinf(y))
1870 ? std::numeric_limits<float>::infinity()
1871 : static_cast<float>(std::sqrt(static_cast<double>(x) * x + static_cast<double>(y) * y)));
1872#endif
1873 }
1874
1875 /// Power implementation.
1876 /// \param base value to exponentiate

Callers

nothing calls this directly

Calls 4

exprClass · 0.70
hypotFunction · 0.70
builtin_isinfFunction · 0.70
sqrtFunction · 0.70

Tested by

no test coverage detected